Package com.founder.fix.fixflow.core.impl.runtime

Examples of com.founder.fix.fixflow.core.impl.runtime.TokenEntity


  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 {
         
          ExpressionMgmt.execute(taskCommandInst.getExpression(), executionContext);
        } catch (Exception e) {
          throw new FixFlowException("用户命令表达式执行异常!", e);
        }
      }
     
     
      List<TaskInstanceEntity> taskInstances= token.getProcessInstance().getTaskMgmtInstance().getTaskInstanceEntitys(token);
      for (TaskInstanceEntity taskInstanceEntity : taskInstances) {
        if(taskInstanceEntity.hasEnded()){
          taskInstanceEntity.setCommandId(taskCommandInst.getId());
          taskInstanceEntity.setCommandMessage(opinion);
          taskInstanceEntity.setCommandType(taskCommandInst.getTaskCommandType());
View Full Code Here


  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) {
View Full Code Here

  public static List<TaskInstance> getRollBackTaskByToken(Token token) {

    List<TaskInstance> taskInstanceQueryToTemp = new ArrayList<TaskInstance>();

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

    for (TaskInstance taskInstanceQueryTo : taskInstanceQueryToList) {
View Full Code Here

    super.execute(executionContext);
  }

  private void parallelGatewayConverging(ExecutionContext executionContext) {

    TokenEntity token = executionContext.getToken();

    TokenEntity parentToken = token.getParent();
    // 判断是否有父令牌
    if (parentToken != null) {

      // 判断令牌是否需要重新激活
      if (token.isAbleToReactivateParent()) {

        token.setAbleToReactivateParent(false);

        boolean reactivateParent = true;

        if (isDiscriminator) {

          reactivateParent = true;

        } else if (tokenIds != null) {
          reactivateParent = mustParentBeReactivated(parentToken, tokenIds);

        } else if (nOutOfM != -1) {

          int n = 0;

          for (String tokenKey : parentToken.getChildren().keySet()) {
            TokenEntity concurrentToken = parentToken.getChildren().get(tokenKey);
            if (this.equals(concurrentToken.getFlowNode())) {
              n++;
            }
          }

          if (n < nOutOfM) {
            reactivateParent = false;
          }

        } else {

          // 验证节点是否全部结束
          reactivateParent = mustParentBeReactivated(parentToken, parentToken.getChildren().keySet());
        }

        // 判断是否需要把父令牌移动到下一个节点
        if (reactivateParent) {

          for (String tokenKey : parentToken.getChildren().keySet()) {
            TokenEntity nowToken = parentToken.getChildren().get(tokenKey);
            nowToken.setAbleToReactivateParent(false);
            nowToken.setEndTime(new Date());
          }

          ExecutionContext parentContext = ProcessObjectFactory.FACTORYINSTANCE.createExecutionContext(parentToken);

          leave(parentContext);
View Full Code Here

    for (String childTokenIdString : childTokenId) {
      if (reactivateParent) {
        String concurrentTokenId = childTokenIdString;

        TokenEntity concurrentToken = parentToken.getChildren().get(concurrentTokenId);

        if (concurrentToken.isAbleToReactivateParent()) {

          reactivateParent = false;
        }
      }
    }
View Full Code Here

    ProcessDefinitionBehavior processDefinition = processDefinitionManager.findLatestProcessDefinitionById(processDefinitionId);

    ProcessInstanceEntity processInstanceImpl = processInstanceManager.findProcessInstanceById(processInstanceId, processDefinition);

    TokenEntity token=processInstanceImpl.getTokenMap().get(tokenId);
   
   
   
    List<String> tokenIdList=new ArrayList<String>();
   
View Full Code Here

    ProcessDefinitionBehavior processDefinition = processDefinitionManager.findLatestProcessDefinitionById(processDefinitionId);

    ProcessInstanceEntity processInstanceImpl = processInstanceManager.findProcessInstanceById(processInstanceId, processDefinition);

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

    ExecutionContext executionContext = ProcessObjectFactory.FACTORYINSTANCE.createExecutionContext(token);
   
   
    UserTaskBehavior userTask = (UserTaskBehavior) processDefinition.getDefinitions().getElement(nodeId);
View Full Code Here

    ProcessDefinitionBehavior processDefinition = processDefinitionManager.findLatestProcessDefinitionById(processDefinitionId);

    ProcessInstanceEntity processInstanceImpl = processInstanceManager.findProcessInstanceById(processInstanceId, processDefinition);

    TokenEntity token=processInstanceImpl.getTokenMap().get(tokenId);
   
   
   
    List<String> tokenIdList=new ArrayList<String>();
   

    addTokenParent(token, tokenIdList);
   
    //获取这个节点关系上之前的所有人工任务(UserTask)
    Map<String,FlowNode> flowNodes=CoreUtil.getBeforeFlowNode(token.getFlowNode());
   
    //获取这个令牌自己和爸爸相关的所有任务

   
    TaskQuery taskQuery=new TaskQueryImpl(Context.getCommandContext());


    List<TaskInstance> taskInstanceQueryToList = new ArrayList<TaskInstance>();


    taskQuery.processInstanceId(processInstanceId);
    taskQuery.taskIsEnd().orderByEndTime().asc().orderByTaskCreateTime().asc();
    taskInstanceQueryToList = taskQuery.list();
   
   
   
    List<String> processInstanceIdList=new ArrayList<String>();
    processInstanceIdList.add(token.getProcessInstanceId());
    taskManager.getTaskStatusByByProcessInstanceIdList(processInstanceIdList);
   
    //List<TaskInstance> taskInstanceQueryToList=(List)taskManager.findTasksByTokenIdList(tokenIdList);
    List<TaskInstance> taskInstanceQueryToListNew=new ArrayList<TaskInstance>();
    //Map<String, TaskInstance> taskMap=new HashMap<String, TaskInstance>();
View Full Code Here

import com.founder.fix.fixflow.core.runtime.ExecutionContext;

public class EndEventBehavior extends EndEventImpl {

  public void enter(ExecutionContext executionContext) {
    TokenEntity token = executionContext.getToken();

    // 把令牌的所在节点设置为当前节点
    token.setFlowNode(this);

    // 设置令牌进入节点的时间
    token.setNodeEnterTime(new Date());

    // 移除执行内容对象的线条关联
    executionContext.setSequenceFlow(null);

    executionContext.setSequenceFlowSource(null);
View Full Code Here

  public void leaveClearData(ExecutionContext executionContext) {

    Map<String, TokenEntity> children=executionContext.getToken().getChildren();;
    
    for (String tokenKey : children.keySet()) {
      TokenEntity child = children.get(tokenKey);
      if (!child.hasEnded()) {
        child.end(false);
      }
    }
   
  }
View Full Code Here

TOP

Related Classes of com.founder.fix.fixflow.core.impl.runtime.TokenEntity

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.