Exception handling is defined by the management of in . It ensures that problems can be automatically resolved if possible, or easily identifiable and repairable by system administrators or passed for human completion where appropriate. The success of exception handling depends on how well it is implemented during development.
Achieving Exception handling in Blue Prism
Exception handling is a critical part of any blue prism solution. An exception is a problem that arises during the execution of a process/object.
When errors are encountered in blue prism, it generates exceptions.
Exception Handling Stages
Exception handling can be achieved by using resume, recover and exception stage.
Recovery − Begins a block for handling exceptions.
Resume − Ends a block for handling exceptions.
Exception − Explicitly raises an exception in the execution of process or object.
Types of Exceptions
We have 3 types of exceptions in Blue Prism −
-
Internal Exceptions
-
System Exceptions
-
Business Exceptions
Internal Exceptions
Internal Exceptions come based on our missing mandatory data in stages.
Suppose, we want to save the data for newly created excel. However, we missed to provide path, then we get the internal exceptions.
Another example is when we give invalid expression in calculation stage, we get internal exceptions as shown below −
-
Create 3 data items i.e X, Y and Z with text type.
-
Use calculation stage to perform the simple calculation
-
Now, run the process.
Business Exceptions
These exceptions are not actually exceptions, however, based on the business rules, we are creating the exceptions. We need to fire manually through bot.
Let us suppose, we working on excel data having the employee name and his account balance. Reading these data into collections and checking the balance of each employee. If the balance of any employee is zero, we need to fire exception and log the message. As per business rules, if the balance is zero, the payments cannot be done.
Step 1 − First, we will read the data and store the collection.
Step 2 − We need to loop collections and check if the column has zero. If yes, then throw an exception.
Step 3 − We need to configure the Exception stage. As we have so many exceptions types, we need to configure this as Business Exception.
System Exceptions
System Exceptions will occur based on internet is down or our bot need internet or any system failures.
We need to handle these Exceptions using the Recovery and Resume stages. We don”t need to link to recovery stage, whenever and whereever exceptions fires, immediately the recovery stage catches those exceptions.
Exception Bubbling
When the Exception is fired, it moves upwards towards the flow until it gets caught by recovery is called Exception blubbing.