Is it possible to assign conditional tasks with Fork node in JBPM.
As per my requirement, workflow should allow optional Parallel tasks and a mandatory
sequential task.
But I'm getting some issues while conditionally assign tasks with fork.
Process definition:
| <?xml version="1.0" encoding="UTF-8"?>
| <process name="conditional_task" version="1"
xmlns="http://jbpm.org/4.0/jpdl">
| <start g="27,32,80,40">
| <transition to="Validate Approval Seqence"/>
| </start>
| <!-- Checks which sequence to initiate ie., Either Parallel or Sequential -->
| <decision expr="#{isOptionalTasksExists}" name="Validate Approval
Seqence" g="257,31,80,40">
| <transition name="true" to="Assign Parallel Tasks"
g="-24,2"/>
| <transition name="false" to="Sequential Task"
g="564,54:-75,-21"/>
| </decision>
| <!-- Parallel Task Assignment -->
| <fork name="Assign Parallel Tasks" g="258,139,80,40">
| <transition to="validateFirstParallelTask"/>
| <transition to="validateSecondParallelTask"/>
| </fork>
| <!-- Conditional Task Assignment -->
| <decision name="validateFirstParallelTask"
g="135,221,80,40">
| <transition to="First Parallel Task">
| <condition expr="#{firstParallelApprover != null}"/>
| </transition>
| </decision>
| <task assignee="#{firstParallelApprover}" name="First Parallel
Task" g="71,325,169,40">
| <transition name="Approve" to="wait for other tasks"
g="-45,-18"/>
| </task>
| <decision name="validateSecondParallelTask"
g="384,221,80,40">
| <transition to="Second Parallel Task">
| <condition expr="#{secondParallelApprover != null}"/>
| </transition>
| </decision>
| <task assignee="#{secondParallelApprover}" name="Second Parallel
Task" g="308,324,204,40">
| <transition name="Approve" to="wait for other tasks"
g="-45,-18"/>
| </task>
| <join name="wait for other tasks" g="270,436,80,40">
| <transition to="Sequential Task"/>
| </join>
| <!-- Sequential Task -->
| <task assignee="#{sequentialApprover}" name="Sequential Task"
g="494,437,147,40">
| <transition name="Approve" to="Finish"
g="-45,-18"/>
| </task>
| <end name="Finish" state="Completed"
g="778,431,80,40"/>
| </process>
This definition forces me to supply either (2 Parallel and 1 Sequential) or (0 Parallel
and 1 Sequential) approvers, but not 1 Parallel and 1 Sequential.
Thanks in Advance
View the original post :
http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4262014#...
Reply to the post :
http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&a...