Hooks are programmable waypoints in the built-in automated behavior of IBM Tivoli Directory Integrator, where we can impose our own logic.
Hooks are found in AssemblyLines, Connectors and Function Components. For example, if we want to skip or restart parts of the AssemblyLine entirely, you typically do this from within a Hook in a Connector:
The constructs below can be used to exit a Branch Component or Loop, too.
If you put any code in an Error Hook and do not terminate the current AssemblyLine or EventHandler, then processing continues regardless of how you got to the Error Hook. This means that even syntax errors in your script are ignored. So be sure to check the error object if we want to know what caused the error.
The methods described in the previous list can be regarded as goto-statements, in that no further code in this Hook is run. For example:
system.skipEntry(); // Causes the flow to change // This next line is never executed. task.logmsg("This will never be reached");
There is a difference between an error Hook that is absent, and one that is empty - even though this may not always be easy to spot in the Configuration Editor. An empty error Hook causes the system to reset the error condition that caused the Hook to be called, after which the server continues processing, whereas an absent or undefined Hook causes the system to perform default error handling (typically aborting the AssemblyLine).
Parent topic: The AssemblyLine