Force Exception in Process Flow

Situation:

I have a main process flow that is calling a few child process flows in sequence. In the main process flow, I added an Error Intermediate Event on each of the child flow calls to send some error notification and proceed to End Event. In 1 of the child process flows, I have a gateway that is checking for some conditions. Under a certain condition, I want to stop processing and end the child flow but I want to also force an error so that the parent process flow will go into the Error Intermediate Event and not call any of the subsequent child flows. How can I force an error to occur in the child process flow?

 

Solution:

1) Create a custom plugin with the code below

throw new Exception(“Any Custom Exception Message”);

2) In the child flow, place the custom plugin after the gateway condition (when you want to abort the flow)


3) Set the custom plugin Generate input and Generate output stream properties to false


4) Upon execution of this custom plugin, the flow will abort

5) This will set the "resultCtxVarName" property of the call activity to "Aborted"

6) Replace the Error Intermediate Event with a Gateway, that will end the parent process flow if the "ChildStatus" variable is equal to "Aborted"

Have more questions? Submit a request

0 Comments

Article is closed for comments.