webMethods OneData 10.11 | Managing Master Data with webMethods OneData | Developing for webMethods OneData | webMethods OneData Hooks | How are hooks used in webMethods OneData? | Hook Types | Stored Procedure Hooks
 
Stored Procedure Hooks
You can invoke a stored procedure using either standard hooks or iHooks. webMethods OneData uses XML to communicate with the iHook stored procedure. A stored procedure hook can complete successfully if it does not execute a raise_application_error command.
For post-processing iHooks (webMethods OneData interactive mode), use an hookOutput message and hookOutput.status = 'stop' to return error conditions.
To return an error from the stored procedure to webMethods OneData, the stored procedure must invoke, Raise_application_error (-20001, 'Error description')
If an event-driven hook (pre-processing or post-processing) invokes the stored procedure and it returns an error, the entire transaction rolls back. For example, when you insert a new record in webMethods OneData, if the post-processing stored procedure returns an error, webMethods OneData does not insert the new record in the repository.
The properties that define a stored procedure hook are as follows:
Property
Description
Hook Name
Name of the hook.
Hook execution mode
The webMethods OneData mode in which the hook should be executed:
*Default
*Nova
Hook Type
Select the Stored Procedure hook type.
Connection
Select the connection to the database where the stored procedure is available.
Program Name
Name of the external program to be executed.
Default Parameters
Parameters used for invoking the stored procedure. For more details about default parameters, see Default Parameters in a Stored Procedure Hook.
Is Interactive Hook?
Indicates if the hook is an iHook. This property is selected by default and cannot be changed.
Hook Cardinality
Execution parameter that determines when to execute the external program. The hook executes the program based on the number of rows changed:
*0. Hook executes when no rows are changed.
*1. Hook executes when one row is changed.
*n. Hook executes when more than one row is changed.