Kill process

studio

#1

Hello,

I am now dealing with terminating of flowchart or sequence.

When a condition is met I want to terminate the workflow which is e.g. two levels above my current level. Is there an activity to do that?


#2
  • throw an exception which will be caught in the top level workflow
  • try terminate workflow activity (never used it)

#3

The flowchart is so complicated that it is not possible to use try catch :frowning:


#4

The problem is that I have inside of three flowcharts 4 sequences. And if a condition is met in the third sequence I want to continue with second flowchart, not in sequnce above.


#5

Is it a spaghetti workflow? :slight_smile: You should separate the logic (invoke) in different workflows and use try catch in the master one.


#6

But there is no exception…Exception will never appear. It is just my condition in If activity


#7

Can you use a “Should Stop” Activity?

Should Stop:skull:


#8

But this activity is connected to Orchestrator isnt it? I have no experience with that.


#9

You can create custom exception and throw in your IF condition.


#10

Can you please send me an example? :blush:


#11

Please find below, It will throw custom exception, you can put in your if condition and you can catch it in try catch activity in parent flow.

CustomException.xaml (7.0 KB)


#12

Do you why I can read it?


#13

Please enable “Workflow Manager Activities” package.


#14

Thanks. Unfortunately I still dont understand how this can help me to stop current flowchart or sequence and dont not continue flowchart or sequence one level higher but lets say three levels higher.


#15

See, In case of exception however you flow will discontinue. You just need to wrap your top level flow chart in try catch so it will not throw exception and catch exception inside “catch” block so you can complete your flow without any error.

Other way, You can also pass argument to parent workflow and based on that you can take decision in your parent flowchart.


#16

I would still prefer some more elegant solution as this is not possible. In my top flow chart can be several exceptions and for each of them the flow chart should continue differently.