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

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


   */
  public static ProcessInstance start(String processDefinitionKey, String processDefinitionId, Connection connection) {

    System.out.println("=====定时任务启动 " + new Date() + " =====");

    StartProcessInstanceCommand startProcessInstanceCommand = new StartProcessInstanceCommand();
    // 如果是找最新流程启动就用这个
    if (processDefinitionKey != null || processDefinitionId != null) {
      if (processDefinitionKey != null) {
        startProcessInstanceCommand.setProcessDefinitionKey(processDefinitionKey);
      } else {
        startProcessInstanceCommand.setProcessDefinitionId(processDefinitionId);
      }
    } else {
      throw new FixFlowException("processDefinitionKey和processDefinitionId不能都为空!");
    }
   
    //startProcessInstanceCommand.setBusinessKey(businessKey);
    startProcessInstanceCommand.setStartAuthor(Authentication.getAdminId());

    // 瞬态变量
    Map<String, Object> transientVariableMap = new HashMap<String, Object>();
    // 设定瞬态变量
    startProcessInstanceCommand.setTransientVariables(transientVariableMap);

    // 获取流程引擎
    ProcessEngine processEngine = ProcessEngineManagement.getDefaultProcessEngine();
   
   
View Full Code Here


      processId=jobExecutionContext.getJobDetail().getJobDataMap().getString("processUniqueKey");
    }
   
   
   
    StartProcessInstanceCommand startProcessInstanceCommand = new StartProcessInstanceCommand();
    startProcessInstanceCommand.setProcessDefinitionId(processId);
    startProcessInstanceCommand.setStartAuthor(Authentication.getAdminId());
    startProcessInstanceCommand.setNodeId(nodeId);

    Map<String, Object> transientVariableMap = new HashMap<String, Object>();

    startProcessInstanceCommand.setTransientVariables(transientVariableMap);
   
    RuntimeService runtimeService = processEngine.getRuntimeService();
   
    runtimeService.timeStartProcessInstance(startProcessInstanceCommand);
View Full Code Here

     
      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

      }
      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);

      // 任务第一步提交完还需找到一个待办事宜再执行掉才算真正完成
View Full Code Here

   * 测试手工启动流程
   */
  @Deployment(resources = { "com/founder/fix/fixflow/test/engine/api/runtime/StartProcessInstanceTest.bpmn" })
  public void testNoneStartProcessInstance(){
    //创建一个启动命令
    StartProcessInstanceCommand startProcessInstanceCommand = new StartProcessInstanceCommand();
    //设置需要启动的流程的KEY
    startProcessInstanceCommand.setProcessDefinitionKey("Process_StartProcessInstanceTest");
    //设置业务关联键
    startProcessInstanceCommand.setBusinessKey("bk_StartProcessInstanceTest");
    //设置流程的启动人
    startProcessInstanceCommand.setStartAuthor("1200119390");
    //启动流程,返回流程实例
    ProcessInstance processInstance = runtimeService.noneStartProcessInstance(startProcessInstanceCommand);
    //验证流程是否启动成功
    assertNotNull(processInstance);
  }
