Ryan Peterson [
http://community.jboss.org/people/rrpeterson] created the discussion
"How to get active processes via ksession.getProcessInstances()"
To view the discussion, visit:
http://community.jboss.org/message/630659#630659
--------------------------------------------------------------
Hey guys,
I'm using a single StatefulKnowledgeSession to manage my processes. Each
processInstance is mapped to a userId, which is stored in the params map as a process
variable upon the start of the process:
ksession.startProcess(processId, params)
Later I'd like to check if a specific userId exists in the workflow engine, which I
was hoping to check all the active processInstances and search for the userId within their
processVariables.
Unfortunately when I use ksession.getProcessInstances() I get 0 results. Is there a way
to do a "deep" search to find the active processes? I am persisting the
processes and StatefulKnowledgeSession, but I have not called .dispose() and am still in
the same jvm instance (haven't restored the ksession from the database).
Is there a better way to find if a user is already in a workflow based on process
variables?
Thanks for any help!
--------------------------------------------------------------
Reply to this message by going to Community
[
http://community.jboss.org/message/630659#630659]
Start a new discussion in jBPM at Community
[
http://community.jboss.org/choose-container!input.jspa?contentType=1&...]