Bing Lim [
https://community.jboss.org/people/binglim] created the discussion
"Is it possible to get the StatefulKnowledgeSession/processInstance from solely its
ID?"
To view the discussion, visit:
https://community.jboss.org/message/751749#751749
--------------------------------------------------------------
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
* processInstance.signalEvent(type, eventData);
* 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/showImage/2-751749-19140/...
https://community.jboss.org/servlet/JiveServlet/downloadImage/2-751749-19...
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
[
https://community.jboss.org/message/751749#751749]
Start a new discussion in jBPM at Community
[
https://community.jboss.org/choose-container!input.jspa?contentType=1&...]