API Hooks in Branch/Merge
Description
There is a new folder "src\hooks" with five (5) new files:
- includeHooks.inc : - include file that has functions common to the branch and merge hooks, must be included before branchHooks.inc and mergeHooks.inc but after set.inc and doors.inc.
- branchHooks.inc : - include file that has the hook functions called throughout the branching code. The functions wrap calls to the user hooks in evaluation statements so that errors in the user code do not affect the branching code.
- userBranchHooks.dxl : - file to be modified by the user.
- The hook file name/location and function signatures (return value, name, and parameter types/sequence) within cannot be modified.
- The hook names describe where in the code the hook is called, e.g. the hook function
- userHook_beforeCopyViews is called before the views are copied of a module.
- userHook_afterDuplicateModuleLoop is called after the loop that duplicates all the modules.
- The code within the functions can be modified by the user.
- The global variable "gb_USERHOOK_PRINT" can be removed or changed as the user desires. Global variables defined in this file are not, and cannot, be access by any other files since the code is evaluated in a separate context.
- Note: user code that displays a GUI dialog box may have unintended consequences (including run time warnings or errors) when run in batch mode (e.g. branching using the command line).
- mergeHooks.inc : - same as branchHooks.inc, but for merge.
- userMergeHooks.dxl: - same as userBranchHooks.dxl, but for merge.
Note 1 : You will find below all the hooks listed (without prefix "userHook_") and their level:
Branch Hooks:

Merge Hooks:

Note 2 :
- In the merge code, all the hooks are level one since there are no overarching loops in the code, each merge operation is a separate event.
- In the branch code, there are three levels. The first level is before and after the overall branching operation begins/ends. The second level is defined by three major loops that process each module in turn. The third level is per module in one of the major loops.