Throw out Argument along with Business Rule Exception

Hi,

I would like to pass an out argument along with a business rule exception back to the main.xaml from a Try/Catch in a separate workflow.
I understand I’m to use something along the lines of exception.data(“variablename”)=value but I’m not sure exactly how to do this.
Could somebody explain how to do this please?

Thanks

Let us say you have an exception “Order not found” and you can add this to a variable for example,
str_ExceptionReason = “Order not found” and you can throw the exception with New BusinessRuleException(“This exception is in particular fille.xaml”+str_ExceptionReason)

Thanks for your help, unfortunately this isn’t exactly what I’m looking for.
I’m looking to use the out argument in the main.xaml for further processing so i don’t want this to be tied in with the exception message.

So i will have the exception message, and the out argument assigned back to a variable in the main.xaml.

I’m not sure that there is a way to directly funnel out a variable when an exception occurs. Instead, you will have to handle what will happen in the event of an error by use of Try Catch. In cases like these (for example, wanting to output a datatable in the middle of a For Each that failed), I will catch the exception in my Try Catch, write the DataTable out to my out_dtVariable, and use ‘Break’. This way, it will cleanly leave the workflow and allow for the standard arguments to make their way out, along with your error message. Alternatively, I believe the Terminate Workflow activity works this way.