Cannot retrieve argument value from Catch block

Hello Everyone,

I have 2 workflows, Main flow and a Subflow that is invoked in Main flow, initially a boolean value is False in the Main flow. Then subflow is invoked and a exception is thrown and now the flow is in the Catch part of Subflow, here the boolean value is changed to true and a rethrow happens here, now the flow is in the Catch part of the Main flow, now i am printing that boolean value here, it is printing as False. As per the logic it should print True and thats the requirement but it is printing only False. Can anyone please help me on this?


Please check the Direction of that argument. What is it.?

Fine let’s do like this
—in MAIN xaml we are using TRY CATCH activity and place the sub xaml in TRY Block
—in MAin xaml create a variable named bool_input of type Boolean
—in sun xaml create a argument named in_out_boolinput of type Boolean and of direction IN/OUT
—now in Main xaml first use a assign activity
bool_input = False
—now use INVOKE WORKFLOW file activity and call the sub xaml and pass the above variable as input to IN/OUT argument in_out_boolinput

—then inside that sub xaml using TRY CATCH and if exception is thrown it goes to Catch Block where use the assign activity
in_out_boolinput = True and followed by this Throw activity is used so that now it goes to CATCH Block of Main xaml where use a writeline activity as bool_input.ToString
This will now hold the latest value of the argument and will print as True

Cheers @Raju23c

1 Like

Hi @Palaniyappan , Thank you for your response.

This is how i exactly did everything, then also it didnt work, that is why i posted the same in Forum.

1 Like

Hi @hacky , thanks for your response
In the Main it is “IN” and in the subflow it is “In/Out”, also i tried other combinations but nothing worked.

1 Like

Sequence.xaml (11.7 KB)
here is a sample workflow you can have a look!

Can I have a view in your xaml if possible
Cheers @Raju23c

Hi @Pradeep_Shiv
When i try to invoke from a diff workflow only i am facing this issue.

Here is the (4.2 KB)
Please have a look

1 Like

Hi @Palaniyappan
Could you please go through the flow and let me know if i have missed anything in it?

1 Like

I saw the code
It looks fine
Let’s try like this
Instead of IN/out argument let’s define a separate OUT argument that takes he value from CATCH block of inner workflow which can be obtained as a value in the CATCH block of main workflow

Cheers @Raju23c

1 Like

Hi @Palaniyappan Just tried that, didnt work, when i try to print the same in try block of the main flow , then the value is true, only in Catch block it is not coming.

Hi @Pablito @loginerror @Palaniyappan Can anyone help me on this please.

Hi @Raju23c

I think there is code magic behind it. I think it should work if you try to pass an array of value instead of a raw value.

Try it with an array of boolean instead. Basically, primitive types (string, boolean, integer) are not passed on exception…

I do recall @andrzej.kniola writing an explanation of it, but I can’t find it :no_mouth:

1 Like

Hi @loginerror Thank you for the response and Yes, it is working with array, i can use this as a workaround for now.

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.