View Full Code Here

   * 测试删除流程实例
   */
  @Deployment(resources = { "com/founder/fix/fixflow/test/engine/api/runtime/StartProcessInstanceTest.bpmn" })
  public void testDeleteProcessInstance(){
    //创建一个启动命令
    StartProcessInstanceCommand startProcessInstanceCommand = new StartProcessInstanceCommand();
    //设置需要启动的流程的KEY
    startProcessInstanceCommand.setProcessDefinitionKey("Process_StartProcessInstanceTest");
    //设置业务关联键
    startProcessInstanceCommand.setBusinessKey("bk_StartProcessInstanceTest");
    //设置流程的启动人
    startProcessInstanceCommand.setStartAuthor("1200119390");
    //启动流程,返回流程实例
    ProcessInstance processInstance = runtimeService.noneStartProcessInstance(startProcessInstanceCommand);
    //验证流程是否启动成功
    assertNotNull(processInstance);
   
View Full Code Here

      //抛出FixFlowException异常
      assertTrue(ex instanceof FixFlowException);
    }
   
    //创建一个启动命令
    StartProcessInstanceCommand startProcessInstanceCommand = new StartProcessInstanceCommand();
    //设置需要启动的流程的KEY
    startProcessInstanceCommand.setProcessDefinitionKey("Process_StartProcessInstanceTest");
    //设置业务关联键
    startProcessInstanceCommand.setBusinessKey("bk_StartProcessInstanceTest");
    //设置流程的启动人
    startProcessInstanceCommand.setStartAuthor("1200119390");
    //启动流程,返回流程实例
    ProcessInstance processInstance = runtimeService.noneStartProcessInstance(startProcessInstanceCommand);
    //验证流程是否启动成功
    assertNotNull(processInstance);
   
View Full Code Here

   * 测试更新流程关联键,----此方法暂未实现
   */
  @Deployment(resources = { "com/founder/fix/fixflow/test/engine/api/runtime/StartProcessInstanceTest.bpmn" })
  public void testUpdateProcessInstanceBusinessKey(){
    //创建一个启动命令
    StartProcessInstanceCommand startProcessInstanceCommand = new StartProcessInstanceCommand();
    //设置需要启动的流程的KEY
    startProcessInstanceCommand.setProcessDefinitionKey("Process_StartProcessInstanceTest");
    //设置业务关联键
    startProcessInstanceCommand.setBusinessKey("bk_StartProcessInstanceTest");
    //设置流程的启动人
    startProcessInstanceCommand.setStartAuthor("1200119390");
    //启动流程,返回流程实例
    ProcessInstance processInstance = runtimeService.noneStartProcessInstance(startProcessInstanceCommand);
    //验证流程是否启动成功
    assertNotNull(processInstance);
   
View Full Code Here

    transientVariables.put("连接器跳过策略条件", false);
    transientVariables.put("测试变量", "我是测试变量");
    transientVariables.put("输出变量", "");

    // 设置流程实例参数
    StartProcessInstanceCommand startProcessInstanceCommand = new StartProcessInstanceCommand();
    // 设置流程ID
    startProcessInstanceCommand.setProcessDefinitionKey("ConnectorTest");
    // 设置流程业务关联键
    startProcessInstanceCommand.setBusinessKey("1234567890");
    // 设置启动提交人
    startProcessInstanceCommand.setStartAuthor("1200119390");
    // 设置数据变量
    startProcessInstanceCommand.setTransientVariables(transientVariables);

    // 启动流程,只启动流程 ,流程停在第一步
    ProcessInstance processInstanceQueryTo = runtimeService.noneStartProcessInstance(startProcessInstanceCommand);
    String processInstanceId = processInstanceQueryTo.getId();
    // 验证是否成功启动
View Full Code Here

   * 测试增加流程实例持久化变量
   */
  @Deployment(resources = { "com/founder/fix/fixflow/test/engine/api/runtime/StartProcessInstanceTest.bpmn" })
  public void testSetAndGetProcessInstanceVariable(){
    //创建一个启动命令
    StartProcessInstanceCommand startProcessInstanceCommand = new StartProcessInstanceCommand();
    //设置需要启动的流程的KEY
    startProcessInstanceCommand.setProcessDefinitionKey("Process_StartProcessInstanceTest");
    //设置业务关联键
    startProcessInstanceCommand.setBusinessKey("bk_StartProcessInstanceTest");
    //设置流程的启动人
    startProcessInstanceCommand.setStartAuthor("1200119390");
    //启动流程,返回流程实例
    ProcessInstance processInstance = runtimeService.noneStartProcessInstance(startProcessInstanceCommand);
    //验证流程是否启动成功
    assertNotNull(processInstance);
   
View Full Code Here

TOP

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

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.