Package com.founder.fix.fixflow.core.impl.bpmn.behavior

Examples of com.founder.fix.fixflow.core.impl.bpmn.behavior.UserTaskBehavior


    // 获取正在操作的任务命令对象实例
    TaskCommandInst taskCommand = getTaskCommandInst();

    try {

      UserTaskBehavior backNodeUserTask = (UserTaskBehavior) getExecutionContext().getProcessDefinition().getDefinitions().getElement(rollBackNodeId);
      taskInstance.toFlowNodeEnd(taskCommand, taskComment, backNodeUserTask, null);

    } catch (Exception e) {

      throw new FixFlowException("任务: " + taskId + " 退回失败!", e);
View Full Code Here


      flowNode=executionContext.getToken().getFlowNode();
    }else{
      executeOld(executionContext);
      return;
    }
    UserTaskBehavior userTask=null;
    if(flowNode instanceof UserTask){
      userTask=(UserTaskBehavior)flowNode;
    }
    if(userTask==null){
      return;
    }
   
    if(commandId==null){
      return;
    }
    else{
      TaskCommandInst taskCommandInst=userTask.getTaskCommandsMap().get(commandId);
     
     
      if (taskCommandInst != null && taskCommandInst.getExpression() != null) {
        try {
         
View Full Code Here

 
  public void executeOld(ExecutionContext executionContext) throws Exception {
   
    FlowNode flowNode=executionContext.getTimeOutNode();

    UserTaskBehavior userTask=null;
    TokenEntity token=executionContext.getToken();
    if(flowNode instanceof UserTask){
      userTask=(UserTaskBehavior)flowNode;
    }
    if(userTask==null){
      return;
    }
   
    if(commandId==null){
      return;
    }
    else{
      TaskCommandInst taskCommandInst=userTask.getTaskCommandsMap().get(commandId);
     
     
      if (taskCommandInst != null && taskCommandInst.getExpression() != null) {
        try {
         
View Full Code Here

   
    if (taskInstanceQueryRollBack.getTaskGroup() != null) {

      try {

        UserTaskBehavior backNodeUserTask = (UserTaskBehavior) executionContext.getProcessDefinition().getDefinitions().getElement(rollBackNodeId);

        taskInstance.toFlowNodeEnd(taskCommand, taskComment, backNodeUserTask, null);

      } catch (Exception e) {

        throw new FixFlowException("任务: " + taskId + " 退回失败!", e);
      }

      try {
        saveProcessInstance(commandContext);
      } catch (Exception e) {
        throw new FixFlowException("流程实例持久化失败!", e);
      }
      return null;

    } else {

      try {
        UserTaskBehavior backNodeUserTask = (UserTaskBehavior) executionContext.getProcessDefinition().getDefinitions().getElement(rollBackNodeId);

        taskInstance.toFlowNodeEnd(taskCommand, taskComment, backNodeUserTask, taskInstanceQueryRollBack.getAssignee());

      } catch (Exception e) {
View Full Code Here

   
    if (taskInstanceQueryRollBack.getTaskGroup() != null) {

      try {
        UserTaskBehavior backNodeUserTask = (UserTaskBehavior)getProcessInstance().getProcessDefinition().getDefinitions().getElement(rollBackNodeId);
        taskInstance.toFlowNodeEnd(taskCommand, taskComment, backNodeUserTask, null);

      } catch (Exception e) {

        throw new FixFlowException("任务: " + taskId + " 退回失败!", e);
      }

      try {
        saveProcessInstance(commandContext);
      } catch (Exception e) {
        throw new FixFlowException("流程实例持久化失败!", e);
      }
      return null;

    } else {

      try {

        UserTaskBehavior backNodeUserTask = (UserTaskBehavior) getProcessInstance().getProcessDefinition().getDefinitions().getElement(rollBackNodeId);

        taskInstance.toFlowNodeEnd(taskCommand, taskComment, backNodeUserTask, taskInstanceQueryRollBack.getAssignee());

      } catch (Exception e) {
View Full Code Here

    if (taskInstanceQueryRollBack.getTaskGroup() != null) {

      try {
       
        UserTaskBehavior backNodeUserTask = (UserTaskBehavior) parentExecutionContext.getProcessDefinition().getDefinitions().getElement(rollBackNodeId);

        parentExecutionContext.setToFlowNode(backNodeUserTask);
 
        parentToken.signal(parentExecutionContext);

       
        //taskInstance.toFlowNodeEnd(taskCommand, taskComment, backNodeUserTask, null);

      } catch (Exception e) {

        throw new FixFlowException("任务: " + taskId + " 退回失败!", e);
      }

      try {
        Context.getCommandContext().getProcessInstanceManager().saveProcessInstance(parentProcessInstance);
      } catch (Exception e) {
        throw new FixFlowException("流程实例持久化失败!", e);
      }
 

    } else {

      try {
       
        UserTaskBehavior backNodeUserTask = (UserTaskBehavior) parentExecutionContext.getProcessDefinition().getDefinitions().getElement(rollBackNodeId);

        parentExecutionContext.setToFlowNode(backNodeUserTask);
       
        parentExecutionContext.setRollBackAssignee(taskInstanceQueryRollBack.getAssignee());
       
View Full Code Here

     
        try {

       
         
          UserTaskBehavior backNodeUserTask = (UserTaskBehavior) getExecutionContext().getProcessDefinition().getDefinitions().getElement(rollBackNodeId);
          taskInstance.toFlowNodeEnd(taskCommand, taskComment, backNodeUserTask, null);

         
         

        } catch (Exception e) {

          throw new FixFlowException("任务: " + taskId + " 退回失败!", e);
        }

      }else{
        throw new FixFlowException("未点击任务处理按钮,任务处理失败。");
      }

      try {
        saveProcessInstance(commandContext);
      } catch (Exception e) {
        throw new FixFlowException("流程实例持久化失败!", e);
      }
      return null;

    } else {

      if (taskCommand != null) {

        String taskId = this.taskId;
        String taskComment = this.taskComment;
        String rollBackNodeId = taskInstanceQueryTos.get(0).getNodeId();

       
        try {

          UserTaskBehavior backNodeUserTask = (UserTaskBehavior) getExecutionContext().getProcessDefinition().getDefinitions().getElement(rollBackNodeId);
          taskInstance.toFlowNodeEnd(taskCommand, taskComment, backNodeUserTask, taskInstanceQueryTos.get(0).getAssignee());


        } catch (Exception e) {
View Full Code Here

   

 
      ProcessDefinitionBehavior processDefinition = processInstanceImpl.getProcessDefinition();

      UserTaskBehavior userTask = (UserTaskBehavior) processDefinition.getDefinitions().getElement(recoverNodeId);

     

      TokenEntity tokenEntity = processInstanceImpl.getTokenMap().get(tokenId);

      tokenEntity.terminationChildTokenWithTask(taskCommand.getTaskCommandType(), taskCommand.getName(), this.taskComment, userId, this.agent, this.admin);

      //TokenEntity token = processInstanceImpl.getTokenMap().get(tokenId);

      ExecutionContext executionContext = ProcessObjectFactory.FACTORYINSTANCE.createExecutionContext(tokenEntity);

      //taskInstanceTemp.setAssigneeWithoutCascade(userId);
      taskInstanceTemp.customEnd(taskCommand, taskComment);

      tokenEntity.removeTaskInstanceSynchronization(taskCommand.getTaskCommandType(), taskCommand.getName(), this.taskComment, userId, this.agent, this.admin);

      if (recoverToTask.getTaskGroup() != null) {

        if (taskCommand != null) {

          userTask.enter(executionContext);

        }

        try {
          saveProcessInstance(commandContext);
        } catch (Exception e) {
          throw new FixFlowException("流程实例持久化失败!", e);
        }
        return null;

      } else {

        if (taskCommand != null) {

          executionContext.setRollBackAssignee(recoverToTask.getAssignee());
          userTask.enter(executionContext);

        }

        try {
          saveProcessInstance(commandContext);
        } catch (Exception e) {
          throw new FixFlowException("流程实例持久化失败!", e);
        }
        return null;

      }

    } else {
     
     
      ProcessDefinitionBehavior processDefinition = processInstanceImpl.getProcessDefinition();

      UserTaskBehavior userTask = (UserTaskBehavior) processDefinition.getDefinitions().getElement(recoverNodeId);

     
     

      TokenEntity tokenEntity = processInstanceImpl.getRootToken();

      tokenEntity.terminationChildTokenWithTask(taskCommand.getTaskCommandType(), taskCommand.getName(), this.taskComment, userId, this.agent, this.admin);

      //TokenEntity token = processInstanceImpl.getTokenMap().get(tokenId);

      ExecutionContext executionContext = ProcessObjectFactory.FACTORYINSTANCE.createExecutionContext(tokenEntity);

      //taskInstanceTemp.setAssigneeWithoutCascade(userId);
      taskInstanceTemp.customEnd(taskCommand, taskComment);

      tokenEntity.removeTaskInstanceSynchronization(taskCommand.getTaskCommandType(), taskCommand.getName(), this.taskComment, userId, this.agent, this.admin);

      if (recoverToTask.getTaskGroup() != null) {

        if (taskCommand != null) {

          userTask.enter(executionContext);

        }

        try {
          saveProcessInstance(commandContext);
        } catch (Exception e) {
          throw new FixFlowException("流程实例持久化失败!", e);
        }
        return null;

      } else {

        if (taskCommand != null) {

          executionContext.setRollBackAssignee(recoverToTask.getAssignee());
          userTask.enter(executionContext);

        }

        try {
          saveProcessInstance(commandContext);
View Full Code Here

    //查询可退回的节点
    List<UserTaskBehavior> userTaskBehaviors = taskService.getRollBackNode(taskInstance.getId());
    //验证可退回节点数为1
    assertEquals(1, userTaskBehaviors.size());
    //获得可退回的节点
    UserTaskBehavior userTaskBehavior = userTaskBehaviors.get(0);
    //验证是否是第一个节点
    assertEquals("UserTask_1",userTaskBehavior.getId());
  }
View Full Code Here

    return parentTaskInstance;
  }

  public TaskDefinition getTaskDefinition() {
    if(this.taskDefinition==null){
        UserTaskBehavior userTaskBehavior=(UserTaskBehavior)getToken().getFlowNode();
        this.taskDefinition=userTaskBehavior.getTaskDefinition();
    }
   

    return taskDefinition;
  }
View Full Code Here

TOP

Related Classes of com.founder.fix.fixflow.core.impl.bpmn.behavior.UserTaskBehavior

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.