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 Pre-Hook Name and Post-Hook Name properties

Understand the Pre-Hook Name and Post-Hook Name properties

  • Last UpdatedOct 23, 2024
  • 3 minute read

The name of the Extensibility Hook is configured in this column.

Note: If the name is left blank (or empty), the middleware assumes that the Extensibility Hook is not configured.

Stored procedure

A valid stored procedure name from the MES database, if the type of Extensibility Hook is stored procedure.

The parameter names, data types, and presence of default values in the custom (hook) stored procedure must match exactly those of the parameter names, data types, and presence of default values in the middleware stored procedure (stored procedures configured in the Middleware SP Name column). However, there can be additional parameters in the custom (hook) stored procedure that might not be matching the parameters in the middleware stored procedure, but those additional parameters must be defaulted to NULL in the custom stored procedure. If they are not defaulted to NULL, an exception might be raised by the database layer for not supplying enough values for those additional parameters. It is recommended that the list of stored procedure parameters, data types, and default values (if any) be copied from the middleware stored procedure to the custom stored procedure to ensure all these properties are identical between them. However, the default values for the custom (hook) stored procedure do not have to exactly match the default values in the middleware stored procedure.

The values supplied for the middleware stored procedure (configured in the Middleware SP Name column) are the same values supplied to the custom (hook) stored procedure.

Assembly

The hook method in the assembly has a single string parameter that accepts the XML message from the middleware event. The XML message is the exact XML generated for the middleware event to process. The end user is responsible for parsing the XML message and extracting the relevant data from the XML message. See the Stateless API help for more details about the XML structure. The middleware calls impersonate the System Platform Network User; therefore, the custom (hook) assembly is invoked as that user.

The assembly name can be configured in two ways:

  • If the assembly is added to the GAC, then the detailed information about the assembly version, public key token, etc. must be specified.

  • However, if the assembly is not added to the GAC, then the physical location of the assembly must be specified.

In both of these cases, the class name and the method name must be specified by separating them by a semi-colon (;).

Note: The configured Extensibility Hook method can accept only one string parameter.

Assembly is not added to the GAC

If the assembly is not currently added to the GAC, the user is required to specify the physical location of the assembly itself to load the assembly from the specified path.

For example,

C:\Temp\TestHooks\TestHooks\bin\Debug\TestHooks.dll;TestHooksNamespace.TestHooksClass;TestHooksMethod

represents the assembly name as TestHooks.dll, located at the path C:\Temp\TestHooks\TestHooks\bin\Debug\, and that has the namespace TestHooksNamespace, class name TestHooksClass, and the method name TestHooksMethod.

Assembly is added to the GAC

If the assembly is currently added to the GAC, the user is required to specify the public key token, assembly version, and so on, to load the right assembly from the GAC.

Note: The assembly must be signed with a strong name.

For example,

TestHooks,version=1.0.0.0,culture=neutral,processorarchitecture=MSIL,PublicKeyToken=23116b86e706d0de;TestHooksNamespace.TestHooksClass;TestHooksMethod

represents the assembly name as TestHooks.dll, version as 1.0.0.0, public key token as 23106a86e706d0ae, and that has the namespace TestHooksNamespace, class name TestHooksClass, and the method name TestHooksMethod.

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