Process Error Schemas

The error process variables contain the default data returned in the event of an error. You can define specific error schemas to hold error data when errors are propagated from a group or a called process. Each process can define a number of error schemas by creating these schemas on the Error Schema tab of the process definition’s End Activity .

Error schemas are created like any other schema (see Editor). However, the Error Schema tab of the End activity allows you to create more than one error schema. The following figure illustrates the Error Schemas tab with two error schemas. The left panel of the tab allows you to create or delete schemas. The middle portion allows you to modify the selected schema. The right panel of the tab allows you to modify each schema item.

The Error Schemas tab

Error schemas are used by the Generate Error activity. When the Generate Error activity is executed, the specified error schema is propagated to the parent process. The following figure illustrates the Configuration tab of the Generate Error activity. The Select Error Schema field contains a drop-down list of error schemas defined for the process.

The Generate Error Configuration tab

If - Default - is chosen for the error schema, only the $_error process variable contains the propagated error data.

If a process error schema is chosen, the schema appears in the Input tab for the Generate Error activity and you can map data to the specified error schema. At run time, the Generate Error propagates the specified error schema to the parent process in the $_error_<activity-name> process variable.

The process variable is derived from the activity where the Generate Error occurred. If the Generate Error occurs in a called process, the <activity-name> portion of the process variable is the name of the Call Process activity. If the Generate Error occurred in a group, the <activity-name> portion is the name of the Generate Error activity in the group.

In the example described in Called Process Error Propagation, the SendErrorInOrder activity has access to the error schema supplied by any GenerateError activity in the GetCreditLimitProcess. This process specifies two error schemas, InvalidCustomer and NotEnoughCredit. The following figure illustrates the process data available to the SendErrorInOrder activity.

Example of process data for error schemas

The available error schemas for the GetCreditLimit process are presented as a schema item of type Choice. This item will contain either the InvalidCustomer or the NotEnoughCredit error schema. You can use XPath to determine which schema is actually contained in the element, and then map the data in the schema accordingly.

For more information about the Generate Error activity, see TIBCO ActiveMatrix BusinessWorks Palette Reference.