[jboss-user] [jBPM] - Re: JBPM5 Starting Guvnor process question

npereira do-not-reply at jboss.com
Tue Aug 23 10:27:27 EDT 2011


npereira [http://community.jboss.org/people/npereira] created the discussion

"Re: JBPM5 Starting Guvnor process question"

To view the discussion, visit: http://community.jboss.org/message/622419#622419

--------------------------------------------------------------
Hi forum,

I'm still having some dificulty with his question, I was wondering if someone could help.

What we are trying to implement is a startProcess() method.
The objective of this method is to contact the runtime engine and “tell it” to start a given process, without using REST.

So far we have gotten to these point.

KnowledgeAgentConfiguration aconf = KnowledgeAgentFactory.+newKnowledgeAgentConfiguration+();
 KnowledgeAgent kagent = KnowledgeAgentFactory.+newKnowledgeAgent+("testKAgent", aconf);      
String fileName = "/home/n1w3/Downloads/ChangeSet.xml";
 kagent.applyChangeSet(ResourceFactory.+newFileResource+(fileName));
 KnowledgeBase kbase = kagent.getKnowledgeBase();
 
 StatefulKnowledgeSession ksession = kbase.newStatefulKnowledgeSession();
 Collection<ProcessInstance> c = ksession.getProcessInstances();
 
 System.+out+.println(c.size());
 kbase = kagent.getKnowledgeBase();
 *for* (Process process: kbase.getProcesses()) {
  System.+out+.println("Loading process from Guvnor: " + process.getId());
 }
 
  ksession.getWorkItemManager().registerWorkItemHandler("Human Task", *new* WSHumanTaskHandler());
 //StatefulKnowledgeSession ksession = kbase.newStatefulKnowledgeSession();             
 ProcessInstance processInstance = ksession.startProcess("com.temenos.bpmn.CustomerOnBoarding");
 
 System.+out+.println(processInstance.getId());

These peace of code, lets us fetch the processes that are in guvnor and then start a new process.  
The problem with it, is that I have to maintain my session open so that the process gets orchestrated. If I stop the program, the process does not get orchestrated.

The objective we are trying to obtain is something like a “fire and forget” approach where we say start process and the runtime engine orchestrates it.

Can anybody help us out with this one?
--------------------------------------------------------------

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

Start a new discussion in jBPM at Community
[http://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/20110823/1f8bbe6a/attachment-0001.html 


More information about the jboss-user mailing list