<?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="dispatch" name="发文会签" isExecutable="true">
    <documentation>会签</documentation>
    <startEvent id="startevent1" name="Start" activiti:initiator="applyUser">
      <extensionElements>
        <activiti:formProperty id="rate" name="投票比例" type="enum" required="true">
          <activiti:value id="100" name="100%"></activiti:value>
          <activiti:value id="70" name="70%"></activiti:value>
          <activiti:value id="50" name="50%"></activiti:value>
        </activiti:formProperty>
        <activiti:formProperty id="incept" name="发送至" type="string" required="true"></activiti:formProperty>
        <activiti:formProperty id="content" name="发文内容" type="string" required="true"></activiti:formProperty>
        <activiti:formProperty id="countersignUsers" name="会签参与人" type="users" required="true"></activiti:formProperty>
      </extensionElements>
    </startEvent>
    <userTask id="countersign" name="发文会签" activiti:assignee="${countersignUser}">
      <extensionElements>
        <activiti:formProperty id="rate" name="投票比例" type="enum" writable="false">
          <activiti:value id="100" name="100%"></activiti:value>
          <activiti:value id="70" name="70%"></activiti:value>
          <activiti:value id="50" name="50%"></activiti:value>
        </activiti:formProperty>
        <activiti:formProperty id="incept" name="发送至" type="string" writable="false"></activiti:formProperty>
        <activiti:formProperty id="content" name="发文内容" type="string" writable="false"></activiti:formProperty>
        <activiti:formProperty id="countersignUsers" name="会签参与人" type="users" writable="false"></activiti:formProperty>
      </extensionElements>
      <multiInstanceLoopCharacteristics isSequential="false" activiti:collection="${countersignUsers}" activiti:elementVariable="countersignUser">
        <completionCondition>${dispatchWorkflowService.canComplete(execution, rate, nrOfInstances, nrOfActiveInstances,
					nrOfCompletedInstances, loopCounter)}</completionCondition>
      </multiInstanceLoopCharacteristics>
    </userTask>
    <userTask id="send" name="下发文件" activiti:assignee="${applyUser}">
      <extensionElements>
        <activiti:formProperty id="incept" name="发送至" type="string" writable="false"></activiti:formProperty>
        <activiti:formProperty id="rate" name="投票比例" type="enum" writable="false">
          <activiti:value id="100" name="100%"></activiti:value>
          <activiti:value id="70" name="70%"></activiti:value>
          <activiti:value id="50" name="50%"></activiti:value>
        </activiti:formProperty>
        <activiti:formProperty id="incept" name="发送至" type="string" writable="false"></activiti:formProperty>
        <activiti:formProperty id="content" name="发文内容" type="string" writable="false"></activiti:formProperty>
        <activiti:formProperty id="countersignUsers" name="会签参与人" type="users" writable="false"></activiti:formProperty>
      </extensionElements>
    </userTask>
    <endEvent id="endevent1" name="End"></endEvent>
    <sequenceFlow id="flow1" sourceRef="startevent1" targetRef="countersign"></sequenceFlow>
    <sequenceFlow id="flow2" sourceRef="countersign" targetRef="send"></sequenceFlow>
    <sequenceFlow id="flow3" sourceRef="send" targetRef="endevent1"></sequenceFlow>
  </process>
  <bpmndi:BPMNDiagram id="BPMNDiagram_dispatch">
    <bpmndi:BPMNPlane bpmnElement="dispatch" id="BPMNPlane_dispatch">
      <bpmndi:BPMNShape bpmnElement="startevent1" id="BPMNShape_startevent1">
        <omgdc:Bounds height="35.0" width="35.0" x="30.0" y="120.0"></omgdc:Bounds>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape bpmnElement="countersign" id="BPMNShape_countersign">
        <omgdc:Bounds height="55.0" width="105.0" x="110.0" y="110.0"></omgdc:Bounds>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape bpmnElement="send" id="BPMNShape_send">
        <omgdc:Bounds height="55.0" width="105.0" x="270.0" y="110.0"></omgdc:Bounds>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape bpmnElement="endevent1" id="BPMNShape_endevent1">
        <omgdc:Bounds height="35.0" width="35.0" x="430.0" y="120.0"></omgdc:Bounds>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNEdge bpmnElement="flow1" id="BPMNEdge_flow1">
        <omgdi:waypoint x="65.0" y="137.0"></omgdi:waypoint>
        <omgdi:waypoint x="110.0" y="137.0"></omgdi:waypoint>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge bpmnElement="flow2" id="BPMNEdge_flow2">
        <omgdi:waypoint x="215.0" y="137.0"></omgdi:waypoint>
        <omgdi:waypoint x="270.0" y="137.0"></omgdi:waypoint>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge bpmnElement="flow3" id="BPMNEdge_flow3">
        <omgdi:waypoint x="375.0" y="137.0"></omgdi:waypoint>
        <omgdi:waypoint x="430.0" y="137.0"></omgdi:waypoint>
      </bpmndi:BPMNEdge>
    </bpmndi:BPMNPlane>
  </bpmndi:BPMNDiagram>
</definitions>