[jboss-user] [JBoss jBPM] - Re: get the token in another task-node on a struts applicati

galvino do-not-reply at jboss.com
Fri Jul 6 04:27:42 EDT 2007


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



More information about the jboss-user mailing list