[JBoss jBPM] - Re: get the token in another task-node on a struts applicati
by galvino
so i do this code program on th esecond form :
anonymous wrote :
| jbpmContext=this.getJbpmContext(request).getJbpmConfiguration().getCurrentJbpmContext();
| graphSession=jbpmContext.getGraphSession();
| /*System.out.println("\n StartProcessInstance.jbpmContext: "+jbpmContext+"\n");
| System.out.println("\n Actor: "+jbpmContext.getActorId()+"\n");
|
| ProcessDefinition processDefinition=graphSession.getProcessDefinition(1);*/
|
| /*ProcessInstance instance=jbpmContext.getProcessInstance(1);
| System.out.println("..............id: "+instance.getId());
| System.out.println("..............Version: "+instance.getVersion()+"\n");*/
|
| TaskMgmtSession taskMgmtSession = jbpmContext.getTaskMgmtSession();
|
| TaskInstance taskInstance = taskMgmtSession.loadTaskInstance(1);
| taskInstance.setActorId(jbpmContext.getActorId());
| taskInstance.start();
|
| System.out.println("......"+taskInstance.getName());
|
| Token token = taskInstance.getToken();
| Transition transition=null;
| String transitionName=null;
|
| if (token.getNode().getLeavingTransitions().isEmpty() == false) {
| Iterator availableTransitionsIterator = token.getNode().getLeavingTransitions().iterator();
| while (availableTransitionsIterator.hasNext()) {
| transition = (Transition) availableTransitionsIterator.next();
| }
| transitionName=transition.getName();
| }
|
| //token.signal(transitionName);
| ProcessInstance processInstance = token.getProcessInstance();
|
| Map<String, String> taskVariables = new HashMap<String, String>();
| taskVariables.put("nom", "maldini");
| taskVariables.put("prenom", "paolo");
| taskVariables.put("decision", "no");
| taskInstance.addVariables(taskVariables);
|
| taskInstance.end();
|
| jbpmContext.save(processInstance);
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4061150#4061150
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4061150
18Â years, 9Â months
[JBoss jBPM] - Re: get the token in another task-node on a struts applicati
by galvino
thank you for your response.
i want to do a simple workflow by using struts where each form correspond to the next task .
For example,
anonymous wrote :
| start ->start state
| task-node 1
| task-node 2
| end
|
on my first form i do this:
anonymous wrote :
| jbpmContext=this.getJbpmContext(request);
|
| graphSession=jbpmContext.getGraphSession();
| System.out.println("\n StartProcessInstance.jbpmContext: "+jbpmContext+"\n");
|
| ProcessDefinition processDefinition=ProcessDefinition.parseXmlResource("SimpleApp/processdefinition.xml");
| graphSession.deployProcessDefinition(processDefinition);
|
| System.out.println(" ...........Id: "+processDefinition.getId());
| System.out.println(" ...........Name: "+processDefinition.getName());
| System.out.println(" ...........Version: "+processDefinition.getVersion()+"\n");
|
|
| //create a new process instance to run
| ProcessInstance processInstance = new ProcessInstance(processDefinition);
|
| Token token=processInstance.getRootToken();
| token.signal();
| processDefinition.getNode("task-node1");
| jbpmContext.save(processInstance);
|
After that, the token go to task-node 1, there is no problem.
then, on my second form, i want to get where is my token and continue the process execution.
this is my problem.............
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4061140#4061140
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4061140
18Â years, 9Â months