Commit 3c2bd6ad by 王厚康

bpm

parent 97a4129a
package com.bbd.bpm.controller;
import org.activiti.engine.RepositoryService;
import org.activiti.engine.RuntimeService;
import org.activiti.engine.TaskService;
import org.activiti.engine.repository.Deployment;
import org.activiti.engine.repository.ProcessDefinition;
import org.activiti.engine.runtime.ProcessInstance;
import org.activiti.engine.task.Task;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* Created by houkang on 2019/1/15.
*/
@RestController
@RequestMapping("/demo")
public class DemoController {
@Autowired
private RepositoryService repositoryService;
@Autowired
private RuntimeService runtimeService;
@Autowired
private TaskService taskService;
@RequestMapping("/firstDemo")
public void firstDemo() {
//根据bpmn文件部署流程
Deployment deployment = repositoryService.createDeployment().addClasspathResource("processes/bpm_one.bpmn").deploy();
//获取流程定义
ProcessDefinition processDefinition = repositoryService.createProcessDefinitionQuery().deploymentId(deployment.getId()).singleResult();
//启动流程定义,返回流程实例
ProcessInstance pi = runtimeService.startProcessInstanceByKey(processDefinition.getKey(), "1111bussinessKey1111");
String processId = pi.getId();
System.out.println("流程创建成功,当前流程实例ID:" + processId);
Task task = taskService.createTaskQuery().processInstanceId(processId).singleResult();
System.out.println("第一次执行前,任务名称:" + task.getName());
taskService.complete(task.getId());
//2 通过任务对象获取流程实例
ProcessInstance pit = runtimeService.createProcessInstanceQuery().processInstanceId(task.getProcessInstanceId()).singleResult();
//3 通过流程实例获取“业务键”
String businessKey = pit.getBusinessKey();
System.out.println("Businesskey:" + businessKey);
task = taskService.createTaskQuery().processInstanceId(processId).singleResult();
System.out.println("第二次执行前,任务名称:" + task.getName());
taskService.complete(task.getId());
task = taskService.createTaskQuery().processInstanceId(processId).singleResult();
System.out.println("task为null,任务执行完毕:" + task);
}
@RequestMapping("/twoDemo")
public void twoDemo() {
//根据bpmn文件部署流程
Deployment deployment = repositoryService.createDeployment().addClasspathResource("processes/bpm_one.bpmn").deploy();
//获取流程定义
ProcessDefinition processDefinition = repositoryService.createProcessDefinitionQuery().deploymentId(deployment.getId()).singleResult();
//启动流程定义,返回流程实例
Map<String, Object> variables = new HashMap<String, Object>();
variables.put("user","wang");
ProcessInstance pi = runtimeService.startProcessInstanceByKey(processDefinition.getKey(), "1111bussinessKey1111",variables);
String processId = pi.getId();
System.out.println("流程创建成功,当前流程实例ID:" + processId);
}
@RequestMapping("/threeDemo")
public void threeDemo() {
List<Task> taskList = taskService.createTaskQuery().taskAssignee("wang").list();
if(taskList != null){
for(Task t: taskList){
System.out.println(t.getName()+t.getId());
Map<String, Object> variables = new HashMap<String, Object>();
variables.put("user","houkang");
taskService.complete(t.getId(),variables);
}
}
}
@RequestMapping("/fourDemo")
public void fourDemo() {
List<Task> taskList = taskService.createTaskQuery().taskAssignee("houkang").list();
if(taskList != null){
for(Task t: taskList){
// t.
System.out.println(t.getName());
Map<String, Object> variables = new HashMap<String, Object>();
taskService.complete(t.getId(),variables);
}
}
}
}
package com.bbd.bpm.controller;
import org.activiti.engine.RepositoryService;
import org.activiti.engine.RuntimeService;
import org.activiti.engine.TaskService;
import org.activiti.engine.repository.Deployment;
import org.activiti.engine.repository.ProcessDefinition;
import org.activiti.engine.runtime.ProcessInstance;
import org.activiti.engine.task.Task;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* Created by houkang on 2019/1/28.
*/
@RestController
@RequestMapping("/bpm/task")
public class ProcessTaskController {
@Autowired
private RepositoryService repositoryService;
@Autowired
private RuntimeService runtimeService;
@Autowired
private TaskService taskService;
//启动工作流 并执行到下一节点
@GetMapping("/beginTask")
public void beginTask(String bussinessKey,String job) {
//根据bpmn文件部署流程
Deployment deployment = repositoryService.createDeployment().addClasspathResource("processes/bpm_two.bpmn").deploy();
//获取流程定义
ProcessDefinition processDefinition = repositoryService.createProcessDefinitionQuery().deploymentId(deployment.getId()).singleResult();
//启动流程定义,返回流程实例
Map<String, Object> variables = new HashMap<String, Object>();
variables.put("user","yuagong1");
ProcessInstance pi = runtimeService.startProcessInstanceByKey(processDefinition.getKey(), bussinessKey,variables);
String processId = pi.getId();
System.out.println("流程创建成功,当前流程实例ID:" + processId);
//完成并执行到下一节点
Task task = taskService.createTaskQuery().processInstanceId(processId).singleResult();
System.out.println("第一次执行前,任务名称:" + task.getName());
Map<String, Object> assMap = new HashMap<String, Object>();
assMap.put("job",job);
taskService.complete(task.getId(),assMap);
System.out.println("执行结束");
}
//完成工作
@GetMapping("/processTask")
public void processTask(String taskId) {
Task task = taskService.createTaskQuery().taskId(taskId).singleResult();
if(task==null){
System.out.println("任务不存在");
return;
}
Map<String, Object> variables = new HashMap<String, Object>();
taskService.complete(taskId,variables);
}
}
package com.bbd.bpm.controller;
import io.swagger.annotations.Api;
import org.activiti.engine.HistoryService;
import org.activiti.engine.RuntimeService;
import org.activiti.engine.TaskService;
import org.activiti.engine.history.HistoricActivityInstance;
import org.activiti.engine.history.HistoricTaskInstance;
import org.activiti.engine.runtime.ProcessInstance;
import org.activiti.engine.task.Task;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
/**
* Created by houkang on 2019/1/28.
*/
@RestController
@RequestMapping(value = "/bpm/userTask", produces = MediaType.APPLICATION_JSON_VALUE)
@Api(tags = {"task Controller"})
public class UserTaskController {
@Autowired
private TaskService taskService;
@Autowired
private HistoryService historyService;
@Autowired
private RuntimeService runtimeService;
//查询未处理的任务
@GetMapping(value = "/queryUserTaskByAss")
public void queryUserTaskByAss(String assignee){
//任务办理人
List<Task> taskList = taskService.createTaskQuery().taskAssignee(assignee).list();
String processInstanceId = null;
if(taskList!=null && taskList.size()>0){
for(Task task:taskList){
System.out.println("任务ID:"+task.getId());
System.out.println("任务的办理人:"+task.getAssignee());
System.out.println("任务名称:"+task.getName());
System.out.println("任务的创建时间:"+task.getCreateTime());
System.out.println("流程实例ID:"+task.getProcessInstanceId());
System.out.println("#######################################");
processInstanceId = task.getProcessInstanceId();
}
}
//打印审批过程
List<HistoricActivityInstance> list=historyService.createHistoricActivityInstanceQuery() // 创建历史活动实例查询
.processInstanceId(processInstanceId) // 指定流程实例id
.finished() // 查询已经完成的任务
.list();
for(HistoricActivityInstance hai:list){
System.out.println("任务ID:"+hai.getId());
System.out.println("流程实例ID:"+hai.getProcessInstanceId());
System.out.println("活动名称:"+hai.getActivityName());
System.out.println("办理人:"+hai.getAssignee());
System.out.println("开始时间:"+hai.getStartTime());
System.out.println("结束时间:"+hai.getEndTime());
System.out.println("===========================");
}
}
@GetMapping(value = "/queryHistoryTask")
public void historyActInstanceList(String assignee){
List<HistoricTaskInstance> list = historyService.createHistoricTaskInstanceQuery().taskAssignee(assignee).list();
for(HistoricTaskInstance histask:list){
System.out.println("任务ID:"+histask.getId());
System.out.println("任务的办理人:"+histask.getAssignee());
System.out.println("任务名称:"+histask.getName());
System.out.println("任务的创建时间:"+histask.getCreateTime());
System.out.println("任务办理时间:"+histask.getEndTime());
System.out.println("流程实例ID:"+histask.getProcessInstanceId());
System.out.println("#######################################");
}
}
/**
* 查询流程状态看是否结束
*/
@GetMapping(value = "/checkOver")
public void queryProcess(String processInstanceId ){
ProcessInstance singleResult = runtimeService.createProcessInstanceQuery().processInstanceId(processInstanceId).singleResult();
if(singleResult!=null){
System.out.println(singleResult.getId());
}
else{
System.out.println("已结束");
}
}
}
package com.bbd.bpm.listener;
import org.activiti.engine.ProcessEngine;
import org.activiti.engine.ProcessEngines;
import org.activiti.engine.TaskService;
import org.activiti.engine.delegate.DelegateTask;
import org.activiti.engine.delegate.TaskListener;
import java.io.Serializable;
/**
* Created by houkang on 2019/1/28.
*/
public class PutAssigneeListener implements Serializable, TaskListener {
// private String job;
@Override
public void notify(DelegateTask delegateTask) {
ProcessEngine processEngine = ProcessEngines.getDefaultProcessEngine();
TaskService taskService = processEngine.getTaskService();
//System.out.println("========================= "+job+" =============");
// if(job!=null){
// if("jingli".equals(job)){
// delegateTask.setAssignee("wang");
// }else if("emp".equals(job)){
// delegateTask.setAssignee("houkang");
// }
// }else{
taskService.setAssignee(delegateTask.getId(),"hr");
// }
}
//
}
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<definitions xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:activiti="http://activiti.org/bpmn" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:omgdc="http://www.omg.org/spec/DD/20100524/DC" xmlns:omgdi="http://www.omg.org/spec/DD/20100524/DI" xmlns:tns="http://www.activiti.org/test" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" expressionLanguage="http://www.w3.org/1999/XPath" id="m1547536024823" name="" targetNamespace="http://www.activiti.org/test" typeLanguage="http://www.w3.org/2001/XMLSchema">
<process id="one" isClosed="false" isExecutable="true" processType="None">
<startEvent id="_2" name="StartEvent"/>
<userTask activiti:assignee="${user}" activiti:exclusive="true" id="_3" name="yuangong">
<documentation id="_3_D_1"><![CDATA[jingli]]></documentation>
</userTask>
<userTask activiti:assignee="${user}" activiti:exclusive="true" id="_4" name="jingli11"/>
<sequenceFlow id="_5" sourceRef="_2" targetRef="_3"/>
<sequenceFlow id="_6" sourceRef="_3" targetRef="_4"/>
<endEvent id="_7" name="EndEvent"/>
<sequenceFlow id="_8" sourceRef="_4" targetRef="_7"/>
</process>
<bpmndi:BPMNDiagram documentation="background=#FFFFFF;count=1;horizontalcount=1;orientation=0;width=842.4;height=1195.2;imageableWidth=832.4;imageableHeight=1185.2;imageableX=5.0;imageableY=5.0" id="Diagram-_1" name="New Diagram">
<bpmndi:BPMNPlane bpmnElement="one">
<bpmndi:BPMNShape bpmnElement="_2" id="Shape-_2">
<omgdc:Bounds height="32.0" width="32.0" x="170.0" y="105.0"/>
<bpmndi:BPMNLabel>
<omgdc:Bounds height="32.0" width="32.0" x="0.0" y="0.0"/>
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="_3" id="Shape-_3">
<omgdc:Bounds height="55.0" width="85.0" x="295.0" y="90.0"/>
<bpmndi:BPMNLabel>
<omgdc:Bounds height="55.0" width="85.0" x="0.0" y="0.0"/>
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="_4" id="Shape-_4">
<omgdc:Bounds height="55.0" width="85.0" x="475.0" y="85.0"/>
<bpmndi:BPMNLabel>
<omgdc:Bounds height="55.0" width="85.0" x="0.0" y="0.0"/>
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="_7" id="Shape-_7">
<omgdc:Bounds height="32.0" width="32.0" x="655.0" y="105.0"/>
<bpmndi:BPMNLabel>
<omgdc:Bounds height="32.0" width="32.0" x="0.0" y="0.0"/>
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge bpmnElement="_5" id="BPMNEdge__5" sourceElement="_2" targetElement="_3">
<omgdi:waypoint x="202.0" y="121.0"/>
<omgdi:waypoint x="295.0" y="117.5"/>
<bpmndi:BPMNLabel>
<omgdc:Bounds height="0.0" width="0.0" x="0.0" y="0.0"/>
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="_6" id="BPMNEdge__6" sourceElement="_3" targetElement="_4">
<omgdi:waypoint x="380.0" y="117.5"/>
<omgdi:waypoint x="475.0" y="112.5"/>
<bpmndi:BPMNLabel>
<omgdc:Bounds height="0.0" width="0.0" x="0.0" y="0.0"/>
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="_8" id="BPMNEdge__8" sourceElement="_4" targetElement="_7">
<omgdi:waypoint x="560.0" y="112.5"/>
<omgdi:waypoint x="655.0" y="121.0"/>
<bpmndi:BPMNLabel>
<omgdc:Bounds height="0.0" width="0.0" x="0.0" y="0.0"/>
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
</bpmndi:BPMNPlane>
</bpmndi:BPMNDiagram>
</definitions>
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<definitions xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:activiti="http://activiti.org/bpmn" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:omgdc="http://www.omg.org/spec/DD/20100524/DC" xmlns:omgdi="http://www.omg.org/spec/DD/20100524/DI" xmlns:tns="http://www.activiti.org/test" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" expressionLanguage="http://www.w3.org/1999/XPath" id="m1548728340566" name="" targetNamespace="http://www.activiti.org/test" typeLanguage="http://www.w3.org/2001/XMLSchema">
<process id="myProcess_1" isClosed="false" isExecutable="true" processType="None">
<startEvent id="_2" name="StartEvent"/>
<userTask activiti:assignee="${user}" activiti:exclusive="true" id="_3" name="yuangong"/>
<userTask activiti:exclusive="true" id="_4" name="jingli">
<extensionElements>
<activiti:taskListener class="com.bbd.bpm.listener.PutAssigneeListener" event="all"/>
</extensionElements>
</userTask>
<endEvent id="_5" name="EndEvent"/>
<sequenceFlow id="_6" sourceRef="_2" targetRef="_3"/>
<sequenceFlow id="_7" sourceRef="_3" targetRef="_4"/>
<sequenceFlow id="_8" sourceRef="_4" targetRef="_5"/>
</process>
<bpmndi:BPMNDiagram documentation="background=#FFFFFF;count=1;horizontalcount=1;orientation=0;width=842.4;height=1195.2;imageableWidth=832.4;imageableHeight=1185.2;imageableX=5.0;imageableY=5.0" id="Diagram-_1" name="New Diagram">
<bpmndi:BPMNPlane bpmnElement="myProcess_1">
<bpmndi:BPMNShape bpmnElement="_2" id="Shape-_2">
<omgdc:Bounds height="32.0" width="32.0" x="80.0" y="170.0"/>
<bpmndi:BPMNLabel>
<omgdc:Bounds height="32.0" width="32.0" x="0.0" y="0.0"/>
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="_3" id="Shape-_3">
<omgdc:Bounds height="55.0" width="85.0" x="185.0" y="160.0"/>
<bpmndi:BPMNLabel>
<omgdc:Bounds height="55.0" width="85.0" x="0.0" y="0.0"/>
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="_4" id="Shape-_4">
<omgdc:Bounds height="55.0" width="85.0" x="330.0" y="155.0"/>
<bpmndi:BPMNLabel>
<omgdc:Bounds height="55.0" width="85.0" x="0.0" y="0.0"/>
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="_5" id="Shape-_5">
<omgdc:Bounds height="32.0" width="32.0" x="480.0" y="170.0"/>
<bpmndi:BPMNLabel>
<omgdc:Bounds height="32.0" width="32.0" x="0.0" y="0.0"/>
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge bpmnElement="_6" id="BPMNEdge__6" sourceElement="_2" targetElement="_3">
<omgdi:waypoint x="112.0" y="186.0"/>
<omgdi:waypoint x="185.0" y="187.5"/>
<bpmndi:BPMNLabel>
<omgdc:Bounds height="0.0" width="0.0" x="0.0" y="0.0"/>
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="_7" id="BPMNEdge__7" sourceElement="_3" targetElement="_4">
<omgdi:waypoint x="270.0" y="187.5"/>
<omgdi:waypoint x="330.0" y="182.5"/>
<bpmndi:BPMNLabel>
<omgdc:Bounds height="0.0" width="0.0" x="0.0" y="0.0"/>
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="_8" id="BPMNEdge__8" sourceElement="_4" targetElement="_5">
<omgdi:waypoint x="415.0" y="182.5"/>
<omgdi:waypoint x="480.0" y="186.0"/>
<bpmndi:BPMNLabel>
<omgdc:Bounds height="0.0" width="0.0" x="0.0" y="0.0"/>
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
</bpmndi:BPMNPlane>
</bpmndi:BPMNDiagram>
</definitions>
<?xml version="1.0" encoding="UTF-8"?>
<definitions xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:activiti="http://activiti.org/bpmn" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:omgdc="http://www.omg.org/spec/DD/20100524/DC" xmlns:omgdi="http://www.omg.org/spec/DD/20100524/DI" typeLanguage="http://www.w3.org/2001/XMLSchema" expressionLanguage="http://www.w3.org/1999/XPath" targetNamespace="http://www.activiti.org/test">
<process id="second_approve" name="二级审批流程" isExecutable="true">
<startEvent id="startEvent" name="开始"></startEvent>
<userTask id="submitForm" name="填写审批信息">
<extensionElements>
<activiti:formProperty id="message" name="申请信息" type="string" required="true"></activiti:formProperty>
<activiti:formProperty id="name" name="申请人名称" type="string" required="true"></activiti:formProperty>
<activiti:formProperty id="submitTime" name="提交时间" type="date" datePattern="yyyy-MM-dd" required="true"></activiti:formProperty>
<activiti:formProperty id="submitType" name="确认申请" type="string" required="true"></activiti:formProperty>
</extensionElements>
</userTask>
<sequenceFlow id="flow1" sourceRef="startEvent" targetRef="submitForm"></sequenceFlow>
<exclusiveGateway id="decideSubmit" name="提交OR取消"></exclusiveGateway>
<userTask id="tl_approve" name="主管审批">
<extensionElements>
<activiti:formProperty id="tlApprove" name="主管审批结果" type="string" required="true"></activiti:formProperty>
<activiti:formProperty id="tlMessage" name="主管备注" type="string" required="true"></activiti:formProperty>
</extensionElements>
</userTask>
<exclusiveGateway id="decideTLApprove" name="主管审批校验"></exclusiveGateway>
<sequenceFlow id="flow4" sourceRef="tl_approve" targetRef="decideTLApprove"></sequenceFlow>
<userTask id="hr_approve" name="人事审批">
<extensionElements>
<activiti:formProperty id="hrApprove" name="人事审批结果" type="string" required="true"></activiti:formProperty>
<activiti:formProperty id="hrMessage" name="人事备注" type="string" required="true"></activiti:formProperty>
</extensionElements>
</userTask>
<exclusiveGateway id="decideHRApprove" name="人事审批校验"></exclusiveGateway>
<sequenceFlow id="flow6" sourceRef="hr_approve" targetRef="decideHRApprove"></sequenceFlow>
<endEvent id="EndEvent" name="结束"></endEvent>
<sequenceFlow id="flow7" sourceRef="decideHRApprove" targetRef="EndEvent">
<conditionExpression xsi:type="tFormalExpression"><![CDATA[${hrApprove=="y" || hrApprove=="Y"}]]></conditionExpression>
</sequenceFlow>
<endEvent id="endEventCancel" name="取消"></endEvent>
<sequenceFlow id="flow10" sourceRef="decideHRApprove" targetRef="submitForm">
<conditionExpression xsi:type="tFormalExpression"><![CDATA[${hrApprove=="n" || hrApprove=="N"}]]></conditionExpression>
</sequenceFlow>
<sequenceFlow id="flow11" sourceRef="decideSubmit" targetRef="endEventCancel">
<conditionExpression xsi:type="tFormalExpression"><![CDATA[${submitType=="n" || submitType=="n"}]]></conditionExpression>
</sequenceFlow>
<sequenceFlow id="flow12" sourceRef="decideSubmit" targetRef="tl_approve">
<conditionExpression xsi:type="tFormalExpression"><![CDATA[${submitType=="y" || submitType=="Y"}]]></conditionExpression>
</sequenceFlow>
<sequenceFlow id="flow13" sourceRef="submitForm" targetRef="decideSubmit"></sequenceFlow>
<sequenceFlow id="flow14" sourceRef="decideTLApprove" targetRef="submitForm">
<conditionExpression xsi:type="tFormalExpression"><![CDATA[${tlApprove=="n" || tlApprove=="N"}]]></conditionExpression>
</sequenceFlow>
<sequenceFlow id="flow15" sourceRef="decideTLApprove" targetRef="hr_approve">
<conditionExpression xsi:type="tFormalExpression"><![CDATA[${tlApprove=="y" || tlApprove=="Y"}]]></conditionExpression>
</sequenceFlow>
</process>
<bpmndi:BPMNDiagram id="BPMNDiagram_second_approve">
<bpmndi:BPMNPlane bpmnElement="second_approve" id="BPMNPlane_second_approve">
<bpmndi:BPMNShape bpmnElement="startEvent" id="BPMNShape_startEvent">
<omgdc:Bounds height="35.0" width="35.0" x="40.0" y="170.0"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="submitForm" id="BPMNShape_submitForm">
<omgdc:Bounds height="55.0" width="105.0" x="120.0" y="160.0"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="decideSubmit" id="BPMNShape_decideSubmit">
<omgdc:Bounds height="40.0" width="40.0" x="270.0" y="168.0"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="tl_approve" id="BPMNShape_tl_approve">
<omgdc:Bounds height="55.0" width="105.0" x="355.0" y="161.0"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="decideTLApprove" id="BPMNShape_decideTLApprove">
<omgdc:Bounds height="40.0" width="40.0" x="505.0" y="169.0"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="hr_approve" id="BPMNShape_hr_approve">
<omgdc:Bounds height="55.0" width="105.0" x="590.0" y="162.0"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="decideHRApprove" id="BPMNShape_decideHRApprove">
<omgdc:Bounds height="40.0" width="40.0" x="740.0" y="170.0"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="EndEvent" id="BPMNShape_EndEvent">
<omgdc:Bounds height="35.0" width="35.0" x="825.0" y="173.0"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="endEventCancel" id="BPMNShape_endEventCancel">
<omgdc:Bounds height="35.0" width="35.0" x="390.0" y="240.0"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge bpmnElement="flow1" id="BPMNEdge_flow1">
<omgdi:waypoint x="75.0" y="187.0"></omgdi:waypoint>
<omgdi:waypoint x="120.0" y="187.0"></omgdi:waypoint>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="flow4" id="BPMNEdge_flow4">
<omgdi:waypoint x="460.0" y="188.0"></omgdi:waypoint>
<omgdi:waypoint x="505.0" y="189.0"></omgdi:waypoint>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="flow6" id="BPMNEdge_flow6">
<omgdi:waypoint x="695.0" y="189.0"></omgdi:waypoint>
<omgdi:waypoint x="740.0" y="190.0"></omgdi:waypoint>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="flow7" id="BPMNEdge_flow7">
<omgdi:waypoint x="780.0" y="190.0"></omgdi:waypoint>
<omgdi:waypoint x="825.0" y="190.0"></omgdi:waypoint>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="flow10" id="BPMNEdge_flow10">
<omgdi:waypoint x="780.0" y="190.0"></omgdi:waypoint>
<omgdi:waypoint x="760.0" y="170.0"></omgdi:waypoint>
<omgdi:waypoint x="758.0" y="98.0"></omgdi:waypoint>
<omgdi:waypoint x="480.0" y="99.0"></omgdi:waypoint>
<omgdi:waypoint x="328.0" y="98.0"></omgdi:waypoint>
<omgdi:waypoint x="172.0" y="98.0"></omgdi:waypoint>
<omgdi:waypoint x="172.0" y="160.0"></omgdi:waypoint>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="flow11" id="BPMNEdge_flow11">
<omgdi:waypoint x="290.0" y="208.0"></omgdi:waypoint>
<omgdi:waypoint x="290.0" y="257.0"></omgdi:waypoint>
<omgdi:waypoint x="390.0" y="257.0"></omgdi:waypoint>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="flow12" id="BPMNEdge_flow12">
<omgdi:waypoint x="310.0" y="188.0"></omgdi:waypoint>
<omgdi:waypoint x="355.0" y="188.0"></omgdi:waypoint>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="flow13" id="BPMNEdge_flow13">
<omgdi:waypoint x="225.0" y="187.0"></omgdi:waypoint>
<omgdi:waypoint x="270.0" y="188.0"></omgdi:waypoint>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="flow14" id="BPMNEdge_flow14">
<omgdi:waypoint x="525.0" y="209.0"></omgdi:waypoint>
<omgdi:waypoint x="524.0" y="290.0"></omgdi:waypoint>
<omgdi:waypoint x="356.0" y="291.0"></omgdi:waypoint>
<omgdi:waypoint x="172.0" y="290.0"></omgdi:waypoint>
<omgdi:waypoint x="172.0" y="215.0"></omgdi:waypoint>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="flow15" id="BPMNEdge_flow15">
<omgdi:waypoint x="545.0" y="189.0"></omgdi:waypoint>
<omgdi:waypoint x="590.0" y="189.0"></omgdi:waypoint>
</bpmndi:BPMNEdge>
</bpmndi:BPMNPlane>
</bpmndi:BPMNDiagram>
</definitions>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<definitions xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:activiti="http://activiti.org/bpmn" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:omgdc="http://www.omg.org/spec/DD/20100524/DC" xmlns:omgdi="http://www.omg.org/spec/DD/20100524/DI" typeLanguage="http://www.w3.org/2001/XMLSchema" expressionLanguage="http://www.w3.org/1999/XPath" targetNamespace="http://www.activiti.org/test">
<process id="second_approve" name="二级审批流程" isExecutable="true">
<startEvent id="startEvent" name="开始"></startEvent>
<userTask id="submitForm" name="填写审批信息">
<extensionElements>
<activiti:formProperty id="message" name="申请信息" type="string" required="true"></activiti:formProperty>
<activiti:formProperty id="name" name="申请人名称" type="string" required="true"></activiti:formProperty>
<activiti:formProperty id="submitTime" name="提交时间" type="date" datePattern="yyyy-MM-dd" required="true"></activiti:formProperty>
<activiti:formProperty id="submitType" name="确认申请" type="string" required="true"></activiti:formProperty>
</extensionElements>
</userTask>
<sequenceFlow id="flow1" sourceRef="startEvent" targetRef="submitForm"></sequenceFlow>
<exclusiveGateway id="decideSubmit" name="提交OR取消"></exclusiveGateway>
<userTask id="tl_approve" name="主管审批">
<extensionElements>
<activiti:formProperty id="tlApprove" name="主管审批结果" type="string" required="true"></activiti:formProperty>
<activiti:formProperty id="tlMessage" name="主管备注" type="string" required="true"></activiti:formProperty>
</extensionElements>
</userTask>
<exclusiveGateway id="decideTLApprove" name="主管审批校验"></exclusiveGateway>
<sequenceFlow id="flow4" sourceRef="tl_approve" targetRef="decideTLApprove"></sequenceFlow>
<userTask id="hr_approve" name="人事审批">
<extensionElements>
<activiti:formProperty id="hrApprove" name="人事审批结果" type="string" required="true"></activiti:formProperty>
<activiti:formProperty id="hrMessage" name="人事备注" type="string" required="true"></activiti:formProperty>
</extensionElements>
</userTask>
<exclusiveGateway id="decideHRApprove" name="人事审批校验"></exclusiveGateway>
<sequenceFlow id="flow6" sourceRef="hr_approve" targetRef="decideHRApprove"></sequenceFlow>
<endEvent id="EndEvent" name="结束"></endEvent>
<sequenceFlow id="flow7" sourceRef="decideHRApprove" targetRef="EndEvent">
<conditionExpression xsi:type="tFormalExpression"><![CDATA[${hrApprove=="y" || hrApprove=="Y"}]]></conditionExpression>
</sequenceFlow>
<endEvent id="endEventCancel" name="取消"></endEvent>
<sequenceFlow id="flow10" sourceRef="decideHRApprove" targetRef="submitForm">
<conditionExpression xsi:type="tFormalExpression"><![CDATA[${hrApprove=="n" || hrApprove=="N"}]]></conditionExpression>
</sequenceFlow>
<sequenceFlow id="flow11" sourceRef="decideSubmit" targetRef="endEventCancel">
<conditionExpression xsi:type="tFormalExpression"><![CDATA[${submitType=="n" || submitType=="N"}]]></conditionExpression>
</sequenceFlow>
<sequenceFlow id="flow12" sourceRef="decideSubmit" targetRef="tl_approve">
<conditionExpression xsi:type="tFormalExpression"><![CDATA[${submitType=="y" || submitType=="Y"}]]></conditionExpression>
</sequenceFlow>
<sequenceFlow id="flow13" sourceRef="submitForm" targetRef="decideSubmit"></sequenceFlow>
<sequenceFlow id="flow14" sourceRef="decideTLApprove" targetRef="submitForm">
<conditionExpression xsi:type="tFormalExpression"><![CDATA[${tlApprove=="n" || tlApprove=="N"}]]></conditionExpression>
</sequenceFlow>
<sequenceFlow id="flow15" sourceRef="decideTLApprove" targetRef="hr_approve">
<conditionExpression xsi:type="tFormalExpression"><![CDATA[${tlApprove=="y" || tlApprove=="Y"}]]></conditionExpression>
</sequenceFlow>
</process>
<bpmndi:BPMNDiagram id="BPMNDiagram_second_approve">
<bpmndi:BPMNPlane bpmnElement="second_approve" id="BPMNPlane_second_approve">
<bpmndi:BPMNShape bpmnElement="startEvent" id="BPMNShape_startEvent">
<omgdc:Bounds height="35.0" width="35.0" x="40.0" y="170.0"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="submitForm" id="BPMNShape_submitForm">
<omgdc:Bounds height="55.0" width="105.0" x="120.0" y="160.0"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="decideSubmit" id="BPMNShape_decideSubmit">
<omgdc:Bounds height="40.0" width="40.0" x="270.0" y="168.0"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="tl_approve" id="BPMNShape_tl_approve">
<omgdc:Bounds height="55.0" width="105.0" x="355.0" y="161.0"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="decideTLApprove" id="BPMNShape_decideTLApprove">
<omgdc:Bounds height="40.0" width="40.0" x="505.0" y="169.0"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="hr_approve" id="BPMNShape_hr_approve">
<omgdc:Bounds height="55.0" width="105.0" x="590.0" y="162.0"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="decideHRApprove" id="BPMNShape_decideHRApprove">
<omgdc:Bounds height="40.0" width="40.0" x="740.0" y="170.0"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="EndEvent" id="BPMNShape_EndEvent">
<omgdc:Bounds height="35.0" width="35.0" x="825.0" y="173.0"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="endEventCancel" id="BPMNShape_endEventCancel">
<omgdc:Bounds height="35.0" width="35.0" x="390.0" y="240.0"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge bpmnElement="flow1" id="BPMNEdge_flow1">
<omgdi:waypoint x="75.0" y="187.0"></omgdi:waypoint>
<omgdi:waypoint x="120.0" y="187.0"></omgdi:waypoint>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="flow4" id="BPMNEdge_flow4">
<omgdi:waypoint x="460.0" y="188.0"></omgdi:waypoint>
<omgdi:waypoint x="505.0" y="189.0"></omgdi:waypoint>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="flow6" id="BPMNEdge_flow6">
<omgdi:waypoint x="695.0" y="189.0"></omgdi:waypoint>
<omgdi:waypoint x="740.0" y="190.0"></omgdi:waypoint>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="flow7" id="BPMNEdge_flow7">
<omgdi:waypoint x="780.0" y="190.0"></omgdi:waypoint>
<omgdi:waypoint x="825.0" y="190.0"></omgdi:waypoint>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="flow10" id="BPMNEdge_flow10">
<omgdi:waypoint x="780.0" y="190.0"></omgdi:waypoint>
<omgdi:waypoint x="760.0" y="170.0"></omgdi:waypoint>
<omgdi:waypoint x="758.0" y="98.0"></omgdi:waypoint>
<omgdi:waypoint x="480.0" y="99.0"></omgdi:waypoint>
<omgdi:waypoint x="328.0" y="98.0"></omgdi:waypoint>
<omgdi:waypoint x="172.0" y="98.0"></omgdi:waypoint>
<omgdi:waypoint x="172.0" y="160.0"></omgdi:waypoint>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="flow11" id="BPMNEdge_flow11">
<omgdi:waypoint x="290.0" y="208.0"></omgdi:waypoint>
<omgdi:waypoint x="290.0" y="257.0"></omgdi:waypoint>
<omgdi:waypoint x="390.0" y="257.0"></omgdi:waypoint>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="flow12" id="BPMNEdge_flow12">
<omgdi:waypoint x="310.0" y="188.0"></omgdi:waypoint>
<omgdi:waypoint x="355.0" y="188.0"></omgdi:waypoint>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="flow13" id="BPMNEdge_flow13">
<omgdi:waypoint x="225.0" y="187.0"></omgdi:waypoint>
<omgdi:waypoint x="270.0" y="188.0"></omgdi:waypoint>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="flow14" id="BPMNEdge_flow14">
<omgdi:waypoint x="525.0" y="209.0"></omgdi:waypoint>
<omgdi:waypoint x="524.0" y="290.0"></omgdi:waypoint>
<omgdi:waypoint x="356.0" y="291.0"></omgdi:waypoint>
<omgdi:waypoint x="172.0" y="290.0"></omgdi:waypoint>
<omgdi:waypoint x="172.0" y="215.0"></omgdi:waypoint>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="flow15" id="BPMNEdge_flow15">
<omgdi:waypoint x="545.0" y="189.0"></omgdi:waypoint>
<omgdi:waypoint x="590.0" y="189.0"></omgdi:waypoint>
</bpmndi:BPMNEdge>
</bpmndi:BPMNPlane>
</bpmndi:BPMNDiagram>
</definitions>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment