We are encountering an intermittent issue in our BPMN workflow using jBPM 5.4.0.Final, where the next node is not always being created after a task is completed.
Here are the key observations:
The task is completed successfully, but the next node is sometimes not triggered.
The issue occurs sporadically, working correctly most of the time, but failing under certain conditions.
The problem is specific to this user task within the BPMN process.
No errors or exceptions are raised when completing the task.
The issue arises more frequently when the workflow involves rapidly creating and completing tasks within the same process instance.
We suspect the problem lies in the following method, where the flow does not enter the if block. This may be because the workItemId is holding the previous workItem ID of the processInstance, causing the if block to be skipped, and prevent the next node from being created:
Code:
org.jbpm.workflow.instance.node.WorkItemNodeInstance
public void workItemCompleted(WorkItem workItem) {
if ( workItemId == workItem.getId()
|| ( workItemId == -1 && getWorkItem().getId() == workItem.getId()) ) {
removeEventListeners();
triggerCompleted(workItem);
}
}
2