[jboss-user] [JBoss jBPM] - Re: how to implement co-sign a task by several person?

aspider do-not-reply at jboss.com
Thu Dec 11 22:43:51 EST 2008


problem resolved.
I just added the red code, the process runs.


  | public class CosignTaskEndHandler implements ActionHandler {
  | 
  | 	private static final long serialVersionUID = 1L;
  | 	private static final Log log = LogFactory
  | 			.getLog(CosignTaskEndHandler.class);
  | 
  | 	/**
  | 	 * all approvers must agree, otherwise end
  | 	 */
  | 	
  | 	public void execute(ExecutionContext context) throws Exception {
  | 
  | 		Boolean isDisapprove = (Boolean) context.getTaskInstance().getVariable(
  | 				"isDisapprove");
  | 		log.info("isDisapprove:" + isDisapprove);
  | 
  | 		Token token = context.getToken();
  | 		TaskMgmtInstance tmi = context.getTaskMgmtInstance();
  | 		Collection<TaskInstance> unfinishedTasks = tmi
  | 				.getSignallingTasks(context);
  | 
  | 		if (isDisapprove != null) {
  | 			if (isDisapprove == true) {
  | 				for (TaskInstance unfinishedTaskInstance : unfinishedTasks) {
  | 
  | 					if (!unfinishedTaskInstance.hasEnded()) {
  | 						log.info(unfinishedTaskInstance.getActorId());
  | 						unfinishedTaskInstance.setSignalling(false);						unfinishedTaskInstance.end();
  | 					}
  | 				}
  | 			}
  | 		}
  | 
  | 	}
  | 	
  | 
  | 	
  | 		
  | 	
  | 	
  | 
  | }
  | 

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

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



More information about the jboss-user mailing list