]
Thomas Diesler updated JBPM-1032:
---------------------------------
Fix Version/s: (was: jBPM jPDL 3.2.4)
task-assign-events are sometimes fired when group assignment is
performed
-------------------------------------------------------------------------
Key: JBPM-1032
URL:
http://jira.jboss.com/jira/browse/JBPM-1032
Project: JBoss jBPM
Issue Type: Bug
Components: Core Engine
Affects Versions: jBPM jPDL 3.2.1
Reporter: Karsten Dello
Assigned To: Tom Baeyens
A "task-assingn"-event is sometimes fired, if only group assignment (setting
pooledActors) is performed. This always happens when a swimlane is in use which specifies
pooled-actors (junit test 1).
On the other hand, when the pooled-actors are expressed via an assignment-element as an
child element of a task (junit test 2), the event is not fired.
From my point of view the engine should either:
a) not fire an task-assign-event in case of group assignments at all
b) fire it consequently at all group assignments events
c) fire a different event
Ronald suggested in the forum thread (link above) to introduce a seperate event
"task-group-assign" in case a task gets assigned to a group. In my opinion this
would be the best solution to this problem.
public void testTaskAssignIsFiredWithSwimlaneGroupAssignment() {
ProcessDefinition processDefinition = ProcessDefinition.parseXmlString(
"<process-definition name=\"someprocessxyz\">" +
" <event type=\"task-assign\">" +
" <script>System.out.println(\"task-assign-event
fired!\");" +
" executionContext.setVariable(\"task-assign-event-has-fired\",Boolean.TRUE);</script>"+
" </event>"+
" <start-state>" +
" <transition to='a' />" +
" </start-state>" +
" <swimlane name='swimlane22'>"+
" <assignment pooled-actors='jan,nina'/>"+
" </swimlane>"+
" <task-node name='a'>" +
" <task name='sometask' swimlane='swimlane22'/>"
+
" <transition to='end'/>"+
" </task-node>"+
" <end-state name='end' />" +
"</process-definition>"
);
ProcessInstance processInstance = new ProcessInstance(processDefinition);
Token token = processInstance.getRootToken();
processInstance.signal();
Object
o=processInstance.getContextInstance().getVariable("task-assign-event-has-fired");
assertEquals(Boolean.TRUE, o);
}
public void testTaskAssignIsNOTFiredWithSwimlaneGroupAssignment() {
ProcessDefinition processDefinition = ProcessDefinition.parseXmlString(
"<process-definition name=\"someprocessxyz\">" +
" <event type=\"task-assign\">" +
" <script>System.out.println(\"task-assign-event
fired!\")"+
" executionContext.setVariable(\"task-assign-event-has-fired\",Boolean.TRUE);</script>"+
" </event>"+
" <start-state>" +
" <transition to='a' />" +
" </start-state>" +
" <task-node name='a'>" +
" <task name='sometask'>" +
" <assignment pooled-actors='jan,nina'/>"+
" </task>"+
" <transition to='end'/>"+
" </task-node>"+
" <end-state name='end' />" +
"</process-definition>"
);
ProcessInstance processInstance = new ProcessInstance(processDefinition);
Token token = processInstance.getRootToken();
processInstance.signal();
Object
o=processInstance.getContextInstance().getVariable("task-assign-event-has-fired");
assertEquals(Boolean.TRUE, o);
}
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: