Understand pre-hook and post-hook configuration
- Last UpdatedOct 23, 2024
- 1 minute read
A pre-hook and the post-hook can be configured for a single middleware event to invoke one or more stored procedures (if more than one stored procedure call is embedded inside the single custom stored procedure configured into an Extensibility Hook; see the second note below for more details) or they can be configured to invoke a .NET assembly to handle more complex activities. When invoking a stored procedure, the custom (hook) stored procedure must exist in the MES database targeted by the Middleware Server. Similarly, when invoking a .NET assembly, the assembly must exist in the specified path (see Assembly for more details about assembly configuration).
Both pre- and post-hooks can be configured to either continue or stop if an error is encountered. Pre-hooks can also be configured to stop after executing and not allow the normal stored procedure to be called, even in the absence of an error. See Understand the pre-hook and post-hook Middleware Flow property for more information.
Notes
-
A single middleware event can have only one pre-hook and one post-hook.
-
To execute more than one stored procedure for a single middleware event, all the custom stored procedures must be invoked from inside the custom stored procedure named in the hook. Similarly, to invoke more than one assembly for a single middleware event, all the intended assemblies must be invoked inside that single custom assembly named in the hook.
-
If a pre-hook or a post-hook is not linked to a middleware event, then that middleware event is not affected by any custom hook implementations inside or outside the MES database.