<?xml version="1.0" encoding="UTF-8"?><bpmn:definitions xmlns:bpmn="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:di="http://www.omg.org/spec/DD/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" targetNamespace="http://www.intra-mart.jp/im_bpm" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <bpmn:collaboration id="Collaboration">
    <bpmn:participant id="pool_1" name="呼び出されるプロセス" processRef="receive_business_key_process"/>
    <bpmn:participant id="pool_2" name="業務キーを継承するプロセス" processRef="inherit_business_key_process"/>
    <bpmn:participant id="pool_3" name="業務キーを任意に設定するプロセス" processRef="business_key_process"/>
  </bpmn:collaboration>
  <bpmn:process id="receive_business_key_process" name="呼び出されるプロセス" activiti:notUseBusinessKey="false" isExecutable="true">
    <bpmn:laneSet id="laneSet_receive_business_key_process">
      <bpmn:lane id="swimlane_1" activiti:color="aaffaa" name="レーン">
        <bpmn:flowNodeRef>start-event_1</bpmn:flowNodeRef>
        <bpmn:flowNodeRef>user-task_1</bpmn:flowNodeRef>
        <bpmn:flowNodeRef>end-event_1</bpmn:flowNodeRef>
      </bpmn:lane>
    </bpmn:laneSet>
    <bpmn:startEvent id="start-event_1" name="開始"/>
    <bpmn:userTask id="user-task_1" name="呼び出されたユーザタスク" activiti:color="bbdefb"/>
    <bpmn:endEvent id="end-event_1" name="終了"/>
    <bpmn:sequenceFlow id="sequence-flow_1" sourceRef="start-event_1" targetRef="user-task_1"/>
    <bpmn:sequenceFlow id="sequence-flow_2" sourceRef="user-task_1" targetRef="end-event_1"/>
  </bpmn:process>
  <bpmn:process id="inherit_business_key_process" name="業務キーを継承するプロセス" activiti:notUseBusinessKey="false" activiti:candidateStarterUsers="aoyagi" isExecutable="true">
    <bpmn:laneSet id="laneSet_inherit_business_key_process">
      <bpmn:lane id="swimlane_2" activiti:color="ffffaa" name="レーン">
        <bpmn:flowNodeRef>start-event_2</bpmn:flowNodeRef>
        <bpmn:flowNodeRef>call-activity_1</bpmn:flowNodeRef>
        <bpmn:flowNodeRef>end-event_2</bpmn:flowNodeRef>
      </bpmn:lane>
    </bpmn:laneSet>
    <bpmn:startEvent id="start-event_2" name="開始"/>
    <bpmn:callActivity id="call-activity_1" name="業務キーを継承するコールアクティビティ" activiti:color="f9c0e4" activiti:inheritBusinessKey="true" calledElement="receive_business_key_process"/>
    <bpmn:endEvent id="end-event_2" name="終了"/>
    <bpmn:sequenceFlow id="sequence-flow_3" sourceRef="start-event_2" targetRef="call-activity_1"/>
    <bpmn:sequenceFlow id="sequence-flow_4" sourceRef="call-activity_1" targetRef="end-event_2"/>
  </bpmn:process>
  <bpmn:process id="business_key_process" name="業務キーを任意に設定するプロセス" activiti:notUseBusinessKey="false" activiti:candidateStarterUsers="aoyagi" isExecutable="true">
    <bpmn:laneSet id="laneSet_business_key_process">
      <bpmn:lane id="swimlane_3" activiti:color="aad4ff" name="レーン">
        <bpmn:flowNodeRef>start-event_3</bpmn:flowNodeRef>
        <bpmn:flowNodeRef>script-task_1</bpmn:flowNodeRef>
        <bpmn:flowNodeRef>call-activity_2</bpmn:flowNodeRef>
        <bpmn:flowNodeRef>end-event_3</bpmn:flowNodeRef>
      </bpmn:lane>
    </bpmn:laneSet>
    <bpmn:startEvent id="start-event_3" name="開始"/>
    <bpmn:scriptTask id="script-task_1" name="業務キーを作成するスクリプトタスク" activiti:color="fff9c4" activiti:autoStoreVariables="false" scriptFormat="im_javascript">    <bpmn:script><![CDATA[function run(variables, execution, entity) {
  var businessKeys = new java.util.ArrayList();

  for (var i = 1; i <= 3; i++) {
    businessKeys.add(entity.getProcessBusinessKey() + '_' + i);
  }

  entity.setVariable('businessKeys', businessKeys);
}
]]></bpmn:script>
</bpmn:scriptTask>
    <bpmn:callActivity id="call-activity_2" name="業務キーを任意に設定するコールアクティビティ" activiti:color="f9c0e4" activiti:businessKey="${businessKey}" calledElement="receive_business_key_process">
      <bpmn:multiInstanceLoopCharacteristics activiti:collection="${businessKeys}" activiti:elementVariable="businessKey" isSequential="false"/>
    </bpmn:callActivity>
    <bpmn:endEvent id="end-event_3" name="終了"/>
    <bpmn:sequenceFlow id="sequence-flow_5" sourceRef="start-event_3" targetRef="script-task_1"/>
    <bpmn:sequenceFlow id="sequence-flow_6" sourceRef="script-task_1" targetRef="call-activity_2"/>
    <bpmn:sequenceFlow id="sequence-flow_7" sourceRef="call-activity_2" targetRef="end-event_3"/>
  </bpmn:process>
  <bpmndi:BPMNDiagram id="BPMNDiagram_Collaboration">
    <bpmndi:BPMNPlane id="BPMNPlane_Collaboration" bpmnElement="Collaboration">
      <bpmndi:BPMNShape id="BPMNShape_pool_1" bpmnElement="pool_1">
        <dc:Bounds x="170" y="60" width="600" height="200"/>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="BPMNShape_swimlane_1" bpmnElement="swimlane_1">
        <dc:Bounds x="200" y="60" width="570" height="200"/>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="BPMNShape_start-event_1" bpmnElement="start-event_1">
        <dc:Bounds x="300" y="142.5" width="35" height="35"/>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="BPMNShape_user-task_1" bpmnElement="user-task_1">
        <dc:Bounds x="410" y="120" width="100" height="80"/>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="BPMNShape_end-event_1" bpmnElement="end-event_1">
        <dc:Bounds x="580" y="142.5" width="35" height="35"/>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNEdge id="BPMNEdge_sequence-flow_1" bpmnElement="sequence-flow_1">
        <di:waypoint xsi:type="dc:Point" x="335" y="160"/>
        <di:waypoint xsi:type="dc:Point" x="410" y="160"/>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="BPMNEdge_sequence-flow_2" bpmnElement="sequence-flow_2">
        <di:waypoint xsi:type="dc:Point" x="510" y="160"/>
        <di:waypoint xsi:type="dc:Point" x="580" y="160"/>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNShape id="BPMNShape_pool_2" bpmnElement="pool_2">
        <dc:Bounds x="170" y="310" width="600" height="200"/>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="BPMNShape_swimlane_2" bpmnElement="swimlane_2">
        <dc:Bounds x="200" y="310" width="570" height="200"/>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="BPMNShape_start-event_2" bpmnElement="start-event_2">
        <dc:Bounds x="290" y="392.5" width="35" height="35"/>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="BPMNShape_call-activity_1" bpmnElement="call-activity_1">
        <dc:Bounds x="410" y="370" width="100" height="80"/>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="BPMNShape_end-event_2" bpmnElement="end-event_2">
        <dc:Bounds x="580" y="392.5" width="35" height="35"/>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNEdge id="BPMNEdge_sequence-flow_3" bpmnElement="sequence-flow_3">
        <di:waypoint xsi:type="dc:Point" x="325" y="410"/>
        <di:waypoint xsi:type="dc:Point" x="410" y="410"/>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="BPMNEdge_sequence-flow_4" bpmnElement="sequence-flow_4">
        <di:waypoint xsi:type="dc:Point" x="510" y="410"/>
        <di:waypoint xsi:type="dc:Point" x="580" y="410"/>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNShape id="BPMNShape_pool_3" bpmnElement="pool_3">
        <dc:Bounds x="170" y="570" width="600" height="200"/>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="BPMNShape_swimlane_3" bpmnElement="swimlane_3">
        <dc:Bounds x="200" y="570" width="570" height="200"/>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="BPMNShape_start-event_3" bpmnElement="start-event_3">
        <dc:Bounds x="265" y="652.5" width="35" height="35"/>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="BPMNShape_script-task_1" bpmnElement="script-task_1">
        <dc:Bounds x="360" y="630" width="100" height="80"/>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="BPMNShape_call-activity_2" bpmnElement="call-activity_2">
        <dc:Bounds x="515" y="630" width="100" height="80"/>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="BPMNShape_end-event_3" bpmnElement="end-event_3">
        <dc:Bounds x="680" y="652.5" width="35" height="35"/>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNEdge id="BPMNEdge_sequence-flow_5" bpmnElement="sequence-flow_5">
        <di:waypoint xsi:type="dc:Point" x="300" y="670"/>
        <di:waypoint xsi:type="dc:Point" x="360" y="670"/>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="BPMNEdge_sequence-flow_6" bpmnElement="sequence-flow_6">
        <di:waypoint xsi:type="dc:Point" x="460" y="670"/>
        <di:waypoint xsi:type="dc:Point" x="515" y="670"/>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="BPMNEdge_sequence-flow_7" bpmnElement="sequence-flow_7">
        <di:waypoint xsi:type="dc:Point" x="615" y="670"/>
        <di:waypoint xsi:type="dc:Point" x="680" y="670"/>
      </bpmndi:BPMNEdge>
    </bpmndi:BPMNPlane>
  </bpmndi:BPMNDiagram>
</bpmn:definitions>