Package com.founder.fix.fixflow.core

Examples of com.founder.fix.fixflow.core.RuntimeService


    String userId = StringUtil.getString(params.get("userId"));
    String processInstanceId = StringUtil.getString(params.get("operProcessInstanceId"));
    String[] pids = processInstanceId.split(",");
    ProcessEngine engine = getTransactionProcessEngine(userId);
    try{
      RuntimeService runtimeService = engine.getRuntimeService();
      for(String tmp:pids){
        runtimeService.terminatProcessInstance(tmp);
      }
    }finally{
      closeProcessEngine();
    }
  }
View Full Code Here


    String userId = StringUtil.getString(params.get("userId"));
    String processInstanceId = StringUtil.getString(params.get("operProcessInstanceId"));
    String[] pids = processInstanceId.split(",");
    ProcessEngine engine = getTransactionProcessEngine(userId);
    try{
      RuntimeService runtimeService = engine.getRuntimeService();
      for(String tmp:pids){
        runtimeService.deleteProcessInstance(tmp,true);
      }
    }finally{
      closeProcessEngine();
    }
  }
View Full Code Here

      EventSubscriptionType eventSubscriptionType=flowMessage.getMessageType();
      String nodeId=flowMessage.getTargetNode();
      String tokenId=flowMessage.getTokenId();
      Map<String,Object> dataVariableMap=flowMessage.getDataVariableMap();
     
      RuntimeService runtimeService=processEngine.getRuntimeService();
     
      if(eventSubscriptionType==EventSubscriptionType.MessageStartEvent){
        MessageStartProcessInstanceCommand messageStartProcessInstanceCommand=new MessageStartProcessInstanceCommand();
        messageStartProcessInstanceCommand.setProcessDefinitionId(processDefinitionId);
        messageStartProcessInstanceCommand.setNodeId(nodeId);
        messageStartProcessInstanceCommand.setMessageId(messageId);
        //messageStartProcessInstanceCommand.setBusinessKey(businessKey)
        messageStartProcessInstanceCommand.setTransientVariables(dataVariableMap);
       
       
        //runtimeService.startProcessInstanceByMessage(messageStartProcessInstanceCommand);
        debugLog.debug("流程:" +processDefinitionId+" 接收到消息 "+messageId+" 开始启动!");
      }
      else{
        if(eventSubscriptionType==EventSubscriptionType.MessageToken){
          runtimeService.tokenSignal(tokenId, dataVariableMap);
          debugLog.debug("流程:" +processDefinitionId+" 接收到消息 "+messageId+" 开始驱动令牌!");
        }
      }
     
     
View Full Code Here

 
  public Object performGroovyExpression(String expression){

    ProcessEngine processEngine=ProcessEngineManagement.getDefaultProcessEngine();
    //processEngine.setExternalContent(externalContent);
    RuntimeService runtimeService=processEngine.getRuntimeService();
   
    return runtimeService.executeRuleScript(expression);

   
   
  }
View Full Code Here

        throw new FixFlowException("processDefinitionKey 不能为空!");
      }
     
     
      ProcessEngine processEngine =ProcessEngineManagement.getDefaultProcessEngine();
      RuntimeService runtimeService = processEngine.getRuntimeService();
      // runtimeService.getCommandExecutor().setConnection(dbgr.getConnection());

      StartProcessInstanceCommand startProcessInstanceCommand = new StartProcessInstanceCommand();
      startProcessInstanceCommand.setProcessDefinitionKey(processDefinitionKey);
      startProcessInstanceCommand.setBusinessKey(businessKey);
      startProcessInstanceCommand.setStartAuthor(Authentication.getAuthenticatedUserId());
      startProcessInstanceCommand.setInitiator(Authentication.getAuthenticatedUserId());
      startProcessInstanceCommand.setTransientVariables(transientVariables);
      // startProcessInstanceCommand.setVariables(Variables);
      ProcessInstance processInstanceQueryTo = runtimeService
          .noneStartProcessInstance(startProcessInstanceCommand);
     
     
     
