[jboss-user] [JBoss jBPM] - How Continue Process Execution Using Java (Without the jBPM
Fornachari
do-not-reply at jboss.com
Mon Jun 9 11:30:00 EDT 2008
Hello everybody!
I think that my doubt is a little confuse, I'll try to explain best possible.
I have a test process, created with jBPM 3.2.2, and I want to execute it without the jBPM console.
It's a very simple process, just to learn more about jBPM.
There are two Task-Nodes, the first node is assigned to the actor "user". The user make a requisition, typing his name in a field and typing his requisition in another field, then press the button "Submit". After that, the process go to the second task-node, assigned for the actor "admin". The admin read the user's name and the user's requisition. Then the admin type some information in a field called "Admin's Comment" and click in the button "OK", then the process go to the end state and finish.
I tested my process in the jBPM Console and everything works well, but I would like to run the process in my own JSP page, without the jBPM console.
I can start the process and execute the first task with java implementation, like below:
JbpmConfiguration jbpmConfiguration = JbpmConfiguration.parseResource("default.jbpm.cfg.xml");
| JbpmContext jbpmContext = jbpmConfiguration.createJbpmContext();
| GraphSession gpSession = jbpmContext.getGraphSession();
|
| ProcessDefinition pdef = gpSession.findLatestProcessDefinition("MyProcessName");
| ProcessInstance instance = pdef.createProcessInstance();
|
| //set initial values
| instance.getContextInstance().setVariable("userName", "John");
| instance.getContextInstance().setVariable("requisition", "John's Requisition");
|
| Token token = instance.getRootToken();
| token.signal();
|
| jbpmContext.close();
The code above works well, I can start my process and execute the first task. But, what kind of java implementation I have to do to continue the execution, to execute the next task?
Any help, any idea?
Thank in advance!
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4156741#4156741
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4156741
More information about the jboss-user
mailing list