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

Examples of com.founder.fix.fixflow.core.impl.command.ExpandTaskCommand


    if(tmpParams instanceof Map)
      taskParams = (Map<String,Object>)tmpParams;
    else
      taskParams = new HashMap<String,Object>();
   
    ExpandTaskCommand expandTaskCommand = new ExpandTaskCommand();
   

    //命令类型,可以从流程引擎配置中查询   启动并提交为startandsubmit
    expandTaskCommand.setCommandType(commandType);
    //设置提交人
    expandTaskCommand.setInitiator(userId);
    //设置命令的id,需和节点上配置的按钮编号对应,会执行按钮中的脚本。
    expandTaskCommand.setUserCommandId(commandId);
    expandTaskCommand.setTaskComment(taskComment);
    if(StringUtil.isNotEmpty(taskId)){
      expandTaskCommand.setTaskId(taskId);
    }else{
      expandTaskCommand.setProcessDefinitionKey(processDefinitionKey);
      //设置流程的业务关联键
      expandTaskCommand.setBusinessKey(businessKey);
    }
    expandTaskCommand.setParamMap(taskParams);

    ProcessEngine engine = getProcessEngine(userId);
    ProcessInstance processInstance = null;
    try{
      processInstance = (ProcessInstance)engine.getTaskService().expandTaskComplete(expandTaskCommand, null);
View Full Code Here


  private ProcessEngine getProcessEngine(){
    return ProcessEngineManagement.getDefaultProcessEngine();
  }
 
  public void complete(String taskId, String taskComment, Map<String, Object> transientVariables) {
    ExpandTaskCommand expandTaskCommandClaim=new ExpandTaskCommand();
    expandTaskCommandClaim.setCommandType("general");
    expandTaskCommandClaim.setTaskId(taskId);
    expandTaskCommandClaim.setTaskComment(taskComment);
    expandTaskCommandClaim.setAdmin(Authentication.getAuthenticatedUserId());
    expandTaskCommandClaim.setTransientVariables(transientVariables);
   
    getProcessEngine().getTaskService().expandTaskComplete(expandTaskCommandClaim, null);
  }
View Full Code Here

   
    getProcessEngine().getTaskService().expandTaskComplete(expandTaskCommandClaim, null);
  }

  public void claim(String taskId) {
    ExpandTaskCommand expandTaskCommandClaim=new ExpandTaskCommand();
    expandTaskCommandClaim.setCommandType("claim");
    expandTaskCommandClaim.setTaskId(taskId);
    expandTaskCommandClaim.setAdmin(Authentication.getAuthenticatedUserId());
    getProcessEngine().getTaskService().expandTaskComplete(expandTaskCommandClaim, null);
  }
View Full Code Here

    expandTaskCommandClaim.setAdmin(Authentication.getAuthenticatedUserId());
    getProcessEngine().getTaskService().expandTaskComplete(expandTaskCommandClaim, null);
  }

  public void claim(String taskId, String claimUserId) {
    ExpandTaskCommand expandTaskCommandClaim=new ExpandTaskCommand();
    expandTaskCommandClaim.setCommandType("claim");
    expandTaskCommandClaim.setTaskId(taskId);
    expandTaskCommandClaim.setAdmin(Authentication.getAuthenticatedUserId());
    getProcessEngine().getTaskService().expandTaskComplete(expandTaskCommandClaim, null);   
  }
View Full Code Here

    expandTaskCommandClaim.setAdmin(Authentication.getAuthenticatedUserId());
    getProcessEngine().getTaskService().expandTaskComplete(expandTaskCommandClaim, null);   
  }

  public void release(String taskId) {
    ExpandTaskCommand expandTaskCommandClaim=new ExpandTaskCommand();
    expandTaskCommandClaim.setCommandType("releaseTask");
    expandTaskCommandClaim.setTaskId(taskId);
    expandTaskCommandClaim.setAdmin(Authentication.getAuthenticatedUserId());
    getProcessEngine().getTaskService().expandTaskComplete(expandTaskCommandClaim, null);
  }
View Full Code Here

    expandTaskCommandClaim.setAdmin(Authentication.getAuthenticatedUserId());
    getProcessEngine().getTaskService().expandTaskComplete(expandTaskCommandClaim, null);
  }

  public void transfer(String taskId, String transferUserId, String taskComment, Map<String, Object> transientVariables) {
    ExpandTaskCommand expandTaskCommand=new ExpandTaskCommand();
    expandTaskCommand.setCommandType("transfer");
    expandTaskCommand.setTaskId(taskId);
    expandTaskCommand.setAdmin(Authentication.getAuthenticatedUserId());
    Map<String, Object> paramMap=new HashMap<String, Object>();
    paramMap.put("transferUserId", transferUserId);
    expandTaskCommand.setParamMap(paramMap);
    getProcessEngine().getTaskService().expandTaskComplete(expandTaskCommand, null);
  }
View Full Code Here

    expandTaskCommand.setParamMap(paramMap);
    getProcessEngine().getTaskService().expandTaskComplete(expandTaskCommand, null);
  }

  public void rollBack(String taskId, String rollBackNodeId, String taskComment, Map<String, Object> transientVariables) {
    ExpandTaskCommand expandTaskCommand=new ExpandTaskCommand();
    expandTaskCommand.setCommandType("rollBack");
    expandTaskCommand.setTaskId(taskId);
    expandTaskCommand.setAdmin(Authentication.getAuthenticatedUserId());
    Map<String, Object> paramMap=new HashMap<String, Object>();
    paramMap.put("rollBackNodeId", rollBackNodeId);
    expandTaskCommand.setParamMap(paramMap);
    getProcessEngine().getTaskService().expandTaskComplete(expandTaskCommand, null);
  }
