自己创建转换


	public void jumpToNode(ProcessInstance processInstance, String nodeName){
        Set<TaskInstance> taskInstances = (Set<TaskInstance>) processInstance.getTaskMgmtInstance().getTaskInstances();
        Iterator<TaskInstance> it= taskInstances.iterator();
        logger.info("taskInstances size = " + taskInstances.size());
        while(it.hasNext()){
            TaskInstance task = it.next();
            logger.info("one of task = " + task.getName());
			if(task.getEnd() == null){
				logger.info("current task = " + task.getName());
				Token t = task.getToken();
				String transitionName = processInstance.getProcessDefinition().getName()+"_"+t.getNode().getName() + "_" + nodeName;
				if(t.getNode().getLeavingTransitionsMap().containsKey(transitionName)){
					task.end(transitionName);
				}else{
					Transition transition = new Transition();
					transition.setName(transitionName);
					transition.setProcessDefinition(processInstance.getProcessDefinition());
					transition.setTo(processInstance.getProcessDefinition().getNode(nodeName));
					transition.setFrom(t.getNode());
					t.getNode().addLeavingTransition(transition);
					task.end(transitionName);
				}
				break;
			}else{
				continue;
			}
        }
	}

你可能感兴趣的:(转换)