cancel
Showing results for 
Search instead for 
Did you mean: 

Conditional Transition

dognose
Champ in-the-making
Champ in-the-making
Hello,

I want certain tasks to become active, if certain Attributes are set.
i.e. if a user ticks the checkbox "requiresValidation" a validationTask should be started, after the prior task is completed.


[task1] ——————-> [task2]
    |——->[validation]——-^

In the designer, I added the following conditions to the both outgoing paths of task1:
direct path: #{!requiresValidation}
validation path: #{requiresValidation}

But this doesn't work. I assume the problem ist, that activiti is storing the value of a checkbox as a string.
I also tried #{requiresValidation eq true}

no matter what i put in there, it will ALWAYS be "true" and both tasks are started at the same time.

doing the same with a (manually) declared process variable of type boolean works.
4 REPLIES 4

jbarrez
Star Contributor
Star Contributor
If it is stored as a string, you probably will need to use ", eg #{requiresValidation eq "true"} or #{requiresValidation == "true"}

dognose
Champ in-the-making
Champ in-the-making
If it is stored as a string, you probably will need to use ", eg #{requiresValidation eq "true"} or #{requiresValidation == "true"}

that was my thought, too. but something seems to be wrong.
Even if i put a false or #{false} in there, the transitions are executed  :?:

Edit: okay that was my fault.

#{requiresValidation eq "true"} is the way to go.

My Problem was, that i used a (not shown) parallel-gateway, and according to the docu, Conditional Transitions on a Gateway are ignored.
Well, once Problem Solved - like 50 new Ones: How to handle all my conditional Transitions without connecting em to gateways ?  :shock:
Applying a (Dummy-)Service task to each gateway with an conditional outcome?  :?  :shock:  Smiley Surprised

ronald_van_kuij
Champ on-the-rise
Champ on-the-rise
My Problem was, that i used a (not shown) parallel-gateway, and according to the docu, Conditional Transitions on a Gateway are ignored.

Conditions on a parallel gateway are ignored. Use an exclusive gateway…

jbarrez
Star Contributor
Star Contributor
Indeed. Or just let the sequence flow leave the step directly, without gateway. The default semantics of BPMN 2.0 is to take all outgoing sequence flow which have a 'true' condition.