I have modelled the leave approval process diagram. I’m doing the POC of camunda Process Instance Modification. While doing I have observed that in camunda cockpit running activity instance count is not shown.
Leave Process Master BPMN:
Below is the call activity BPMN for “L1 Approval”. Consider I have an instance in “L1 Approval->Accept Leave Request”.
Using process instance modification logics, I want to move token into “L2 Approval->Reject Leave Request” below is the “L2 Approval” call activity BPMN:
L2 Approval BPMN Diagram:
//To modify parent process instance runtimeService.createProcessInstanceModification(processInstanceId) .cancelAllForActivity(runtimeService.getActiveActivityIds(processInstanceId).get(0)) .startBeforeActivity(activityName).execute(); //To modify the subprocess process instance ProcessInstance subprocess = runtimeService.createProcessInstanceQuery() .superProcessInstanceId(processInstanceId).singleResult(); runtimeService.createProcessInstanceModification(subprocess.getId()) .cancelAllForActivity( runtimeService.getActiveActivityIds(subprocess.getId()).get(0)) .startBeforeActivity(instructions.get("taskDefId").toString()).execute();
After executing my logic,
“step 1” I couldn’t see total no.of running activity instance count here. But if I clicked on the process instance id, I could see the running activity instance count as 1. please refer this screenshot
- Is this feature by design? or product defect? or something I didn’t do right?
- May I know how to cancel the event subscription which attached User Task(L2–> Review Leave request)