<?xml version='1.0' encoding='utf-8'?>
<bpmn:definitions xmlns:bpmn="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" id="NexCom_Record_Output_020" targetNamespace="https://nexcommand.ai/mro/record-output/0.2.0">
  <bpmn:process id="L3_RECORD_ISSUE" name="Record output review and controlled print handover" isExecutable="false">
    <bpmn:documentation>Human procedure / design acceptance contract. Referenced by 12 L2 record trails. Not deployed automation. Official DD/DA template acceptance remains pending.</bpmn:documentation>
    <bpmn:startEvent id="issue_start" name="Submitted evidence selected"/>
    <bpmn:userTask id="issue_select" name="Identify required authority/contract output"/>
    <bpmn:exclusiveGateway id="issue_kind" name="Prescribed official form required?" default="issue_kind_hold"/>
    <bpmn:userTask id="issue_validate" name="Verify current approved template, all blocks, instructions and signature basis"/>
    <bpmn:exclusiveGateway id="issue_approved" name="Official-form acceptance complete?" default="issue_f6"/>
    <bpmn:userTask id="issue_print" name="Preview all pages and print/export the permitted output"/>
    <bpmn:userTask id="issue_review" name="Independently compare output to retained records"/>
    <bpmn:exclusiveGateway id="issue_match" name="Output complete and matches evidence?" default="issue_f10"/>
    <bpmn:userTask id="issue_retain" name="Retain exact issued copy, recipients and retention authority"/>
    <bpmn:endEvent id="issue_end" name="Reviewed copy handed over"/>
    <bpmn:endEvent id="issue_hold" name="HOLD: retain cause; authorized correction required"/>
    <bpmn:sequenceFlow id="issue_f0" sourceRef="issue_start" targetRef="issue_select" name=""/>
    <bpmn:sequenceFlow id="issue_f1" sourceRef="issue_select" targetRef="issue_kind" name=""/>
    <bpmn:sequenceFlow id="issue_f2" sourceRef="issue_kind" targetRef="issue_validate" name="Official form required">
      <bpmn:conditionExpression xsi:type="bpmn:tFormalExpression">official_form_required == true</bpmn:conditionExpression>
    </bpmn:sequenceFlow>
    <bpmn:sequenceFlow id="issue_f3" sourceRef="issue_kind" targetRef="issue_print" name="Generic ERP copy permitted">
      <bpmn:conditionExpression xsi:type="bpmn:tFormalExpression">official_form_required == false and generic_copy_permitted == true</bpmn:conditionExpression>
    </bpmn:sequenceFlow>
    <bpmn:sequenceFlow id="issue_f4" sourceRef="issue_validate" targetRef="issue_approved" name=""/>
    <bpmn:sequenceFlow id="issue_f5" sourceRef="issue_approved" targetRef="issue_print" name="Verified approved form">
      <bpmn:conditionExpression xsi:type="bpmn:tFormalExpression">official_form_accepted == true</bpmn:conditionExpression>
    </bpmn:sequenceFlow>
    <bpmn:sequenceFlow id="issue_f6" sourceRef="issue_approved" targetRef="issue_hold" name="Unresolved / not accepted"/>
    <bpmn:sequenceFlow id="issue_f7" sourceRef="issue_print" targetRef="issue_review" name=""/>
    <bpmn:sequenceFlow id="issue_f8" sourceRef="issue_review" targetRef="issue_match" name=""/>
    <bpmn:sequenceFlow id="issue_f9" sourceRef="issue_match" targetRef="issue_retain" name="Complete and matched">
      <bpmn:conditionExpression xsi:type="bpmn:tFormalExpression">output_complete_and_matched == true</bpmn:conditionExpression>
    </bpmn:sequenceFlow>
    <bpmn:sequenceFlow id="issue_f10" sourceRef="issue_match" targetRef="issue_hold" name="Mismatch / unresolved"/>
    <bpmn:sequenceFlow id="issue_f11" sourceRef="issue_retain" targetRef="issue_end" name=""/>
    <bpmn:sequenceFlow id="issue_kind_hold" sourceRef="issue_kind" targetRef="issue_hold" name="Output requirement unresolved"/>
  </bpmn:process>
  <bpmndi:BPMNDiagram id="issue_diagram">
    <bpmndi:BPMNPlane id="issue_plane" bpmnElement="L3_RECORD_ISSUE">
      <bpmndi:BPMNShape id="issue_start_shape" bpmnElement="issue_start">
        <dc:Bounds x="20" y="100" width="36" height="36"/>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="issue_select_shape" bpmnElement="issue_select">
        <dc:Bounds x="90" y="75" width="180" height="80"/>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="issue_kind_shape" bpmnElement="issue_kind">
        <dc:Bounds x="310" y="90" width="50" height="50"/>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="issue_validate_shape" bpmnElement="issue_validate">
        <dc:Bounds x="400" y="75" width="180" height="80"/>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="issue_approved_shape" bpmnElement="issue_approved">
        <dc:Bounds x="620" y="90" width="50" height="50"/>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="issue_print_shape" bpmnElement="issue_print">
        <dc:Bounds x="715" y="75" width="180" height="80"/>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="issue_review_shape" bpmnElement="issue_review">
        <dc:Bounds x="935" y="75" width="180" height="80"/>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="issue_match_shape" bpmnElement="issue_match">
        <dc:Bounds x="1150" y="90" width="50" height="50"/>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="issue_retain_shape" bpmnElement="issue_retain">
        <dc:Bounds x="1245" y="75" width="180" height="80"/>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="issue_end_shape" bpmnElement="issue_end">
        <dc:Bounds x="1470" y="100" width="36" height="36"/>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="issue_hold_shape" bpmnElement="issue_hold">
        <dc:Bounds x="630" y="330" width="36" height="36"/>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNEdge id="issue_f0_edge" bpmnElement="issue_f0">
        <di:waypoint x="56" y="118.0"/>
        <di:waypoint x="90" y="115.0"/>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="issue_f1_edge" bpmnElement="issue_f1">
        <di:waypoint x="270" y="115.0"/>
        <di:waypoint x="310" y="115.0"/>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="issue_f2_edge" bpmnElement="issue_f2">
        <di:waypoint x="360" y="115.0"/>
        <di:waypoint x="400" y="115.0"/>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="issue_f3_edge" bpmnElement="issue_f3">
        <di:waypoint x="335.0" y="90"/>
        <di:waypoint x="335.0" y="25"/>
        <di:waypoint x="805.0" y="25"/>
        <di:waypoint x="805.0" y="75"/>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="issue_f4_edge" bpmnElement="issue_f4">
        <di:waypoint x="580" y="115.0"/>
        <di:waypoint x="620" y="115.0"/>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="issue_f5_edge" bpmnElement="issue_f5">
        <di:waypoint x="670" y="115.0"/>
        <di:waypoint x="715" y="115.0"/>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="issue_f6_edge" bpmnElement="issue_f6">
        <di:waypoint x="670" y="115.0"/>
        <di:waypoint x="630" y="348.0"/>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="issue_f7_edge" bpmnElement="issue_f7">
        <di:waypoint x="895" y="115.0"/>
        <di:waypoint x="935" y="115.0"/>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="issue_f8_edge" bpmnElement="issue_f8">
        <di:waypoint x="1115" y="115.0"/>
        <di:waypoint x="1150" y="115.0"/>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="issue_f9_edge" bpmnElement="issue_f9">
        <di:waypoint x="1200" y="115.0"/>
        <di:waypoint x="1245" y="115.0"/>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="issue_f10_edge" bpmnElement="issue_f10">
        <di:waypoint x="1200" y="115.0"/>
        <di:waypoint x="630" y="348.0"/>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="issue_f11_edge" bpmnElement="issue_f11">
        <di:waypoint x="1425" y="115.0"/>
        <di:waypoint x="1470" y="118.0"/>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="issue_kind_hold_edge" bpmnElement="issue_kind_hold">
        <di:waypoint x="360" y="115.0"/>
        <di:waypoint x="630" y="348.0"/>
      </bpmndi:BPMNEdge>
    </bpmndi:BPMNPlane>
  </bpmndi:BPMNDiagram>
</bpmn:definitions>
