Business Exceptions

Business exceptions are expected conditions that prevent a process instance from advancing in the process. Unlike System exceptions, business exceptions are triggered by your business process rules. They denote that some condition in the business logic has not been met. Failure to pass a credit score check, for example, could be handled as a business exception.

Business exceptions allow you to create cleaner processes and allow you to define exceptional situations separately from the happy path of the process.

Business Exceptions must be defined as BPM Objects within the Catalog. They behave like other BPM Objects and can contain methods, attributes, and presentations. They can be used anywhere within a process.

Transactions

Business exceptions are expected business situations. Unlike System exceptions, Business exceptions do not cause the running transaction to fail.

If your code throws a Business exception during the execution of a process Activity (and it is not handled within PBL code) it causes the execution of the Activity to exit but the transaction is finished successfully. The Process Execution Engine commits the transaction and any changes made to process instance variables are persisted as usual.

No Retries

If the execution of a process activity finishes due to a Business exception, the Process Execution Engine does not retry the execution of the activity because the execution did not fail.

In general, business exceptions are not resolved by retrying. For example, you may raise a business exception if the credit score for a credit card application is low. Trying the credit check again does not make the score higher.

Interactive Activities

If a Business exception is raised during the execution of an interactive activity, the interaction window is closed and the work item is no longer on the user work list. The process instance is moved to the exception handling flow.

Throwing a Business Exception

Within PBL code, you can raise a Business Exception using the throw keyword as in the following example:
if creditScore > 700 then
   lowScoreEx as LowScoreException = LowScoreException()
   lowScoreEx.value  = creditScore
   throw lowScoreEx
end
          
Related tasks
Creating a Business Exception