<?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="safetychange" name="组织保护措施状态变更申请流程" isExecutable="true">
    <startEvent id="startevent1" name="Start"></startEvent>
    <userTask id="applytask" name="申请人提交申请" activiti:assignee="#{applyuser}"></userTask>
    <sequenceFlow id="flow1" sourceRef="startevent1" targetRef="applytask"></sequenceFlow>
    <userTask id="safaertask1" name="安全评估人1" activiti:candidateUsers="#{safaer}">
      <extensionElements>
        <activiti:taskListener event="create" delegateExpression="${changeNextTaskListener}"></activiti:taskListener>
      </extensionElements>
    </userTask>
    <sequenceFlow id="flow2" name="提交" sourceRef="applytask" targetRef="safaertask1">
      <conditionExpression xsi:type="tFormalExpression"><![CDATA[${condition == 1}]]></conditionExpression>
    </sequenceFlow>
    <sequenceFlow id="flow3" name="驳回" sourceRef="safaertask1" targetRef="applytask">
      <extensionElements>
        <activiti:executionListener event="take" delegateExpression="${changeFlowListener}"></activiti:executionListener>
      </extensionElements>
      <conditionExpression xsi:type="tFormalExpression"><![CDATA[${condition == 2}]]></conditionExpression>
    </sequenceFlow>
    <userTask id="approvertask" name="批准人" activiti:candidateUsers="#{approver}">
      <extensionElements>
        <activiti:taskListener event="create" delegateExpression="${changeNextTaskListener}"></activiti:taskListener>
      </extensionElements>
    </userTask>
    <sequenceFlow id="flow4" name="通过" sourceRef="safaertask1" targetRef="approvertask">
      <conditionExpression xsi:type="tFormalExpression"><![CDATA[${condition == 1}]]></conditionExpression>
    </sequenceFlow>
    <sequenceFlow id="flow5" name="驳回" sourceRef="approvertask" targetRef="safaertask1">
      <conditionExpression xsi:type="tFormalExpression"><![CDATA[${condition == 2}]]></conditionExpression>
    </sequenceFlow>
    <endEvent id="endevent1" name="End">
      <extensionElements>
        <activiti:executionListener event="end" delegateExpression="${changeEndFailListener}"></activiti:executionListener>
      </extensionElements>
    </endEvent>
    <sequenceFlow id="flow6" name="拒绝" sourceRef="safaertask1" targetRef="endevent1">
      <conditionExpression xsi:type="tFormalExpression"><![CDATA[${condition == 0}]]></conditionExpression>
    </sequenceFlow>
    <sequenceFlow id="flow7" name="拒绝" sourceRef="approvertask" targetRef="endevent1">
      <conditionExpression xsi:type="tFormalExpression"><![CDATA[${condition == 0}]]></conditionExpression>
    </sequenceFlow>
    <userTask id="executortask" name="措施执行人" activiti:assignee="#{executor}">
      <extensionElements>
        <activiti:taskListener event="create" delegateExpression="${changeMgrListener}"></activiti:taskListener>
      </extensionElements>
    </userTask>
    <userTask id="confirmertask" name="措施确认人" activiti:candidateUsers="#{confirmer}">
      <extensionElements>
        <activiti:taskListener event="create" delegateExpression="${changeNextTaskListener}"></activiti:taskListener>
      </extensionElements>
    </userTask>
    <userTask id="changetask" name="变更执行人" activiti:candidateUsers="#{changeExecutor}">
      <extensionElements>
        <activiti:taskListener event="create" delegateExpression="${changeNextTaskListener}"></activiti:taskListener>
      </extensionElements>
    </userTask>
    <userTask id="safaertask2" name="安全评估人2" activiti:candidateUsers="#{safaer}">
      <extensionElements>
        <activiti:taskListener event="create" delegateExpression="${changeNextTaskListener}"></activiti:taskListener>
      </extensionElements>
    </userTask>
    <userTask id="resetConfirmer1" name="确认人1" activiti:candidateUsers="#{resetConfirmer1}">
      <extensionElements>
        <activiti:taskListener event="create" delegateExpression="${changeNextTaskListener}"></activiti:taskListener>
      </extensionElements>
    </userTask>
    <userTask id="resetConfirmer2" name="确认人2" activiti:candidateUsers="#{resetConfirmer2}">
      <extensionElements>
        <activiti:taskListener event="create" delegateExpression="${changeNextTaskListener}"></activiti:taskListener>
      </extensionElements>
    </userTask>
    <endEvent id="endevent2" name="End">
      <extensionElements>
        <activiti:executionListener event="end" delegateExpression="${changeEndSuccessListener}"></activiti:executionListener>
      </extensionElements>
    </endEvent>
    <sequenceFlow id="flow8" name="通过" sourceRef="approvertask" targetRef="executortask">
      <conditionExpression xsi:type="tFormalExpression"><![CDATA[${condition == 1}]]></conditionExpression>
    </sequenceFlow>
    <sequenceFlow id="flow9" name="通过" sourceRef="executortask" targetRef="confirmertask">
      <conditionExpression xsi:type="tFormalExpression"><![CDATA[${condition == 1}]]></conditionExpression>
    </sequenceFlow>
    <sequenceFlow id="flow10" name="通过" sourceRef="confirmertask" targetRef="changetask">
      <conditionExpression xsi:type="tFormalExpression"><![CDATA[${condition == 1}]]></conditionExpression>
    </sequenceFlow>
    <sequenceFlow id="flow11" name="通过" sourceRef="changetask" targetRef="safaertask2">
      <conditionExpression xsi:type="tFormalExpression"><![CDATA[${condition == 1}]]></conditionExpression>
    </sequenceFlow>
    <sequenceFlow id="flow12" name="通过" sourceRef="safaertask2" targetRef="resetConfirmer1">
      <conditionExpression xsi:type="tFormalExpression"><![CDATA[${condition == 1}]]></conditionExpression>
    </sequenceFlow>
    <sequenceFlow id="flow13" name="通过" sourceRef="resetConfirmer1" targetRef="resetConfirmer2">
      <conditionExpression xsi:type="tFormalExpression"><![CDATA[${condition == 1}]]></conditionExpression>
    </sequenceFlow>
    <sequenceFlow id="flow14" name="通过" sourceRef="resetConfirmer2" targetRef="endevent2">
      <conditionExpression xsi:type="tFormalExpression"><![CDATA[${condition == 1}]]></conditionExpression>
    </sequenceFlow>
  </process>
  <bpmndi:BPMNDiagram id="BPMNDiagram_safetychange">
    <bpmndi:BPMNPlane bpmnElement="safetychange" id="BPMNPlane_safetychange">
      <bpmndi:BPMNShape bpmnElement="startevent1" id="BPMNShape_startevent1">
        <omgdc:Bounds height="35.0" width="35.0" x="420.0" y="60.0"></omgdc:Bounds>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape bpmnElement="applytask" id="BPMNShape_applytask">
        <omgdc:Bounds height="55.0" width="105.0" x="385.0" y="120.0"></omgdc:Bounds>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape bpmnElement="safaertask1" id="BPMNShape_safaertask1">
        <omgdc:Bounds height="55.0" width="105.0" x="385.0" y="220.0"></omgdc:Bounds>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape bpmnElement="approvertask" id="BPMNShape_approvertask">
        <omgdc:Bounds height="55.0" width="105.0" x="385.0" y="330.0"></omgdc:Bounds>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape bpmnElement="endevent1" id="BPMNShape_endevent1">
        <omgdc:Bounds height="35.0" width="35.0" x="610.0" y="340.0"></omgdc:Bounds>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape bpmnElement="executortask" id="BPMNShape_executortask">
        <omgdc:Bounds height="55.0" width="105.0" x="385.0" y="440.0"></omgdc:Bounds>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape bpmnElement="confirmertask" id="BPMNShape_confirmertask">
        <omgdc:Bounds height="55.0" width="105.0" x="550.0" y="440.0"></omgdc:Bounds>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape bpmnElement="changetask" id="BPMNShape_changetask">
        <omgdc:Bounds height="55.0" width="105.0" x="720.0" y="440.0"></omgdc:Bounds>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape bpmnElement="safaertask2" id="BPMNShape_safaertask2">
        <omgdc:Bounds height="55.0" width="105.0" x="720.0" y="570.0"></omgdc:Bounds>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape bpmnElement="resetConfirmer1" id="BPMNShape_resetConfirmer1">
        <omgdc:Bounds height="55.0" width="105.0" x="550.0" y="570.0"></omgdc:Bounds>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape bpmnElement="resetConfirmer2" id="BPMNShape_resetConfirmer2">
        <omgdc:Bounds height="55.0" width="105.0" x="385.0" y="570.0"></omgdc:Bounds>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape bpmnElement="endevent2" id="BPMNShape_endevent2">
        <omgdc:Bounds height="35.0" width="35.0" x="420.0" y="670.0"></omgdc:Bounds>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNEdge bpmnElement="flow1" id="BPMNEdge_flow1">
        <omgdi:waypoint x="437.0" y="95.0"></omgdi:waypoint>
        <omgdi:waypoint x="437.0" y="120.0"></omgdi:waypoint>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge bpmnElement="flow2" id="BPMNEdge_flow2">
        <omgdi:waypoint x="437.0" y="175.0"></omgdi:waypoint>
        <omgdi:waypoint x="437.0" y="220.0"></omgdi:waypoint>
        <bpmndi:BPMNLabel>
          <omgdc:Bounds height="14.0" width="24.0" x="437.0" y="175.0"></omgdc:Bounds>
        </bpmndi:BPMNLabel>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge bpmnElement="flow3" id="BPMNEdge_flow3">
        <omgdi:waypoint x="385.0" y="247.0"></omgdi:waypoint>
        <omgdi:waypoint x="293.0" y="247.0"></omgdi:waypoint>
        <omgdi:waypoint x="293.0" y="198.0"></omgdi:waypoint>
        <omgdi:waypoint x="293.0" y="147.0"></omgdi:waypoint>
        <omgdi:waypoint x="385.0" y="147.0"></omgdi:waypoint>
        <bpmndi:BPMNLabel>
          <omgdc:Bounds height="14.0" width="24.0" x="301.0" y="189.0"></omgdc:Bounds>
        </bpmndi:BPMNLabel>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge bpmnElement="flow4" id="BPMNEdge_flow4">
        <omgdi:waypoint x="437.0" y="275.0"></omgdi:waypoint>
        <omgdi:waypoint x="437.0" y="330.0"></omgdi:waypoint>
        <bpmndi:BPMNLabel>
          <omgdc:Bounds height="14.0" width="24.0" x="437.0" y="275.0"></omgdc:Bounds>
        </bpmndi:BPMNLabel>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge bpmnElement="flow5" id="BPMNEdge_flow5">
        <omgdi:waypoint x="385.0" y="357.0"></omgdi:waypoint>
        <omgdi:waypoint x="298.0" y="357.0"></omgdi:waypoint>
        <omgdi:waypoint x="298.0" y="247.0"></omgdi:waypoint>
        <omgdi:waypoint x="385.0" y="247.0"></omgdi:waypoint>
        <bpmndi:BPMNLabel>
          <omgdc:Bounds height="14.0" width="24.0" x="301.0" y="289.0"></omgdc:Bounds>
        </bpmndi:BPMNLabel>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge bpmnElement="flow6" id="BPMNEdge_flow6">
        <omgdi:waypoint x="490.0" y="247.0"></omgdi:waypoint>
        <omgdi:waypoint x="627.0" y="247.0"></omgdi:waypoint>
        <omgdi:waypoint x="627.0" y="340.0"></omgdi:waypoint>
        <bpmndi:BPMNLabel>
          <omgdc:Bounds height="14.0" width="24.0" x="490.0" y="247.0"></omgdc:Bounds>
        </bpmndi:BPMNLabel>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge bpmnElement="flow7" id="BPMNEdge_flow7">
        <omgdi:waypoint x="490.0" y="357.0"></omgdi:waypoint>
        <omgdi:waypoint x="610.0" y="357.0"></omgdi:waypoint>
        <bpmndi:BPMNLabel>
          <omgdc:Bounds height="14.0" width="24.0" x="490.0" y="357.0"></omgdc:Bounds>
        </bpmndi:BPMNLabel>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge bpmnElement="flow8" id="BPMNEdge_flow8">
        <omgdi:waypoint x="437.0" y="385.0"></omgdi:waypoint>
        <omgdi:waypoint x="437.0" y="440.0"></omgdi:waypoint>
        <bpmndi:BPMNLabel>
          <omgdc:Bounds height="14.0" width="24.0" x="437.0" y="385.0"></omgdc:Bounds>
        </bpmndi:BPMNLabel>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge bpmnElement="flow9" id="BPMNEdge_flow9">
        <omgdi:waypoint x="490.0" y="467.0"></omgdi:waypoint>
        <omgdi:waypoint x="550.0" y="467.0"></omgdi:waypoint>
        <bpmndi:BPMNLabel>
          <omgdc:Bounds height="14.0" width="24.0" x="490.0" y="467.0"></omgdc:Bounds>
        </bpmndi:BPMNLabel>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge bpmnElement="flow10" id="BPMNEdge_flow10">
        <omgdi:waypoint x="655.0" y="467.0"></omgdi:waypoint>
        <omgdi:waypoint x="720.0" y="467.0"></omgdi:waypoint>
        <bpmndi:BPMNLabel>
          <omgdc:Bounds height="14.0" width="24.0" x="655.0" y="467.0"></omgdc:Bounds>
        </bpmndi:BPMNLabel>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge bpmnElement="flow11" id="BPMNEdge_flow11">
        <omgdi:waypoint x="772.0" y="495.0"></omgdi:waypoint>
        <omgdi:waypoint x="772.0" y="570.0"></omgdi:waypoint>
        <bpmndi:BPMNLabel>
          <omgdc:Bounds height="14.0" width="24.0" x="772.0" y="495.0"></omgdc:Bounds>
        </bpmndi:BPMNLabel>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge bpmnElement="flow12" id="BPMNEdge_flow12">
        <omgdi:waypoint x="720.0" y="597.0"></omgdi:waypoint>
        <omgdi:waypoint x="655.0" y="597.0"></omgdi:waypoint>
        <bpmndi:BPMNLabel>
          <omgdc:Bounds height="14.0" width="24.0" x="681.0" y="597.0"></omgdc:Bounds>
        </bpmndi:BPMNLabel>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge bpmnElement="flow13" id="BPMNEdge_flow13">
        <omgdi:waypoint x="550.0" y="597.0"></omgdi:waypoint>
        <omgdi:waypoint x="490.0" y="597.0"></omgdi:waypoint>
        <bpmndi:BPMNLabel>
          <omgdc:Bounds height="14.0" width="24.0" x="512.0" y="597.0"></omgdc:Bounds>
        </bpmndi:BPMNLabel>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge bpmnElement="flow14" id="BPMNEdge_flow14">
        <omgdi:waypoint x="437.0" y="625.0"></omgdi:waypoint>
        <omgdi:waypoint x="437.0" y="670.0"></omgdi:waypoint>
        <bpmndi:BPMNLabel>
          <omgdc:Bounds height="14.0" width="24.0" x="437.0" y="625.0"></omgdc:Bounds>
        </bpmndi:BPMNLabel>
      </bpmndi:BPMNEdge>
    </bpmndi:BPMNPlane>
  </bpmndi:BPMNDiagram>
</definitions>
