In try block i am getting a text as a string which will be stored under argument in a workflow. Within the try block i am able to pass through but in finally block it returns empty. Is there any alternative way for this? Try is my process, catch is business or system exception amd finally is to send emails for those sucess or exceptions.
I am not facing any problem, I initalized a value to the out arguement in the Try block and used throw activity to throw exception to catch, then it went to final block.
I have checked the argument value in the final block it was showing the values in the argument.
In your flow, before initializing data to the argument the exception occured and it was directly going to catch block that’s why the argument was showing empty.
Hi @mkankatala im my catch exception i hVe to to indicate business or system by assigning variable. In that case how do i bring the argument to final block?
Got it you want to store the Exception catched in the Catch block and you want to bring it to Final block right.
Create two catches in the catch block,
→ First one is Business Exception catch and create a variable called BusinessException_Var and the datatype is UiPath.Core.BusinessRuleException. Inside this catch take an assign activity and inititalize the exception to the variable as below,
- Assign -> BusinessException_Var = exception
→ Create seond catch in catch block,
→ Second one is System Exception catch and create a variable called SystemException_Var and the datatype is System.Exception. Inside this catch take an assign activity and initialize the exception to the variable as eblow,
- Assign -> SystemException_Var = exception
→ In Finally block insert an If condition to check the condition,
- condition -> BusinessException_Var isnot nothing
- Place mail activity to send Business Exception
- Condition -> SystemException_Var isnot nothing
- Place mail activity to send System Exception
Check the below workflow for better understanding, Sequence3.xaml (14.3 KB)
In try block i am getting a text as a string which will be stored under argument in a workflow. Within the try block i am able to pass through but in finally block it returns empty @mkankatala
Hi @ashokkarale so for my case will be in try block i pull argument as in/out from a inner workflow and then bring it over to finally block. Am i correct?
Are you invoking the child xaml to the Parent xaml. If any exception got in child xaml then you want to get the out argument value from the Child xaml to Parent xaml.
I have made a workflow for you follow the same steps. In the Child xaml don’t use the Rethrow activity in cache block, Instead of using rethrow use the Assign activities.
Check the below workflow for better understanding, Forum Usecase.zip (4.7 KB)