REFramework - code sets a business exception in response to an input data error

I have coded for an input data errot event. On the event occurring I added a Throw activity with the property of New BusinessRuleException(“user defined message”). My problem is that I want this business exception to be picked up in the Process state when the process.xaml completes, so that when the logic invokes the SetTransactionStatus workflow it sees that there is a business exception and routes the logic down the Fail path rather than the Success path. I am unable to work out how you set the Business Exception as not Nothing, so that the logic finds the Fail path. When the process.xaml completes it is treated as a successful transaction. I don’t have this problem with system exceptions, because they appear to be picked up automatically if a UI element isn’t found or whatever. But a business exception requires the application code to recognise there is a problem and do something to set the status to Business Exception. I have been unable to get this recognised by the REFramework Process state.

@ChrisC1 You can use this Expression as the Value for Exception Property in a Throw Activity:
new BusinessRuleException(“Your Error Description”)

Whenever a BusinessRule Exception has Occurred you could use a Throw with a Value mentioned Above, inside the Process Transaction Workflow, In this way the Catch Block which has BusinessRule Captured will Catch these Business Exceptions and then you can handle the flow the way you need it.

1 Like

@ZeroIndex provided the solution which is to add a ReThrow activity in the Catch to pass the Business Exception up to the calling workflows which then allows it to be routed through the BusinessException path of the SetTransactionStatus workflow.

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