activiti任意跳转_JAVA_编程开发_程序员俱乐部

中国优秀的程序员网站程序员频道CXYCLUB技术地图
热搜:
更多>>
 
您所在的位置: 程序员俱乐部 > 编程开发 > JAVA > activiti任意跳转

activiti任意跳转

 2013/8/1 13:09:40  sweat89  程序员俱乐部  我要评论(0)
  • 摘要:publicclassJumpTaskCmdimplementsCommand<Comment>{protectedStringexecutionId;protectedStringactivityId;publicJumpTaskCmd(StringexecutionId,StringactivityId){this.executionId=executionId;this.activityId=activityId;}publicCommentexecute
  • 标签:
class="java" name="code">public class JumpTaskCmd implements Command<Comment> {

	protected String executionId;
	protected String activityId;
	
	
	public JumpTaskCmd(String executionId, String activityId) {
		this.executionId = executionId;
		this.activityId = activityId;
	}
	
	public Comment execute(CommandContext commandContext) {
		for (TaskEntity taskEntity : Context.getCommandContext().getTaskEntityManager().findTasksByExecutionId(executionId)) {
	    	Context.getCommandContext().getTaskEntityManager().deleteTask(taskEntity, "jump", false);
	    }
	    ExecutionEntity executionEntity = Context.getCommandContext().getExecutionEntityManager().findExecutionById(executionId);
	    ProcessDefinitionImpl processDefinition = executionEntity.getProcessDefinition();
	    ActivityImpl activity = processDefinition.findActivity(activityId);
	    executionEntity.executeActivity(activity);
		return null;
	}

}


调用:
TaskServiceImpl taskServiceImpl=(TaskServiceImpl)taskService;
taskServiceImpl.getCommandExecutor().execute(new JumpTaskCmd(executionId, activityId));

executionId:当前任务executionID。activityId:跳转目标activityID
  • 相关文章
发表评论
用户名: 匿名