Out arguments not carrying value upon exception

Hi,

I have tried this in latest version of UiPath as well as older version 2020.4, but it seems the bug still persists. When there is exception in child workflow, the out arguments (that are already populated previously in child workflow) gets erased when it exits and reaches parent activity. In other word, upon exception the out arguments don’t pass along. Why would the arguments erase that are already populated before exception?

The solution for this issue is time consuming, where we need to pass the arguments again with Throw activity. Sadly there is no global variable facility within UiPath (one reason I don’t like UiPath… so much unnecessary rework passing all the variables every time between workflows), other than using Assets. It’s hard to design reusable components.

Appreciate any solution for this issue.

Regards,
Harshil

@harshilmehta

If you are using RE-Framework, once the exception is triggered then it will directly go to transaction status

So out arguments will not get any value, If you want then you can give a message in exception message as below

new businessRuleException(“Message”)

Now in Transaction Status, you can access as

in_BusinessRuleException.Message to call the message and you can define your logic

Hope this helps you

Thanks

Thank you for your prompt response.

Yes, I am using REF. As per the requirement, upon Business or system exception in Process.xaml I need to send out email notification and in this email notification I need certain variables from Process.xaml to pass along. Since the out arguments are lost due to exception, I am left with blank required values.

I feel this is a bug in UiPath which they need to rectify. Why would only int, string, bool and few other types of argument get lost. Out arguments with DataTable, Dictionary, List, etc. type preserves the value. Why would certain type of argument preserve and other basic ones lose the value?

My current work around is to use new temp Dictionary that I pass along as In/Out argument. I maintain all my out argument variables in this temp dictionary. Regardless of exception, values are preserved now and I use it in other activity in Main.xaml.

I hope this help someone until UiPath decides to fix it.

Regards,
Harshil

5 Likes

Hi @harshilmehta

The reason why that happens is nicely explained here:

It is something that our team is aware of, and that is all I can say as of now.

Thanks! This explains. I hope UiPath finds solution for this issue in near future.

Maciej, Why is this still not addressed over a year later?
I have specific actions that must take place at end process if there is a system exception. The simplest thing to do is to pass a few arguments from Process (including a Boolean) to SetTransactionSatus to trigger those actions in End Process.
With this being an issue, I am not having to perform code gymnastics to write to a .csv file the values I want passed if an exception does not carry my arguments through.
How long until we see a fix?

I would also like a fix… I need to pass a value from my workflow if an exception occurs so I can write this back to excel.

Is there any plan to fix this issue?

JFletch,

Due to my need for an immediate solution, I did the following:

1- In Init > If first run, read local configuration file > Invoke InitAllSettings workflow, I have the automation create an Excel file for arguments to save. These values are the base values for arguments that reset where a system exception would clear them. I have this file name and location set as an asset in Orchestrator.

2- In Process Transaction, I copy that file in as a data table. Where I have designated a system exception to occur, I change the value of the “argument” I need to save. For me, I am using a boolean that will be needed in end process. Then I use Throw.

From this, where ever I need to take an action based on an argument that would normally clear, I have a file to read with the values that should have, but did not pass out.

Hope this helps.

Init
image

Process Transaction

1 Like

Thank you ill give that a try

1 Like

I’m having same the same issue where out-arguments from a workflow that has an exception, is not passing values. hoping it will be fixed someday

Yes UiPath i not developer friendly compared to Blue Prism for the very reason that you have mentioned below.

Sadly there is no global variable facility within UiPath (one reason I don’t like UiPath… so much unnecessary rework passing all the variables every time between workflows), other than using Assets. It’s hard to design reusable components.

There is, starting from 2022.10. Have a look: Studio - Managing Variables - https://docs.uipath.com/

I have to disagree on this. That’s the way components are made reusable (even between different projects).

Also hard disagree. Global variables are an awful way to solve re-usability, especially in OOP. Its super easy to create re-usable activities in UiPath, especially with libraries, you just need to be smart about it.

The datatypes datatable, list and array variables can pass values outside the flow even if an exception occurs, Can try these possible variable datatypes

1 Like