Arguments values not passing

Hello Community

Today I come confused but actually also enthusiastic because I think I came up with something that I didn´t really knew about and which I found tricky.

Let me get you into context. I´m working on a automation based on the ReFramework. And as every automation, there is custom ways apart from the default mechanism to handle exceptions.

Inside of my “Process workflow” I have of course the workflow which essentially gets the main job done. And if a business exception occurs in that workflow (Extracción Datos Publicación)

then those errors are catch and a little sequence runs which goal is to assign some specific values to some out arguments which are used to save the info and be able to send emails based on the errors with the information saved in the arguments.

the thing here is that all these is happening inside of the “process workflow” of course… and the email is not send till the “set transaction status workflow” runs. So when I debug the workflow and the execution reaches the “Set Transaction Status Workflow” I see that the values I thought I saved in the second image are not passed out of the “process workflow” as you can see in this image.

So I think that the thing I´m not aware of is that the arguments values of a workflow are not passed if the workflow results in error?

I guess that´s all my inquiry. I know this might look like a simple topic but it can really get tricky.

Thank you for you attention.

@Luis_Fernando

Yes thats true…arguments are not passed when there is an error…

Two ways

  1. If on windows compatibility then create a global variable and assign values to them instead
  2. You have an option to add the data to different items in exception variable as well…there is an option to add dictionary of items to your exception variable…and then rethrow it
  3. Instead of using string and basic types use array or datatable and initialize it outside the process only and use them as in/out argument and that should work check below for clear explanation

Cheers

Option number 2 seems very interesting, where can I get more info about it?

@Luis_Fernando

This is how you can add data to dictionary in exception variable directly and then rethrow

image

Exception.Data("Name") = "value"

cheers

Yet still I figure out that for my case I could instead of putting the try catch inside of the process workflow I could instead use the same try catch but for the whole process workflow. In that way value will be store so it can be passed to the set transaction Status.

Amazing!! I value so much your attention dear friend, thank you

@Luis_Fernando

1 and 3 will work without try catch inside the process.xaml

2 works only with try catch inside process.xaml

Cheers

But without try catch how does the processes catches and assign values if an error occurs?

@Luis_Fernando

Option 1 and 3 will pass values which are already assigned

Only 2 you have to attach to data dictionary

If only specifically in case of error you want to pas then you need try catch for sure in any case

Cheers

1 Like

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