StatefulKnowledgeSession signalEvent method
instanceof Sep 18, 2011 3:11 PMHi,
Can anyone help me to understand why the signalEvent method on the StatefulKnowledgeSession calls the ProcessInstancesWaitingForEvent query even when I provide the processInstanceId parameter?
The ProcessInstancesWaitingForEvent seems to retrieve all workflow instances that are awaititing a particular event.
I am seeing this behaviour in the context of this workflow:
When I start the workflow with process variables that make it take the lower path the workflow begins and waits for the first signal.
| ProcessInstance process = session.startProcess("data-v0.0.2", processVariables); |
At this point I am able to signal the first event and the ProcessInstancesWaitingForEvent is NOT called. The workflow quickly moves and waits for the second signal.
| session.signalEvent("Signal1", null, process.getId()); |
At this point I can signal the second event which does succeed but this time it appeas to be calling the ProcessInstancesWaitingForEvent query to find all workflows waiting for the signal2 event..
| session.signalEvent("Signal2", null, process.getId()); |
The time that this takes is directly proportional to the number of workflow instances that I have waiting for the signal2 event.
Can anyone help me to understand why ProcessInstancesWaitingForEvent is being called? It seems like this is unnecessary given that I am providing the processInsnanceId. Also I'm not sure why this happens when I signal event 2, but not when I signal event 1.
The jbpm versions I have used are the ones bundled in the jbpm 5.10-Final installer download.
Thanks very much,
Geoff
-
DataWoflowV2.java.zip 1.3 KB
-
data-v0.0.2.bpmn2.zip 1.1 KB
-
data-v.0.0.2.jpg 13.9 KB
