Can someone provide me with resources to learn how to create and use business exceptions or explain to me how I can do this. In my current automation, I want my bot mark the work item as an exception when there are business exceptions by following my exception work flow path and not end process or proceed with the happy path flow.
@chenderson i dont understand how to use the try catch activity.
i currently have a for-each loop that is looping through all the dates in a collection (dynamic list). In the body of the for-loop i have an if/else activity. the if/else checks each dateâs status and compares it to the current status. if it doesnt match, it should be marked as an exception and if it does match, then it will proceed to the next date and check. How would i put this into the try-catch? when it is exception out, i would like it to follow an exception workflow i have created. I dont want it to terminate the process completely like when using the âterminate workflowâ activity. It should not continue to loop as soon as one of the dateâs current status doesnt match the current status, and then proceed to follow the exception workflow.
Would i put the âThenâ sequence in the the Try section, and put a Break activity in the Catch section, and the Exception workflow in the Finally section? What about the âElse sequenceâ? does that need to go into the try catch?
When i tried the above approach, the break doesnt seem to do anything. It shows the message i put âmark as exceptionâ (in my catch block), but then it continues to the next date, even though it shouldnt.
My apologies Happygal, I misunderstood how you wanted to tackle the exception path.
In this case, youâre handling it perfectly by invoking the Exception workflow if the else portion of the If activity. The Break activity should also be in the else portion to prevent the For Each activity from processing anymore items in the loop.
If the workflow isnât behaving the way you would expect, feel free to post the xaml file and Iâll hop in and take a look (just donât forget to remove any proprietary information if applicable)
I made a simple xaml file, and when I tired the try-catch and break it works. However, when I place the same logic into my actual workflow, it still continues the loop.
I also tried to put in 2 break activities. When I tried this, it stopped the loop, but the bot was paused on the 2nd break. Is it possible to put a âterminateâ activity after the exception workflow has finished? If I did this, would the bot still be able to pick up the next work item in the queue and start the entire process again, or would this âterminateâ activity affect the bot from grabbing the next item to work on?
I should also mention that the for-each loop is also inside a while-loop. Does that affect the position of where i put the break? If it does, where should the break be placed?