Conditional Transition

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-06-2012 04:36 AM
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.
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.
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.
Labels:
- Labels:
-
Archive
4 REPLIES 4
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-06-2012 11:18 AM
If it is stored as a string, you probably will need to use ", eg #{requiresValidation eq "true"} or #{requiresValidation == "true"}

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-10-2012 04:19 AM
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:

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-10-2012 05:19 AM
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…
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-11-2012 02:02 AM
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.
