cancel
Showing results for 
Search instead for 
Did you mean: 

Start Process Instance Conditionaly

bolashokry
Champ in-the-making
Champ in-the-making
Hi there,

I wonder if there is a way to start process instance based on evaluating some conditions in xml.
I don't want to evaluate these conditions in java code, but in xml … for example:

I want to call:
runtimeService.startProcessInstanceByMessage("startingMessage", myVariables);

And write some expressions in <i>mymodel.bpmn20.xml</i> evaluates some expressions based on the passed <i>myVariables</i> and decide if the process instance should start or not.

Is there something in Activiti does this, or any workarounds.

Regards,
Bola
2 REPLIES 2

martin_grofcik
Confirmed Champ
Confirmed Champ
Hi Bola.

You can start your process definition and in the first step make decision whether to continue in the process or not.
This decision can be based on e.g.:
- rule evaluation (http://www.activiti.org/userguide/#bpmnBusinessRuleTask - supports decision tables.)
- script evaluation (script task)
- service call…

Regards
Martin

bolashokry
Champ in-the-making
Champ in-the-making
Thanks Martin for your reply, I was thinking in that workaround too, but since I don't want the process to be initiated and put <i>On-hold</i> state, most probably I ll go to the solution to add my evaluation conditions in java code that will decide either to call <i>startProcessInstanceByXXX</i> or not.