I searched so many threads which dealt with handling exceptions in workflow, but all threads ended up with providing SAP documentation help links and some other site links. I would like to share one of my experiences on exception handling in workflows. This information is developed keeping in mind, the starters of workflow development.
Initially in the Version dependent basic data of the workflow, two exceptions were defined in the LOCAL EVENTS tab as shown in the below screen shot.
Developed a workflow which start's with a Fork having two branches, In one of the branches, created a block inside a block and activated one exception in each block as shown in the below screen shots.
Inside the inner block, validated the value of a workflow container element whether it is zero or not by using Condition step. If the value of the element is zero then, raised "Counter_Zero_Exception" by using a Process Control step. If the value of the element is not equal to zero then, raised "Not_Zero_Exception" by using another Process Control step as shown in the below screen shot. Exception Handlers & Raising Exception's
In the Not_Zero_Exception branch, a mail will be sent to the WF initiator with the value that is in the element. (Inner_Exception_Block)
In the Counter_Zero_Exception" branch, a local container element of the block which is set with a initial value, is assigned to workflow container element by using a Container operation step. Then a mail will be sent with the value that is assigned to the workflow container element here the local container element of the block is set with the initial value 1500. The mail will be triggered to the WF initiator with 1500. (Outer_Exception_Block)
When the counter value is equal to zero then, Counter_Zero_Exception is raised and a mail is sent to the WF Initiator. The graphical log is,
When the counter values is not equal to zero then, Not_Zero_Exception is raised and a mail is sent to the WF initiator. The graphical log is,
And finally the work items that are not processed during the exception handling they are set to status "logically deleted". As shown in the belwo screen shot the decision step is logically deleted even it is assigned to WF initiator.