[jboss-user] [jBPM] - Re: Couldn't retrieve the node name for the process instance in JBPM 5.4

Maciej Swiderski do-not-reply at jboss.com
Thu Jan 10 05:47:50 EST 2013


Maciej Swiderski [https://community.jboss.org/people/swiderski.maciej] created the discussion

"Re: Couldn't retrieve the node name for the process instance in JBPM 5.4"

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

--------------------------------------------------------------
if you use persistence you should make it as part of transaction and to do so you could use command like following:
String nodeName = ksession.execute(new GenericCommand<String>() {
    public String execute(Context context) {
        StatefulKnowledgeSession ksession = ((KnowledgeCommandContext) context).getStatefulKnowledgesession();
        org.jbpm.process.instance.ProcessInstance processInstance = (org.jbpm.process.instance.ProcessInstance) ksession.getProcessInstance(piId);
        
        return ((org.jbpm.workflow.instance.WorkflowProcessInstance)instance).getNodeInstances().iterator().next().getNodeName());
    }
});
 

Obviously it's simple case you could have a command that does all you need.

if you are looking for a way to get node names of active process instance you can use history log data for it and then you don't need to have anything else but processInstanceId, take a look at methods of this  http://docs.jboss.org/jbpm/v5.4/javadocs/org/jbpm/process/audit/JPAProcessInstanceDbLog.html class

HTH
--------------------------------------------------------------

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

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/20130110/2c2eba99/attachment.html 


More information about the jboss-user mailing list