How to exit without executing the next workflow when exception occurs?

Hi, all,

I made the following three xaml

Main.xaml:Invoke the Seq1.xaml, Seq2.xaml.
Seq1.xaml:throw an Exception “Test”.
Seq2.xaml: Displays the message “OK”(Message box activity).

When Main.xaml is executed, Seq1’s exception is caught and the message is displayed.
This is the expected behavior. However, after that Seq2.xaml will be invoked.
I tried use Terminate Workflow activities, change the scope of Try catch activities,
I checked Misc Private, but the situation does not change.

How do I display Seq1.xaml error in MessageBox, then exit without running Seq2.xaml?
I do not want to display Workflow Exception as below.ExceptionTest .zip (4.2 KB)

image
Thanks in advance.

Hi,

  1. Put Seq1.Xaml in try catch block and in the catch block put the message box.
    below message box use assign activity and set the argument ex arg=1.

  2. In the main.xaml use the if condition (decision block) arg=1(create local variable and pass the argument arg ) if true then do nothing else connect seq2.xaml invoke workflow activity.

You can also put both workflows in the Try block; execution leaves this block immediately upon encountering an exception:

2 Likes