Error Codes and Process Interfaces
When a process implements a process interface that has error codes, the error codes can be used to throw either WSDL fault messages from a message-based process, or errors thrown by a sub-process.
For example, consider the following process interface:
This process interface has a start event, an error code (WSDL error), and two parameters, Account and Balance.
When you create a process from this interface, it creates the following:
The default sequence flow from the gateway replies to the start event. The conditional sequence flow from the gateway throws an error with the code WSDL error.
The process with more tasks looks like this:
The process flow is as follows:
- The process is started upon receipt of a message that contains an account.
- The database task looks up the account in the database to verify if it is valid.
- If the account is valid, another database task gets the balance, and the balance and account number are sent as output.
If the account is not valid the error code is thrown.
The following example shows how the previous "get balance" example could be implemented as a sub-process (in this case, the process interface has normal start and end events rather than start message and end message events):
In this case, the sub-process throws an error, and in the calling process the error is dealt with:
The catch error event is configured to catch the error thrown from the sub-process: