JBoss Community

Is it possible to get the StatefulKnowledgeSession/processInstance from solely its ID?

created by Bing Lim in jBPM - View the full discussion

Hi,

 

I have some questions on how to obtain the StatefulKnowledgeSession or processInstance that is running concurrently with another program.

 

From the documentation, it states that it's possible to make external calls using

  • ksession.signalEvent(type, eventData);

 

When I run my first .java file, I stored the current ksession.getId() and processInstanceId into a xml file and have a signal node at the converging gateway to wait for external signaling before continuing with the workflow.

https://community.jboss.org/servlet/JiveServlet/downloadImage/2-751749-19140/450-99/externalSignaling.JPG

 

 

After that, I ran another bpmn workflow that reads the xml file for both the ksession ID and processInstance ID.

However, I do not know how to use those 2 information to signal the signal node from the first bpmn workflow to continue with the workflow.

 

(I was able to print out the String reperesentation of the 2 IDs but whenever I create a new ksession and do   ksession.getWorkItemManager().registerWorkItemHandler("Signaling", new Signaling(ksession.getProcessInstance(Id)));

I kept getting nullPointerException )

-Signaling is a service node that does either ProcessInstance.signalEvent("Signal", null);  or session.signalEvent("Signal", null); (Tried both ways but didn't work)

 

Any help is greatly appreciated. Thanks in advance!

 

Best Regards,

Bing

Reply to this message by going to Community

Start a new discussion in jBPM at Community