Argument not passing value outside xaml

I have created 1 argument with out direction and assigning the value to that argument in Exception block of the code so that if any exception occurs that argument will be assigned with some value and can be used after rethrowing of the exception to outside

But somehow that value is empty in outer xaml.

Can anyone help me with this?

Hi,

Can you share your workflow?

Regards,

Hi @Shreya_Rao1 , please look at this thread, where something similar was discussed:

It seems that you’re filling the variable in the “Catch” part, and therefore it should get filled, but nonetheless, changing that variable to some structured type like dictionary, or DT, might be worth a try.

Best Regards,

Check if you don’t have any other variable in another scope with the same name, also check whether is the same type of data

If it’s possible share your workflow please

Regards

please attach xaml

Sharing Test Workflow. I am doing s
Test_Re.zip (985.2 KB)
ame thing in My project workflow

Hi Shriya,

you can do same in alternate way
create exception argument in Process.xaml

you can throw same in main.xaml

check attached solution.
Test_Re.zip (985.5 KB)

Hi,

There are 2 points to take care, I think.
First, if some exception is thrown (or re-thrown) in callee xaml, Out type argument is not assigned as a result, even if some value is assigned in callee xaml before then.

Second, if some exception is thrown in callee xaml, it’s immediately caught by try-catch activity in caller xaml when it exits from callee xaml. So in this case, WriteLine activity just after InvokeWorkFlowFile activity won’t run.

So, I think it might be better to use Exception.Data as the following. It can add any message to exception instance, and get it in caller xaml etc.

img20220320-3

Test_ReV2.zip (985.2 KB)

Regards,

@Shreya_Rao1 According to your statement, when an exception occurs the argument was assigning with a value, correct but since you are re-throwing that exception it was returning an empty value

The argument returns the updated value or assigned value only when the workflow successfully processed. Otherwise, it returns a empty or last run value

In this case, instead of assigning value to the argument , after re-throw you can use exception.Message which gives the exception reason