activiti运行流程管理

 //启动流程
        //startProcessInstanceById 流程定义主键
        ProcessInstance processDefinitionId1 = runtimeService.startProcessInstanceById("processDefinitionId");
        ProcessInstance processDefinitionId2 = runtimeService.startProcessInstanceById("processDefinitionId", "businessKey");
        ProcessInstance processDefinitionId3 = runtimeService.startProcessInstanceById("processDefinitionId", "businessKey", new HashMap<>());
        //startProcessInstanceByKey 获取流程定义的名称,名称唯一
        ProcessInstance processInstance1 = runtimeService.startProcessInstanceByKey("processDefinitionKey");
        ProcessInstance processInstance2 = runtimeService.startProcessInstanceByKey("processDefinitionKey", "businessKey");
        ProcessInstance processInstance3 = runtimeService.startProcessInstanceByKey("processDefinitionKey", "businessKey", new HashMap<>());
        ProcessInstance processInstance4 = runtimeService.startProcessInstanceByKey("processDefinitionKey", new HashMap<>());
        //startProcessInstanceByMessage 消息事件
        ProcessInstance messageName1 = runtimeService.startProcessInstanceByMessage("messageName");
        ProcessInstance messageName2 = runtimeService.startProcessInstanceByMessage("messageName", "businessKey");
        ProcessInstance messageName3 = runtimeService.startProcessInstanceByMessage("messageName", new HashMap<>());
        //设置参数
        runtimeService.setVariable("executionId", "name", "");
        Object variable = runtimeService.getVariable("executionId", "name");
        //taskService 参数只作用于当前任务节点
        //runtimeService 则作用于当前流程
        taskService.createTaskQuery().processInstanceId("");
        //signalEventDefinition 触发信号事件
        runtimeService.signalEventReceived("testSignal");
        runtimeService.signalEventReceived("testSignal", new HashMap<>());
        //messageEvent触发消息事件
        runtimeService.messageEventReceived("testMessage", "executionId");
        runtimeService.messageEventReceived("testMessage", "executionId", new HashMap<>());
        //中断流程
        runtimeService.suspendProcessInstanceById("processInstanceId");
        //激活流程
        runtimeService.activateProcessInstanceById("processInstanceId");
        //删除流程
        runtimeService.deleteProcessInstance("processInstanceId", "删除原因");

上一篇:【Aactiviti7 从入门到放弃】(一)Activiti7工作流引擎入门


下一篇:acvitivi7 整合springboot