<?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:xsd="http://www.w3.org/2001/XMLSchema" 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="offlinevalve" name="安全阀离线/切出申请流程" isExecutable="true">
    <startEvent id="startevent1" name="Start"></startEvent>
    <userTask id="confirmertask1" name="临时措施制定人" activiti:candidateUsers="#{confirmer}">
      <extensionElements>
        <activiti:taskListener event="create" delegateExpression="${nextTaskListener}"></activiti:taskListener>
      </extensionElements>
    </userTask>
    <userTask id="executortask" name="临时措施执行人" activiti:candidateUsers="#{executor}">
      <extensionElements>
        <activiti:taskListener event="create" delegateExpression="${nextTaskListener}"></activiti:taskListener>
      </extensionElements>
    </userTask>
    <sequenceFlow id="flow1" name="通过" sourceRef="confirmertask1" targetRef="executortask">
      <conditionExpression xsi:type="tFormalExpression"><![CDATA[${condition == 1}]]></conditionExpression>
    </sequenceFlow>
    <userTask id="confirmertask2" name="临时措施确认人" activiti:candidateUsers="#{confirmer}">
      <extensionElements>
        <activiti:taskListener event="create" delegateExpression="${nextTaskListener}"></activiti:taskListener>
      </extensionElements>
    </userTask>
    <sequenceFlow id="flow2" name="通过" sourceRef="executortask" targetRef="confirmertask2">
      <conditionExpression xsi:type="tFormalExpression"><![CDATA[${condition == 1}]]></conditionExpression>
    </sequenceFlow>
    <userTask id="approvertask" name="批准人" activiti:candidateUsers="#{approver}">
      <extensionElements>
        <activiti:taskListener event="create" delegateExpression="${nextTaskListener}"></activiti:taskListener>
      </extensionElements>
    </userTask>
    <sequenceFlow id="flow3" name="通过" sourceRef="confirmertask2" targetRef="approvertask">
      <conditionExpression xsi:type="tFormalExpression"><![CDATA[${condition == 1}]]></conditionExpression>
    </sequenceFlow>
    <exclusiveGateway id="isunlock" name="判断是否拆解"></exclusiveGateway>
    <sequenceFlow id="flow4" name="通过" sourceRef="approvertask" targetRef="isunlock">
      <conditionExpression xsi:type="tFormalExpression"><![CDATA[${condition == 1}]]></conditionExpression>
    </sequenceFlow>
    <endEvent id="endevent1" name="End">
      <extensionElements>
        <activiti:executionListener event="end" delegateExpression="${endSuccessListener}"></activiti:executionListener>
      </extensionElements>
    </endEvent>
    <userTask id="infoconfirmertask2" name="确认人" activiti:candidateUsers="#{infoconfirmer}">
      <extensionElements>
        <activiti:taskListener event="create" delegateExpression="${nextTaskListener}"></activiti:taskListener>
      </extensionElements>
    </userTask>
    <sequenceFlow id="flow7" name="否/NA" sourceRef="isunlock" targetRef="infoconfirmertask2">
      <conditionExpression xsi:type="tFormalExpression"><![CDATA[${is_unlock == 0}]]></conditionExpression>
    </sequenceFlow>
    <sequenceFlow id="flow8" name="通过" sourceRef="infoconfirmertask2" targetRef="endevent1">
      <conditionExpression xsi:type="tFormalExpression"><![CDATA[${condition == 1}]]></conditionExpression>
    </sequenceFlow>
    <userTask id="infoconfirmertask" name="信息确认人" activiti:candidateUsers="#{infoconfirmer}">
      <extensionElements>
        <activiti:taskListener event="create" delegateExpression="${nextTaskListener}"></activiti:taskListener>
      </extensionElements>
    </userTask>
    <sequenceFlow id="flow9" name="是" sourceRef="isunlock" targetRef="infoconfirmertask">
      <conditionExpression xsi:type="tFormalExpression"><![CDATA[${is_unlock == 1}]]></conditionExpression>
    </sequenceFlow>
    <userTask id="lockconfirmertask" name="上锁人" activiti:candidateUsers="#{lockConfirmer}">
      <extensionElements>
        <activiti:taskListener event="create" delegateExpression="${nextTaskListener}"></activiti:taskListener>
      </extensionElements>
    </userTask>
    <sequenceFlow id="flow10" name="通过" sourceRef="infoconfirmertask" targetRef="lockconfirmertask">
      <conditionExpression xsi:type="tFormalExpression"><![CDATA[${condition == 1}]]></conditionExpression>
    </sequenceFlow>
    <sequenceFlow id="flow12" name="通过" sourceRef="lockconfirmertask" targetRef="infoconfirmertask2">
      <conditionExpression xsi:type="tFormalExpression"><![CDATA[${condition == 1}]]></conditionExpression>
    </sequenceFlow>
    <userTask id="applytask" name="申请人提交申请" activiti:assignee="#{applyuser}"></userTask>
    <sequenceFlow id="flow13" sourceRef="startevent1" targetRef="applytask"></sequenceFlow>
    <sequenceFlow id="flow14" name="通过" sourceRef="applytask" targetRef="confirmertask1">
      <conditionExpression xsi:type="tFormalExpression"><![CDATA[${condition == 1}]]></conditionExpression>
    </sequenceFlow>
    <sequenceFlow id="toApplyUser" name="驳回" sourceRef="confirmertask1" targetRef="applytask">
      <extensionElements>
        <activiti:executionListener event="take" delegateExpression="${flowListener}"></activiti:executionListener>
      </extensionElements>
      <conditionExpression xsi:type="tFormalExpression"><![CDATA[${condition == 2}]]></conditionExpression>
    </sequenceFlow>
    <sequenceFlow id="toConfirmer" name="驳回" sourceRef="approvertask" targetRef="confirmertask1">
      <extensionElements>
        <activiti:executionListener event="take" delegateExpression="${flowListener}"></activiti:executionListener>
      </extensionElements>
      <conditionExpression xsi:type="tFormalExpression"><![CDATA[${condition == 2}]]></conditionExpression>
    </sequenceFlow>
    <endEvent id="endevent2" name="End">
      <extensionElements>
        <activiti:executionListener event="end" delegateExpression="${endFailListener}"></activiti:executionListener>
      </extensionElements>
    </endEvent>
    <sequenceFlow id="flow17" name="拒绝" sourceRef="approvertask" targetRef="endevent2">
      <conditionExpression xsi:type="tFormalExpression"><![CDATA[${condition == 0}]]></conditionExpression>
    </sequenceFlow>
    <sequenceFlow id="flow18" name="拒绝" sourceRef="confirmertask1" targetRef="endevent2">
      <conditionExpression xsi:type="tFormalExpression"><![CDATA[${condition == 0}]]></conditionExpression>
    </sequenceFlow>
  </process>
  <bpmndi:BPMNDiagram id="BPMNDiagram_offlinevalve">
    <bpmndi:BPMNPlane bpmnElement="offlinevalve" id="BPMNPlane_offlinevalve">
      <bpmndi:BPMNShape bpmnElement="startevent1" id="BPMNShape_startevent1">
        <omgdc:Bounds height="35.0" width="35.0" x="400.0" y="21.0"></omgdc:Bounds>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape bpmnElement="confirmertask1" id="BPMNShape_confirmertask1">
        <omgdc:Bounds height="55.0" width="105.0" x="365.0" y="170.0"></omgdc:Bounds>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape bpmnElement="executortask" id="BPMNShape_executortask">
        <omgdc:Bounds height="55.0" width="105.0" x="365.0" y="260.0"></omgdc:Bounds>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape bpmnElement="confirmertask2" id="BPMNShape_confirmertask2">
        <omgdc:Bounds height="55.0" width="105.0" x="365.0" y="350.0"></omgdc:Bounds>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape bpmnElement="approvertask" id="BPMNShape_approvertask">
        <omgdc:Bounds height="55.0" width="105.0" x="365.0" y="440.0"></omgdc:Bounds>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape bpmnElement="isunlock" id="BPMNShape_isunlock">
        <omgdc:Bounds height="40.0" width="40.0" x="397.0" y="520.0"></omgdc:Bounds>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape bpmnElement="endevent1" id="BPMNShape_endevent1">
        <omgdc:Bounds height="35.0" width="35.0" x="399.0" y="710.0"></omgdc:Bounds>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape bpmnElement="infoconfirmertask2" id="BPMNShape_infoconfirmertask2">
        <omgdc:Bounds height="55.0" width="105.0" x="364.0" y="600.0"></omgdc:Bounds>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape bpmnElement="infoconfirmertask" id="BPMNShape_infoconfirmertask">
        <omgdc:Bounds height="55.0" width="105.0" x="250.0" y="513.0"></omgdc:Bounds>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape bpmnElement="lockconfirmertask" id="BPMNShape_lockconfirmertask">
        <omgdc:Bounds height="55.0" width="105.0" x="110.0" y="513.0"></omgdc:Bounds>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape bpmnElement="applytask" id="BPMNShape_applytask">
        <omgdc:Bounds height="55.0" width="105.0" x="365.0" y="80.0"></omgdc:Bounds>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape bpmnElement="endevent2" id="BPMNShape_endevent2">
        <omgdc:Bounds height="35.0" width="35.0" x="170.0" y="330.0"></omgdc:Bounds>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNEdge bpmnElement="flow1" id="BPMNEdge_flow1">
        <omgdi:waypoint x="417.0" y="225.0"></omgdi:waypoint>
        <omgdi:waypoint x="417.0" y="260.0"></omgdi:waypoint>
        <bpmndi:BPMNLabel>
          <omgdc:Bounds height="14.0" width="24.0" x="417.0" y="225.0"></omgdc:Bounds>
        </bpmndi:BPMNLabel>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge bpmnElement="flow2" id="BPMNEdge_flow2">
        <omgdi:waypoint x="417.0" y="315.0"></omgdi:waypoint>
        <omgdi:waypoint x="417.0" y="350.0"></omgdi:waypoint>
        <bpmndi:BPMNLabel>
          <omgdc:Bounds height="14.0" width="24.0" x="417.0" y="315.0"></omgdc:Bounds>
        </bpmndi:BPMNLabel>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge bpmnElement="flow3" id="BPMNEdge_flow3">
        <omgdi:waypoint x="417.0" y="405.0"></omgdi:waypoint>
        <omgdi:waypoint x="417.0" y="440.0"></omgdi:waypoint>
        <bpmndi:BPMNLabel>
          <omgdc:Bounds height="14.0" width="24.0" x="417.0" y="405.0"></omgdc:Bounds>
        </bpmndi:BPMNLabel>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge bpmnElement="flow4" id="BPMNEdge_flow4">
        <omgdi:waypoint x="417.0" y="495.0"></omgdi:waypoint>
        <omgdi:waypoint x="417.0" y="520.0"></omgdi:waypoint>
        <bpmndi:BPMNLabel>
          <omgdc:Bounds height="14.0" width="24.0" x="417.0" y="495.0"></omgdc:Bounds>
        </bpmndi:BPMNLabel>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge bpmnElement="flow7" id="BPMNEdge_flow7">
        <omgdi:waypoint x="417.0" y="560.0"></omgdi:waypoint>
        <omgdi:waypoint x="416.0" y="600.0"></omgdi:waypoint>
        <bpmndi:BPMNLabel>
          <omgdc:Bounds height="42.0" width="15.0" x="421.0" y="568.0"></omgdc:Bounds>
        </bpmndi:BPMNLabel>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge bpmnElement="flow8" id="BPMNEdge_flow8">
        <omgdi:waypoint x="416.0" y="655.0"></omgdi:waypoint>
        <omgdi:waypoint x="416.0" y="710.0"></omgdi:waypoint>
        <bpmndi:BPMNLabel>
          <omgdc:Bounds height="14.0" width="24.0" x="416.0" y="655.0"></omgdc:Bounds>
        </bpmndi:BPMNLabel>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge bpmnElement="flow9" id="BPMNEdge_flow9">
        <omgdi:waypoint x="397.0" y="540.0"></omgdi:waypoint>
        <omgdi:waypoint x="355.0" y="540.0"></omgdi:waypoint>
        <bpmndi:BPMNLabel>
          <omgdc:Bounds height="14.0" width="12.0" x="368.0" y="547.0"></omgdc:Bounds>
        </bpmndi:BPMNLabel>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge bpmnElement="flow10" id="BPMNEdge_flow10">
        <omgdi:waypoint x="250.0" y="540.0"></omgdi:waypoint>
        <omgdi:waypoint x="215.0" y="540.0"></omgdi:waypoint>
        <bpmndi:BPMNLabel>
          <omgdc:Bounds height="14.0" width="24.0" x="221.0" y="547.0"></omgdc:Bounds>
        </bpmndi:BPMNLabel>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge bpmnElement="flow12" id="BPMNEdge_flow12">
        <omgdi:waypoint x="162.0" y="568.0"></omgdi:waypoint>
        <omgdi:waypoint x="161.0" y="627.0"></omgdi:waypoint>
        <omgdi:waypoint x="364.0" y="627.0"></omgdi:waypoint>
        <bpmndi:BPMNLabel>
          <omgdc:Bounds height="14.0" width="24.0" x="162.0" y="568.0"></omgdc:Bounds>
        </bpmndi:BPMNLabel>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge bpmnElement="flow13" id="BPMNEdge_flow13">
        <omgdi:waypoint x="417.0" y="56.0"></omgdi:waypoint>
        <omgdi:waypoint x="417.0" y="80.0"></omgdi:waypoint>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge bpmnElement="flow14" id="BPMNEdge_flow14">
        <omgdi:waypoint x="417.0" y="135.0"></omgdi:waypoint>
        <omgdi:waypoint x="417.0" y="170.0"></omgdi:waypoint>
        <bpmndi:BPMNLabel>
          <omgdc:Bounds height="14.0" width="24.0" x="417.0" y="135.0"></omgdc:Bounds>
        </bpmndi:BPMNLabel>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge bpmnElement="toApplyUser" id="BPMNEdge_toApplyUser">
        <omgdi:waypoint x="470.0" y="197.0"></omgdi:waypoint>
        <omgdi:waypoint x="538.0" y="197.0"></omgdi:waypoint>
        <omgdi:waypoint x="538.0" y="107.0"></omgdi:waypoint>
        <omgdi:waypoint x="470.0" y="107.0"></omgdi:waypoint>
        <bpmndi:BPMNLabel>
          <omgdc:Bounds height="14.0" width="24.0" x="470.0" y="197.0"></omgdc:Bounds>
        </bpmndi:BPMNLabel>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge bpmnElement="toConfirmer" id="BPMNEdge_toConfirmer">
        <omgdi:waypoint x="470.0" y="467.0"></omgdi:waypoint>
        <omgdi:waypoint x="535.0" y="467.0"></omgdi:waypoint>
        <omgdi:waypoint x="535.0" y="197.0"></omgdi:waypoint>
        <omgdi:waypoint x="470.0" y="197.0"></omgdi:waypoint>
        <bpmndi:BPMNLabel>
          <omgdc:Bounds height="14.0" width="24.0" x="470.0" y="470.0"></omgdc:Bounds>
        </bpmndi:BPMNLabel>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge bpmnElement="flow17" id="BPMNEdge_flow17">
        <omgdi:waypoint x="365.0" y="467.0"></omgdi:waypoint>
        <omgdi:waypoint x="187.0" y="467.0"></omgdi:waypoint>
        <omgdi:waypoint x="187.0" y="365.0"></omgdi:waypoint>
        <bpmndi:BPMNLabel>
          <omgdc:Bounds height="14.0" width="24.0" x="281.0" y="470.0"></omgdc:Bounds>
        </bpmndi:BPMNLabel>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge bpmnElement="flow18" id="BPMNEdge_flow18">
        <omgdi:waypoint x="365.0" y="197.0"></omgdi:waypoint>
        <omgdi:waypoint x="187.0" y="197.0"></omgdi:waypoint>
        <omgdi:waypoint x="187.0" y="330.0"></omgdi:waypoint>
        <bpmndi:BPMNLabel>
          <omgdc:Bounds height="14.0" width="24.0" x="266.0" y="200.0"></omgdc:Bounds>
        </bpmndi:BPMNLabel>
      </bpmndi:BPMNEdge>
    </bpmndi:BPMNPlane>
  </bpmndi:BPMNDiagram>
</definitions>
