$_error_<activityName> Process Variables
Each activity has one or more predefined error schemas. The error schemas are displayed on the activity’s Error Output tab. Typically, there are two or three types of exceptions an activity can encounter, and these are represented as a choice element in the error output schema. For example, the following illustrates the error output schema of the Create File activity:
This activity can encounter the FileAlreadyExistsException or the FileIOException.
describes the error schemas on the Error Output tab of all activities and lists possible causes for each error type. Refer to the description of each activity for more information about the Error Output tab.When an error is encountered, the $_error_<
activityName
>
process variable is created and populated with the error data. The name of the process variable is dependent upon the activity’s specified name. You can obtain the error by examining the $_error_<
activityName
>
process variable in subsequent activities after an error transition. The following illustrates the Process Data panel that is available after the activity named MyCreateFile encounters an error:
You can use XPath expressions to determine which error occurred and handle the error accordingly. For example, in the above error schema, if the FileAlreadyExistsException error occurs, then that node is not empty. The following expression can be used to determine if the FileAlreadyExistsException occurred:
boolean($_error_MyCreateFile/ActivityErrors/ns2:FileAlreadyExistsException)
You can use the msgCode element to determine the kind of error that occurred. ActiveMatrix BusinessWorks Error Codes lists all error codes that activities can return. You should use the error code instead of the error message text to detect and handle errors. The error code should remain constant from release to release, but the text of the message may change.