[jboss-user] [jBPM] - Re: How to make a process instance go on with jBPM5?

Esteban Aliverti do-not-reply at jboss.com
Sun Apr 17 22:32:11 EDT 2011

Esteban Aliverti [http://community.jboss.org/people/eaa] created the discussion

"Re: How to make a process instance go on with jBPM5?"

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

If you want to start a process in one test and complete it in another, you will need to follow these steps:
* Your process must have a wait-state. If it doesn't the process will start and end in the startProcess() call.
* You need to enable persistence. When the process reaches the wait-state in the first test it will be persisted in the DB.
* The second test needs to know the session id generated in the first test. You can get this id from the session object created in the first test. You wil need to store it in a place reachable by the second test. If you want to keep it simple, just use a static variable.
* Whithin the first test, your process will eventually execute the Handler you have configured for your Work Item. This handler will need to store the workItem id somewhere (again, in a place reachable by test number 2)
* In the second test, using the session id stored in th efirst test, you need to retrieve the session from the database. The best way to do this is using JPAKnowledgeService.
* Once you have the session, you need to call session.getWorkItemManager().completeWorkItem() using the work item id previously saved.  

Best Regards,

Reply to this message by going to Community

Start a new discussion in jBPM at Community

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-user/attachments/20110417/5462589d/attachment.html 

More information about the jboss-user mailing list