<?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:xsi="http://www.w3.org/2001/XMLSchema-instance" 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" targetNamespace="http://www.intra-mart.jp/im_bpm" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <bpmn:process id="error_event_usage" name="【チュートリアル】エラーイベントを使用する" activiti:notUseBusinessKey="false" activiti:candidateStarterUsers="aoyagi" isExecutable="true">
    <bpmn:startEvent id="start-event_1" name="開始"/>
    <bpmn:subProcess id="sub-process_1" name="サブプロセス">
      <bpmn:startEvent id="start-event_2" name="開始"/>
      <bpmn:userTask id="user-task_1" name="終了方法を選択するユーザタスク" activiti:color="bbdefb" activiti:assignee="aoyagi" activiti:formKey="forma:event_error_usage">
        <bpmn:extensionElements>
          <activiti:taskListener event="complete" expression="${execution.setVariable('end_with_error1', execution.getVariable('check1'))}"/>
          <activiti:taskListener event="complete" expression="${execution.setVariable('end_with_error2', execution.getVariable('check2'))}"/>
          <activiti:taskListener event="complete" expression="${execution.setVariable('end_with_end_event', execution.getVariable('check3'))}"/>
        </bpmn:extensionElements>
      </bpmn:userTask>
      <bpmn:endEvent id="error-end-event_1" name="エラー終了1">
        <bpmn:errorEventDefinition errorRef="error1"/>
      </bpmn:endEvent>
      <bpmn:endEvent id="error-end-event_2" name="エラー終了2">
        <bpmn:errorEventDefinition errorRef="error2"/>
      </bpmn:endEvent>
      <bpmn:exclusiveGateway id="exclusive-gateway_1" name="排他ゲートウェイ"/>
      <bpmn:endEvent id="end-event_1" name="終了"/>
      <bpmn:sequenceFlow id="sequence-flow_2" sourceRef="start-event_2" targetRef="user-task_1"/>
      <bpmn:sequenceFlow id="sequence-flow_3" sourceRef="user-task_1" targetRef="exclusive-gateway_1"/>
      <bpmn:sequenceFlow id="sequence-flow_6" sourceRef="exclusive-gateway_1" targetRef="error-end-event_2">
        <bpmn:conditionExpression xsi:type="bpmn:tExpression"><![CDATA[${end_way=="2"}]]></bpmn:conditionExpression>
      </bpmn:sequenceFlow>
      <bpmn:sequenceFlow id="sequence-flow_4" sourceRef="exclusive-gateway_1" targetRef="error-end-event_1">
        <bpmn:conditionExpression xsi:type="bpmn:tExpression"><![CDATA[${end_way=="1"}]]></bpmn:conditionExpression>
      </bpmn:sequenceFlow>
      <bpmn:sequenceFlow id="sequence-flow_8" sourceRef="exclusive-gateway_1" targetRef="end-event_1">
        <bpmn:conditionExpression xsi:type="bpmn:tExpression"><![CDATA[${end_way=="3"}]]></bpmn:conditionExpression>
      </bpmn:sequenceFlow>
    </bpmn:subProcess>
    <bpmn:boundaryEvent id="error-boundary_1" name="エラー境界" attachedToRef="sub-process_1">
      <bpmn:errorEventDefinition errorRef="error2"/>
    </bpmn:boundaryEvent>
    <bpmn:userTask id="user-task_3" name="エラー終了2で終了した場合のタスク" activiti:color="bbdefb" activiti:assignee="aoyagi"/>
    <bpmn:userTask id="user-task_4" name="終了イベントで終了した場合のタスク" activiti:color="bbdefb" activiti:assignee="aoyagi"/>
    <bpmn:subProcess id="event-sub-process_1" name="イベントサブプロセス" triggeredByEvent="true">
      <bpmn:startEvent id="error-start-event_1" name="エラー開始">
        <bpmn:errorEventDefinition errorRef="error1"/>
      </bpmn:startEvent>
      <bpmn:userTask id="user-task_2" name="エラー終了1で終了した場合のタスク" activiti:color="bbdefb" activiti:assignee="aoyagi"/>
      <bpmn:sequenceFlow id="sequence-flow_5" sourceRef="error-start-event_1" targetRef="user-task_2"/>
    </bpmn:subProcess>
    <bpmn:sequenceFlow id="sequence-flow_1" sourceRef="start-event_1" targetRef="sub-process_1"/>
    <bpmn:sequenceFlow id="sequence-flow_7" sourceRef="error-boundary_1" targetRef="user-task_3"/>
    <bpmn:sequenceFlow id="sequence-flow_9" sourceRef="sub-process_1" targetRef="user-task_4"/>
  </bpmn:process>
  <bpmndi:BPMNDiagram id="BPMNDiagram_error_event_usage">
    <bpmndi:BPMNPlane id="BPMNPlane_error_event_usage" bpmnElement="error_event_usage">
      <bpmndi:BPMNShape id="BPMNShape_start-event_1" bpmnElement="start-event_1">
        <dc:Bounds x="105" y="231" width="35" height="35"/>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="BPMNShape_sub-process_1" bpmnElement="sub-process_1">
        <dc:Bounds x="178" y="120" width="457" height="256"/>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="BPMNShape_start-event_2" bpmnElement="start-event_2">
        <dc:Bounds x="198" y="221.5" width="35" height="35"/>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="BPMNShape_user-task_1" bpmnElement="user-task_1">
        <dc:Bounds x="266" y="200" width="107" height="80"/>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="BPMNShape_error-end-event_1" bpmnElement="error-end-event_1">
        <dc:Bounds x="515" y="140.5" width="35" height="35"/>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="BPMNShape_error-end-event_2" bpmnElement="error-end-event_2">
        <dc:Bounds x="515" y="221.5" width="35" height="35"/>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="BPMNShape_exclusive-gateway_1" bpmnElement="exclusive-gateway_1">
        <dc:Bounds x="415" y="220" width="40" height="40"/>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="BPMNShape_end-event_1" bpmnElement="end-event_1">
        <dc:Bounds x="515" y="310" width="35" height="35"/>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNEdge id="BPMNEdge_sequence-flow_2" bpmnElement="sequence-flow_2">
        <di:waypoint xsi:type="dc:Point" x="233" y="239.16826923076923"/>
        <di:waypoint xsi:type="dc:Point" x="266" y="239.48557692307693"/>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="BPMNEdge_sequence-flow_3" bpmnElement="sequence-flow_3">
        <di:waypoint xsi:type="dc:Point" x="373" y="240"/>
        <di:waypoint xsi:type="dc:Point" x="415" y="240"/>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="BPMNEdge_sequence-flow_6" bpmnElement="sequence-flow_6">
        <di:waypoint xsi:type="dc:Point" x="455" y="239.7948717948718"/>
        <di:waypoint xsi:type="dc:Point" x="515" y="239.17948717948718"/>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="BPMNEdge_sequence-flow_4" bpmnElement="sequence-flow_4">
        <di:waypoint xsi:type="dc:Point" x="435" y="220"/>
        <di:waypoint xsi:type="dc:Point" x="435" y="158"/>
        <di:waypoint xsi:type="dc:Point" x="515" y="158"/>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="BPMNEdge_sequence-flow_8" bpmnElement="sequence-flow_8">
        <di:waypoint xsi:type="dc:Point" x="435" y="260"/>
        <di:waypoint xsi:type="dc:Point" x="435" y="328"/>
        <di:waypoint xsi:type="dc:Point" x="515" y="327.5897435897436"/>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNShape id="BPMNShape_error-boundary_1" bpmnElement="error-boundary_1">
        <dc:Bounds x="620.5" y="225.5" width="29" height="29"/>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="BPMNShape_user-task_3" bpmnElement="user-task_3">
        <dc:Bounds x="703" y="200" width="120" height="80"/>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="BPMNShape_user-task_4" bpmnElement="user-task_4">
        <dc:Bounds x="702" y="288" width="122" height="80"/>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="BPMNShape_event-sub-process_1" bpmnElement="event-sub-process_1">
        <dc:Bounds x="273" y="418" width="284" height="143"/>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="BPMNShape_error-start-event_1" bpmnElement="error-start-event_1">
        <dc:Bounds x="317" y="481.5" width="35" height="35"/>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="BPMNShape_user-task_2" bpmnElement="user-task_2">
        <dc:Bounds x="415" y="459" width="120" height="80"/>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNEdge id="BPMNEdge_sequence-flow_5" bpmnElement="sequence-flow_5">
        <di:waypoint xsi:type="dc:Point" x="352" y="499"/>
        <di:waypoint xsi:type="dc:Point" x="415" y="499"/>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="BPMNEdge_sequence-flow_1" bpmnElement="sequence-flow_1">
        <di:waypoint xsi:type="dc:Point" x="140" y="248.46919014084506"/>
        <di:waypoint xsi:type="dc:Point" x="178" y="248.40228873239437"/>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="BPMNEdge_sequence-flow_7" bpmnElement="sequence-flow_7">
        <di:waypoint xsi:type="dc:Point" x="649.5" y="240"/>
        <di:waypoint xsi:type="dc:Point" x="703" y="240"/>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="BPMNEdge_sequence-flow_9" bpmnElement="sequence-flow_9">
        <di:waypoint xsi:type="dc:Point" x="635" y="328.35164835164835"/>
        <di:waypoint xsi:type="dc:Point" x="634" y="328"/>
        <di:waypoint xsi:type="dc:Point" x="702" y="328"/>
      </bpmndi:BPMNEdge>
    </bpmndi:BPMNPlane>
  </bpmndi:BPMNDiagram>
</bpmn:definitions>