Package com.founder.fix.fixflow.core.task

Examples of com.founder.fix.fixflow.core.task.TaskInstance


  public List<UserTaskBehavior> execute(CommandContext commandContext) {
   
   
    TaskManager taskManager = commandContext.getTaskManager();

    TaskInstance taskInstanceQuery = taskManager.findTaskById(taskId);
   
    if(taskId==null||taskId.equals("")){
      throw new FixFlowException("taskId不能为空");
    }

   
    if(taskInstanceQuery==null){
      throw new FixFlowException("没有查询到相关任务");
    }
   
    String tokenId = taskInstanceQuery.getTokenId();
    String processDefinitionId = taskInstanceQuery.getProcessDefinitionId();
    ProcessInstanceManager processInstanceManager = commandContext.getProcessInstanceManager();

    String processInstanceId = taskInstanceQuery.getProcessInstanceId();

    ProcessDefinitionManager processDefinitionManager = commandContext.getProcessDefinitionManager();

    ProcessDefinitionBehavior processDefinition = processDefinitionManager.findLatestProcessDefinitionById(processDefinitionId);
View Full Code Here


  public ProcessInstance execute(CommandContext commandContext) {

    TaskManager taskManager = commandContext.getTaskManager();

    TaskInstance taskInstanceQuery = taskManager.findTaskById(taskId);

    String tokenId = taskInstanceQuery.getTokenId();
    String nodeId = taskInstanceQuery.getNodeId();
    String processDefinitionId = taskInstanceQuery.getProcessDefinitionId();
    ProcessInstanceManager processInstanceManager = commandContext
        .getProcessInstanceManager();

    String processInstanceId = taskInstanceQuery.getProcessInstanceId();

    ProcessDefinitionManager processDefinitionManager = commandContext
        .getProcessDefinitionManager();

    ProcessDefinitionBehavior processDefinition = processDefinitionManager
View Full Code Here

     
     
     
     
     
      TaskInstance taskInstance=commandContext.getTaskManager().findTaskById(taskId);
     
   
     
     
      if(taskInstance==null){
        throw new FixFlowBizException("模拟执行的任务无法找到!");
      }
     
      String tokenIdString=taskInstance.getTokenId();
     
     
      if(!taskInstance.hasEnded()){
        throw new FixFlowBizException("模拟执行的当前任务必须已经结束!");
      }
     
      ProcessInstance processInstance=commandContext.getProcessInstanceManager().findProcessInstanceById(taskInstance.getProcessInstanceId());
     
      if(processInstance==null){
        throw new FixFlowBizException("未能找到任务对应的流程实例");
      }
      ProcessInstanceEntity processInstanceEntity=(ProcessInstanceEntity)processInstance;
      TokenEntity tokenEntity=processInstanceEntity.getTokenMap().get(tokenIdString);
     
     
     
     
      List<TaskInstanceEntity> taskInstanceEntities= processInstanceEntity.getTaskMgmtInstance().getTaskInstanceEntitys();
      List<TaskInstance> taskInstances=new ArrayList<TaskInstance>();
      for (TaskInstanceEntity taskInstanceEntity : taskInstanceEntities) {
        if(!taskInstanceEntity.hasEnded()){
          String nextTokenId=taskInstanceEntity.getTokenId();
          if(tokenIdString.equals(nextTokenId)){
            taskInstances.add(taskInstanceEntity);
          }else{
           
            //分支走到合并的时候的处理.
            if(tokenEntity==null){
              if(taskInstanceEntity.getCreateTime().compareTo(taskInstance.getCreateTime())>=0){
                taskInstances.add(taskInstanceEntity);
              }
            }
            else{
     
View Full Code Here

  public List<TaskInstance> execute(CommandContext commandContext) {
   
   
    TaskManager taskManager = commandContext.getTaskManager();

    TaskInstance taskInstanceQuery = taskManager.findTaskById(taskId);
   
   
    String tokenId = taskInstanceQuery.getTokenId();
    String processDefinitionId = taskInstanceQuery.getProcessDefinitionId();
    ProcessInstanceManager processInstanceManager = commandContext.getProcessInstanceManager();

    String processInstanceId = taskInstanceQuery.getProcessInstanceId();

    ProcessDefinitionManager processDefinitionManager = commandContext.getProcessDefinitionManager();

    ProcessDefinitionBehavior processDefinition = processDefinitionManager.findLatestProcessDefinitionById(processDefinitionId);
View Full Code Here

     
     
      TaskManager taskManager = commandContext.getTaskManager();

      TaskInstance taskInstanceQuery = taskManager.findTaskById(taskId);

     
      String processDefinitionId = taskInstanceQuery.getProcessDefinitionId();
      ProcessInstanceManager processInstanceManager = commandContext.getProcessInstanceManager();

      String processInstanceId = taskInstanceQuery.getProcessInstanceId();

      ProcessDefinitionManager processDefinitionManager = commandContext.getProcessDefinitionManager();

      ProcessDefinitionBehavior processDefinition = processDefinitionManager.findLatestProcessDefinitionById(processDefinitionId);
View Full Code Here

    TaskInstanceType newTaskTaskInstanceType = TaskInstanceType.FIXRECEIVETASK;
    String newTaskProcessDefinitionName = executionContext.getProcessDefinition().getName();
    boolean isDraft = false;

    // 创建任务
    TaskInstance taskInstance = new TaskInstanceEntity();
    taskInstance.setId(newTaskId);
    taskInstance.setNodeName(newTaskNodeName);
    taskInstance.setProcessInstanceId(newTaskProcessInstanceId);
    taskInstance.setProcessDefinitionId(newTaskProcessDefinitionId);
    taskInstance.setTokenId(newTaskTokenId);
    taskInstance.setNodeId(newTaskNodeId);
    taskInstance.setName(newTaskNodeName);
    taskInstance.setDescription(newTaskDescription);
    taskInstance.setCreateTime(newTaskCreateTime);
    taskInstance.setPriority(newTaskPriority);
    taskInstance.setProcessDefinitionKey(newTaskProcessDefinitionKey);
    taskInstance.setTaskInstanceType(newTaskTaskInstanceType);
    taskInstance.setProcessDefinitionName(newTaskProcessDefinitionName);
    taskInstance.setDraft(isDraft);
    //taskInstance.setCallActivityInstanceId(subProcessInstanceId);
    Context.getCommandContext().getTaskManager().saveTaskInstanceEntity((TaskInstanceEntity) taskInstance);

  }
View Full Code Here

  }


  public void resumeTask(String taskId) {
    TaskService taskService=getProcessEngine().getTaskService();
    TaskInstance taskInstance=taskService.createTaskQuery().taskId(taskId).singleResult();
    taskInstance.resume();
    taskService.saveTask(taskInstance);
  }
View Full Code Here

    taskService.saveTask(taskInstance);
  }

  public void suspendTask(String taskId) {
    TaskService taskService=getProcessEngine().getTaskService();
    TaskInstance taskInstance=taskService.createTaskQuery().taskId(taskId).singleResult();
    taskInstance.suspend();
    taskService.saveTask(taskInstance);
  }
View Full Code Here

    TaskInstanceType newTaskTaskInstanceType = TaskInstanceType.FIXCALLACTIVITYTASK;
    String newTaskProcessDefinitionName = executionContext.getProcessDefinition().getName();
    boolean isDraft = false;

    // 创建任务
    TaskInstance taskInstance = new TaskInstanceEntity();
    taskInstance.setId(newTaskId);
    taskInstance.setNodeName(newTaskNodeName);
    taskInstance.setProcessInstanceId(newTaskProcessInstanceId);
    taskInstance.setProcessDefinitionId(newTaskProcessDefinitionId);
    taskInstance.setTokenId(newTaskTokenId);
    taskInstance.setNodeId(newTaskNodeId);
    taskInstance.setName(newTaskNodeName);
    taskInstance.setDescription(newTaskDescription);
    taskInstance.setCreateTime(newTaskCreateTime);
    taskInstance.setPriority(newTaskPriority);
    taskInstance.setProcessDefinitionKey(newTaskProcessDefinitionKey);
    taskInstance.setTaskInstanceType(newTaskTaskInstanceType);
    taskInstance.setProcessDefinitionName(newTaskProcessDefinitionName);
    taskInstance.setDraft(isDraft);
    taskInstance.setCallActivityInstanceId(subProcessInstanceId);

    Context.getCommandContext().getTaskManager().saveTaskInstanceEntity((TaskInstanceEntity) taskInstance);

  }
View Full Code Here

   * @return
   */
  public static List<TaskInstance> getRollBackTask(TaskInstance taskInstance) {

    List<TaskInstance> taskInstanceQueryToTemp = new ArrayList<TaskInstance>();
    TaskInstance taskInstanceQuery = taskInstance;
    List<String> tokenIdList = new ArrayList<String>();
    TokenEntity token = ((TaskInstanceEntity) taskInstance).getToken();
    getTokenParent(token, tokenIdList);
    @SuppressWarnings({ "unchecked", "rawtypes" })
    List<TaskInstance> taskInstanceQueryToList = (List) Context.getCommandContext().getTaskManager().findTasksByTokenIdList(tokenIdList);

    for (TaskInstance taskInstanceQueryTo : taskInstanceQueryToList) {
      if (!taskInstanceQueryTo.getId().equals(taskInstanceQuery.getId())) {
        if (taskInstanceQueryTo.getTaskGroup() != null) {

          taskInstanceQueryToTemp.add(taskInstanceQueryTo);
        } else {
          if (taskInstanceQueryToTemp.size() == 0) {
View Full Code Here

TOP

Related Classes of com.founder.fix.fixflow.core.task.TaskInstance

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.