REF Passing argument and exception handling

Hi, I want to dig deeper in exception handling in REF. I want to take screenshot when a throw occurs in Process workflow. When the throw comes it continues to “SetTransactionStatus” workflow and there I want to pass an argument from main to that workflow with lets say a filepath as value.

When the process enters the “SetTransactionStatus” workflow the argument value is null. I assume that it has something to do with the throw before?

However when I tested with hardcoded values the process worked as expected. Now I get the error because the argument is empty.

Note: I want to set the value of the argument in Orchestrator later on as I usually do.

Thanks for any advice!

P.S.: I checked multiple times that arguments are imported correctly.

Sorry, I found the issue myself. Since the Try Catch for Set Transaction Status has 3 catches I forgot the update arguments in one invoke workflow activity. Works now.

1 Like

Hi, @SenorChang

  1. In Main.xaml PROCESS TRANSACTION state:

Try Catch → Invoke Process.xaml
Catch Block:

  • Take Screenshot → io_screenshotPath = full filepath
  • Rethrow (keeps exception flow)
  1. Create In Argument in SetTransactionStatus.xaml:

in_ScreenshotPath (String)

  1. In Main.xaml → Invoke SetTransactionStatus:

Arguments → in_ScreenshotPath = io_screenshotPath

Screenshot path set in Main.xaml (parent) before calling SetTransactionStatus, so exception can’t break it.

Thanks. I solved my original issue. But I have a new problem. The way I implemented the screenshot capturing in set transaction status it is always too late (the application has already closed when I take the screenshot). Any idea how to solve it?

@SenorChang

As per the standard framework, application cleanup happens after the set transaction status.

If you have customized this then, I would suggest to take the screenshot in the Process state catch section and store the screenshot file in a global variable which will be accessible from everywhere you want to use.

I did not customize the set transaction status. I only invoked the takeScreenshot workflow in the system exception lane. So technically it is not after the set transaction status but IN the set transaction status. I believe I just used the TakeScreenshot workflow which came out of the box and put my stuff in there.

I solved it. In Process I use Use Browser Activity and in Options I had to set ‘never’ for close option. Then the window stays open. :+1:

1 Like

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