View Full Code Here

  public Void execute(CommandContext commandContext) {
    // TODO 自动生成的方法存根

    TaskService taskService = ProcessEngineManagement.getDefaultProcessEngine().getTaskService();

    RuntimeService runtimeService = ProcessEngineManagement.getDefaultProcessEngine().getRuntimeService();

    // 初始化任务命令执行所需要的常用对象
    loadProcessParameter(commandContext);

    // 将外部变量注册到流程实例运行环境中
    addVariable();

    // 执行处理命令中的开发人员设置的表达式
    runCommandExpression();

    // 获取正在操作的任务实例对象
    TaskInstanceEntity taskInstanceTemp = getTaskInstanceEntity();

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

    ProcessInstanceEntity processInstanceImpl = getProcessInstance();

    String userId = null;

    if (StringUtil.isEmpty(admin)) {
      if (StringUtil.isEmpty(agent)) {
        userId = Authentication.getAuthenticatedUserId();
      } else {
        userId = agent;
      }

    }

    List<TaskInstance> endTaskInstances = null;
    if (userId == null) {
      endTaskInstances = taskService.createTaskQuery().processInstanceId(taskInstanceTemp.getProcessInstanceId()).taskIsEnd().nodeId(recoverNodeId)
          .list();

    } else {
      endTaskInstances = taskService.createTaskQuery().processInstanceId(taskInstanceTemp.getProcessInstanceId()).taskAssignee(userId).taskIsEnd()
          .nodeId(recoverNodeId).list();

    }

    TaskInstance recoverToTask = endTaskInstances.get(0);

    String tokenId = recoverToTask.getTokenId();
    Token recoverToToken = runtimeService.createTokenQuery().tokenId(tokenId).singleResult();
    if (recoverToToken.getEndTime() == null) {

   

 
View Full Code Here

   
   

   
    ProcessEngine processEngine =ProcessEngineManagement.getDefaultProcessEngine();
    RuntimeService runtimeService = processEngine.getRuntimeService();
    // runtimeService.getCommandExecutor().setConnection(dbgr.getConnection());
    TaskService taskService = processEngine.getTaskService();
    if(this.taskId!=null&&!this.taskId.equals("")){
      //TaskInstance taskInstance=commandContext.getTaskManager().findTaskById(this.taskId);
      ExpandTaskCommand expandTaskCommand=new ExpandTaskCommand();
      expandTaskCommand.setCommandType("submit");
      expandTaskCommand.setTaskComment(this.taskComment);
      expandTaskCommand.setTaskId(this.taskId);
      expandTaskCommand.setUserCommandId(this.userCommandId);
      expandTaskCommand.setTransientVariables(transientVariables);
      expandTaskCommand.setBusinessKey(businessKey);
      expandTaskCommand.setInitiator(initiator);
      if(this.agent!=null&&!this.agent.equals("")){
        expandTaskCommand.setAgent(this.agent);
      }
      taskService.expandTaskComplete(expandTaskCommand, null);
      return null;
     
    }else{
      StartProcessInstanceCommand startProcessInstanceCommand = new StartProcessInstanceCommand();
      startProcessInstanceCommand.setProcessDefinitionKey(processDefinitionKey);
      startProcessInstanceCommand.setBusinessKey(businessKey);
      startProcessInstanceCommand.setStartAuthor(initiator);
      startProcessInstanceCommand.setTransientVariables(transientVariables);
      // startProcessInstanceCommand.setVariables(Variables);
      ProcessInstance processInstanceQueryTo = runtimeService
          .noneStartProcessInstance(startProcessInstanceCommand);

      // 任务第一步提交完还需找到一个待办事宜再执行掉才算真正完成
      String processInstanceId = processInstanceQueryTo.getId();
View Full Code Here

TOP

Related Classes of com.founder.fix.fixflow.core.RuntimeService

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.