JBoss Community

Re: How can i get the human task id defined in bpmn files?

created by Shobhit Tyagi in jBPM Development - View the full discussion

I believe you have the process instance ID. So you can find the process definition id using the instance id first.

Using the process def id, you will need to find the Process object to get the node related information.

Here is what you can do,

 

String strProcessDefId = JPAProcessInstanceDbLog.findProcessInstance(intProcessInstId).getProcessId(); // Get process def id.
   
readKnowledgeBase(); // Get the knowledge base by feeding it the process name.
 Process objProcess = objKBase.getProcess(strProcessDefId); // Process object.
   List<NodeInstanceLog> arlNodeInstanceLogList;
   for (Node objNode : ((WorkflowProcessImpl) objProcess).getNodes())
   {
     Map<String, Object> hshMetaData = objNode.getMetaData();
     System.out.println(hshMetaData.get("UniqueId"));
    }

 

Regards.

Reply to this message by going to Community

Start a new discussion in jBPM Development at Community