[jboss-user] [JBoss jBPM] - Re: Ending tasks manually

wurzelbutz do-not-reply at jboss.com
Wed May 27 05:17:39 EDT 2009


are you sure .getLeavingTransition("refusee") returns the correct one?

maybe cou could try this

  | try {
  | 
  | 	processInstance = jbpmContext.loadProcessInstance(processInstanceId);
  | 	
  | 	TaskMgmtSession taskMgmtSession = jbpmContext.getTaskMgmtSession();
  | 	@SuppressWarnings(value={"unchecked"}) //taskMgmtSession returns a raw List... We ignore the warning thrown by Java
  | 	List<TaskInstance> userTaskList = taskMgmtSession.findTaskInstances(demande.getValideur().getUsername());
  | 	
  | 	for(int i = 0 ; i < userTaskList.size() ; i++)
  | 	{
  | 		TaskInstance taskInstance = userTaskList.get(i);
  | 		if(taskInstance.getProcessInstance().getId() == processInstanceId)
  | 		{
  | 			if(taskInstance.getName().equals("valider_demande"))
  | 			{
  | 				processInstance.getContextInstance().setVariable("demande", demande);
  | taskInstance =jbpmContext.getTaskInstance(taskInstance.getID());				
  | Transition tr=taskInstance.getTask().getTaskNode().getLeavingTransition("refusee");
  | 				taskInstance.end(tr);
  | 				break;
  | 			}
  | 		}
  | 	}
  | 	
  | 	}
  | 
  | 



View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4233518#4233518

Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4233518



More information about the jboss-user mailing list