[jboss-user] [jBPM] - Re: Can parent and child process use the same processInstanceId?

saig0 do-not-reply at jboss.com
Fri Jan 13 09:51:46 EST 2012


saig0 [https://community.jboss.org/people/saig0] created the discussion

"Re: Can parent and child process use the same processInstanceId?"

To view the discussion, visit: https://community.jboss.org/message/646708#646708

--------------------------------------------------------------
Why you need the process instance id of child / parent? That is your use case?

In my project I need the relation between child and parent process instance for process monitoring. There is no api to get this information but I could create a process event listener for my case. After the re-usable sub process node is triggered  the process instance id of sub-process store in the sub-process node. The listener read this information and store it for application.


@Override
    public void afterNodeTriggered(ProcessNodeTriggeredEvent event)
    { 
        if (event.getNodeInstance() instanceof SubProcessNodeInstance)
        {
            long processInstanceId = event.getProcessInstance().getId();
 
            SubProcessNodeInstance subProcessNodeInstance = (SubProcessNodeInstance) event.getNodeInstance();
            long subProcessInstanceId = subProcessNodeInstance.getProcessInstanceId();
 
            SubProcessNode subProcessNode = (SubProcessNode) event.getNodeInstance().getNode();
            String subProcessId = subProcessNode.getProcessId();
            String subProcessVersion = processInstanceManager.getProcessInstance(subProcessInstanceId)
                    .getProcess().getVersion();
            String nodeName = subProcessNode.getName();
            
            // store information
        }
    }


It works but it would be much better with api access.
--------------------------------------------------------------

Reply to this message by going to Community
[https://community.jboss.org/message/646708#646708]

Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034]

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-user/attachments/20120113/13f26921/attachment.html 


More information about the jboss-user mailing list