Please ensure Javascript is enabled for purposes of website accessibility
Powered by Zoomin Software. For more details please contactZoomin

AVEVA™ Manufacturing Execution System 2023 R2

Understand the Extensibility Hooks tab

  • Last UpdatedOct 23, 2024
  • 3 minute read

On this tab, you can configure extensibility hooks.

Extensibility indicates that the system functionality is extendable without making any major changes to the system architecture. Extensibility hooks are used for the following:

  • Extend the middleware functionality by executing custom code

  • Replace the current middleware stored procedure if you want to perform some different action

Custom code can be executed before or after a method with middleware code. Extensibility hooks can be .NET assemblies or stored procedures. You can configure extensibility hooks as a part of a custom mapping file that the middleware uses while processing commands. You can configure the following extensibility hooks:

  • Pre hook - Calls custom code to execute before executing a middleware stored procedure.

  • Post hook - Calls custom code to execute after executing a middleware stored procedure.

You can configure one pre hook and one post hook for a middleware stored procedure. You can also configure the flow of the middleware after execution of configured hooks.

A middleware flow specifies the status of the middleware after executing a hook.

The MES middleware configurator editor Extensibility Hooks tab showing the settings that must be configured to call custom code before or after executing a middleware stored procedure.

The extensibility hook settings are described below.

Middleware SP Name

The middleware stored procedure for which you want to configure a hook.

Pre Hook Name

The name for the pre hook.

Pre Hook Type

SP or ASSEMBLY.

Middleware Flow

The required middleware flow for the pre hook: STOP, STOP ON ERROR, or CONTINUE EVEN ON ERROR.

Post Hook Name

The name for the post hook.

Post Hook Type

SP or ASSEMBLY.

Middleware Flow

The required middleware flow for the post hook: STOP ON ERROR or CONTINUE EVEN ON ERROR.

The following topics provide an overview for configuring a pre hook and post hook. For details, see Middleware extensibility hooks.

Configuring a Pre Hook

The pre hook is configured for the specified middleware method.

When you configure a pre hook, the pre hook is mapped to the middleware. The pre hook is called before executing the middleware code. If the pre hook is of type SP, then the same parameter list from the middleware SP is passed to the custom SP.

The middleware flow after executing the pre hook can be one of the following:

  • The flow stops when the pre hook is called. A value is returned to the calling method and any changes or updates made with the transaction are not committed. The middleware does not call the current method or any other post hooks. The pre hook replaces the current middleware method in this case.

  • The flow stops in case of any error and an error message is returned to the calling method. The middleware does not call the current middleware method or any post hooks.

  • The flow always continues to the middleware code irrespective of any errors. A warning message is returned to the calling method in case of any error.

Configuring a Post Hook

The post hook is configured for the specified middleware method.

When you configure a post hook, the post hook is mapped to the middleware. The post hook is called after executing the middleware code. If the post hook is of type SP, then the same parameter list from the middleware SP is passed to the custom SP.

The middleware flow after executing the post hook can be one of the following:

  • The flow stops in case of any error. No changes are saved and no information is returned to the calling method except a generated error message.

  • The flow always continues to the middleware code irrespective of any errors. A transaction is committed irrespective of any error and a warning message is returned to the calling method.

In This Topic
TitleResults for “How to create a CRG?”Also Available in