cancel
Showing results for 
Search instead for 
Did you mean: 

Skip the next activity in the Workflow

chandanmb1
Champ on-the-rise
Champ on-the-rise

Hi,

I have a workflow process like

Start -> ServiceTask1 -> ServiceTask2 -> ServiceTask3 -> End

While Execution of ServiceTask1 based on some condition i need to Skip ServiceTask2 and jump to Service Task3.
In normal case it has to execute as is.

How to achieve the above scenario ? Is there any API to skip next step in the process.
8 REPLIES 8

hari
Star Contributor
Star Contributor
Hi,

You need to connect ServiceTask1 to both ServiceTask2 and ServiceTask3 and have the conditions on the flows. So depending on which one evaluates to true, the respective flow will be followed in executing the process.
Example Conditions: ${approve==false} for one flow and ${approve==true}

chandanmb1
Champ on-the-rise
Champ on-the-rise
Hello,

We dont have a control to change the workflow.
We need some mechanism to handle it in Java code at runtime. Is it possible to achieve without changing the workflow by Java code @runtime ?

martin_grofcik
Confirmed Champ
Confirmed Champ
Hi,

Hook to the process parsing (http://activiti.org/userguide/index.html#_hooking_into_process_parsing) and you can change any behaviour.

Regards
Martin

Is there any sample code which explains bit more clear about process parsing?
It will be much helpful to see the code and then implement.

martin_grofcik
Confirmed Champ
Confirmed Champ
Hi,

org.activiti.standalone.parsing.TestBPMNParseHandler
Regards
Martin

jbarrez
Star Contributor
Star Contributor
There is also a 'skipExpression' construct (which isn't documented yet) that can be used to set an expression that determines whether a step in the process needs to be skipped or not.

This looks interesting for me "SkipExpression"
but how to use it ?  Please provide some sample Junit code ?

martin_grofcik
Confirmed Champ
Confirmed Champ
Hi,

e.g.
org/activiti/engine/test/bpmn/gateway/ExclusiveGatewayTest.testSkipExpression.bpmn20.xml

Regards
Martin