Search code examples
jbossworkflowjbpm

JBPM- mapping reusable sub process node with the actual sub process


I've a template P(Process instance id: 0000) with two reusable sub process nodes, lets say R1(Unique id: 1) and R2(Unique id: 2) which will call the child Process, CP1(Process instance id: 1111) and CP2(Process instance id: 2222) respectively, I wanted to know is there any way to know that R1 triggered pid 1111 and R2 triggered pid 2222 in beforeNodeTriggered event of the parent process / beforeProcessStarted event of the child process.

I'm using jbpm 5.5.


Solution

  • It's not possible to get the link between reusable subprocess node and the child process in beforeNodeTriggered event of the reusable subprocess node since the child process will be triggered after this event. I'm able to get the pid of the child process in afterNodeTriggered event of the reusable subprocess node using the below code

    ((SubProcessNodeInstance)processNodeTriggeredEvent.getNodeInstance()).getProcessInstanceId()