View Full Code Here

    expandTaskCommand.setParamMap(paramMap);
    getProcessEngine().getTaskService().expandTaskComplete(expandTaskCommand, null);
  }
 
  public void rollBackByTaskId(String taskId, String rollBackTaskId, String taskComment, Map<String, Object> transientVariables) {
    ExpandTaskCommand expandTaskCommand=new ExpandTaskCommand();
    expandTaskCommand.setCommandType("rollBackTaskByTaskId");
    expandTaskCommand.setTaskId(taskId);
    expandTaskCommand.setAdmin(Authentication.getAuthenticatedUserId());
    Map<String, Object> paramMap=new HashMap<String, Object>();
    paramMap.put("rollBackTaskId", rollBackTaskId);
    expandTaskCommand.setParamMap(paramMap);
    getProcessEngine().getTaskService().expandTaskComplete(expandTaskCommand, null);
  }
View Full Code Here

   */
  @Deployment(resources = { "com/founder/fix/fixflow/test/engine/api/runtime/ProcessVariablesTest.bpmn"})
  public void testProcessInstanceVariableData(){
    for(int i = 0;i<5;i++){
      //创建一个通用命令
      ExpandTaskCommand expandTaskCommand = new ExpandTaskCommand();
      //设置流程名
      expandTaskCommand.setProcessDefinitionKey("ProcessVariablesTest");
      //设置流程的业务关联键
      expandTaskCommand.setBusinessKey("BK_testStartProcessInstanceByKey");
      //命令类型,可以从流程引擎配置中查询   启动并提交为startandsubmit
      expandTaskCommand.setCommandType("startandsubmit");
      //设置提交人
      expandTaskCommand.setInitiator("1200119390");
      //设置命令的id,需和节点上配置的按钮编号对应,会执行按钮中的脚本。
      expandTaskCommand.setUserCommandId("HandleCommand_2");
      //执行这个启动并提交的命令,返回启动的流程实例
      ProcessInstance processInstance = (ProcessInstance)taskService.expandTaskComplete(expandTaskCommand, null);
      String processInstanceId = processInstance.getId();
      //验证是否成功启动
      assertNotNull(processInstanceId);
View Full Code Here

    transientVariables.put("输出项", "");// 进行任务处理命令后存的值
    transientVariables.put("输出数据集", new ArrayList<String>());// 多实例运行完毕后存放的List
    //跳过策略变量
    transientVariables.put("跳过策略条件", false);//后面给boolean值就可以
    // 创建一个启动并提交命令
    ExpandTaskCommand expandTaskCommand = new ExpandTaskCommand();
    // 设置流程名
    expandTaskCommand.setProcessDefinitionKey("UserTaskTest");
    // 设置流程的业务关联键
    expandTaskCommand.setBusinessKey("1234567890");
    // 命令类型,可以从流程引擎配置中查询 启动并提交为startandsubmit
    expandTaskCommand.setCommandType("startandsubmit");
    // 设置提交人
    expandTaskCommand.setInitiator("1200119390");
    // 设置命令的id,需和节点上配置的按钮编号对应,会执行按钮中的脚本。
    expandTaskCommand.setUserCommandId("HandleCommand_2");
    //设置数据变量
    expandTaskCommand.setTransientVariables(transientVariables);

    // 执行这个启动并提交的命令,返回启动的流程实例
    ProcessInstance processInstance = (ProcessInstance) taskService.expandTaskComplete(expandTaskCommand, null);
    //拿到流程实例ID
    String processInstanceId = processInstance.getId();
    // 验证是否成功启动
    assertNotNull(processInstanceId);

    TaskQuery taskQuery = taskService.createTaskQuery();
    // 查找 1200119390 的这个流程实例的当前独占任务
    List<TaskInstance> taskInstances = taskQuery.taskAssignee("1200119390").processInstanceId(processInstanceId).taskNotEnd().list();

    // 是否已经分成两个任务,多实例
    assertEquals(3, taskInstances.size());

    // 循环执行多实例
    for (int i = 0; i < taskInstances.size(); i++) {
      // 创建一个同意命令
      expandTaskCommand = new ExpandTaskCommand();
      // 设置流程名
      expandTaskCommand.setProcessDefinitionKey("UserTaskTest");
      // 设置流程的业务关联键
      expandTaskCommand.setBusinessKey("1234567890");
      // 命令类型,可以从流程引擎配置中查询 启动并提交为通用
      expandTaskCommand.setCommandType("general");
      // 设置命令的id,需和节点上配置的按钮编号对应,会执行按钮中的脚本。
      expandTaskCommand.setUserCommandId("HandleCommand_2");// 不同意是HandleCommand_3
      // 设置任务ID
      expandTaskCommand.setTaskId(taskInstances.get(i).getId());
      // 执行处理命令
      taskService.expandTaskComplete(expandTaskCommand, null);

      if (i == 0) {
        // 第一次循环结束,输出项被赋值同意并且输出数据集里面有一个数据
View Full Code Here

TOP

Related Classes of com.founder.fix.fixflow.core.impl.command.ExpandTaskCommand

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.