Examples of RuntimeService


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.continueProcessInstance(tmp);
      }
    }finally{
      closeProcessEngine();
    }
  }
View Full Code Here

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

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.deleteProcessInstance(tmp,true);
      }
    }finally{
      closeProcessEngine();
    }
  }
View Full Code Here

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

      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

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

 
  public Object performGroovyExpression(String expression){

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

   
   
  }
View Full Code Here

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

        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

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

  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

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

   
   

   
    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

Examples of org.activiti.engine.RuntimeService

public class StartProcess {

  public static void main(String[] args) {
    ProcessEngines.init();   
    ProcessEngine processEngine = ProcessEngines.getProcessEngine(ProcessEngines.NAME_DEFAULT);   
      RuntimeService runtimeService = processEngine.getRuntimeService();
     
      Map<String,Object> variables = new HashMap<String,Object>();
      variables.put("test", "test");
     
      runtimeService.startProcessInstanceByKey("EasyBugFilingProcess", variables)
  }
View Full Code Here

Examples of org.activiti.engine.RuntimeService

public class Bmpn2Img {

  public static void main(String[] args) {
    ProcessEngine processEngine = ProcessEngines.getDefaultProcessEngine();
    RuntimeService runtimeService = processEngine.getRuntimeService();
    RepositoryService repositoryService = processEngine.getRepositoryService();

    TaskService taskService = processEngine.getTaskService();
    ManagementService managementService = processEngine.getManagementService();
    IdentityService identityService = processEngine.getIdentityService();
    HistoryService historyService = processEngine.getHistoryService();
    FormService formService = processEngine.getFormService();

    Map<String, Object> variableMap = new HashMap<String, Object>();
    ProcessInstance instance = runtimeService.startProcessInstanceByKey("MultitaskingProcess", variableMap);

    File f = new File("processInstanceImage.png");
    File f2 = new File("processDefintion.png");
    FileOutputStream fos1 = null;
    FileOutputStream fos2 = null;
    ProcessDefinitionEntity processDefinition = (ProcessDefinitionEntity) ((RepositoryServiceImpl) repositoryService).getDeployedProcessDefinition(instance.getProcessDefinitionId());
    System.out.println("id" + instance.getId());
    List<Execution> executions = runtimeService.createExecutionQuery().processInstanceId(instance.getId()).list();
    List<String> activitiIds = runtimeService.getActiveActivityIds(instance.getId());
    for (String s : activitiIds) {
      System.out.println("s:" + s);
    }

    if (processDefinition != null&& processDefinition.isGraphicalNotationDefined()) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.