dodil/erp-method

modules/timesheets/signoff/timesheets/timesheets_ts_migration_run.bpmn

<?xml version="1.0" encoding="UTF-8"?>
<bpmn:definitions xmlns:bpmn="http://www.omg.org/spec/BPMN/20100524/MODEL" 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" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:dodil="https://git.dodil.io/dodil/erp-platform/bpmn/1" id="Definitions_timesheets_v2" name="Timesheets processes" targetNamespace="https://git.dodil.io/dodil/erp-platform/processes" exporter="erp-platform erp-compose bpmn" exporterVersion="1">
 <bpmn:collaboration id="Collaboration_timesheets_v2">
  <bpmn:documentation>Timesheets: one pool per entity lifecycle, generated from module.yaml.</bpmn:documentation>
  <bpmn:participant id="Participant_timesheets_ts_migration_run" name="Ts migration run" processRef="Process_timesheets_ts_migration_run_v2" />
 </bpmn:collaboration>
 <bpmn:process id="Process_timesheets_ts_migration_run_v2" name="Ts migration run" isExecutable="false">
  <bpmn:documentation>Lifecycle of the ts migration run, generated from module.yaml by erp-compose bpmn; change the workflow there, not this file. States: loaded, reconciled, signed, discarded.</bpmn:documentation>
  <bpmn:laneSet id="LaneSet_ts_migration_run">
   <bpmn:lane id="Lane_ts_migration_run_system" name="The system">
    <bpmn:flowNodeRef>Start_ts_migration_run</bpmn:flowNodeRef>
    <bpmn:flowNodeRef>Task_load_ts_from_odoo</bpmn:flowNodeRef>
    <bpmn:flowNodeRef>Task_reconcile_ts_migration</bpmn:flowNodeRef>
    <bpmn:flowNodeRef>Gateway_ts_migration_run_loaded__if</bpmn:flowNodeRef>
   </bpmn:lane>
   <bpmn:lane id="Lane_ts_migration_run_owner" name="The owner (or whoever the owner names)">
    <bpmn:flowNodeRef>Task_sign_ts_migration</bpmn:flowNodeRef>
    <bpmn:flowNodeRef>Task_discard_ts_migration</bpmn:flowNodeRef>
    <bpmn:flowNodeRef>Gateway_ts_migration_run_reconciled__if</bpmn:flowNodeRef>
    <bpmn:flowNodeRef>End_ts_migration_run_signed</bpmn:flowNodeRef>
    <bpmn:flowNodeRef>End_ts_migration_run_discarded</bpmn:flowNodeRef>
   </bpmn:lane>
  </bpmn:laneSet>
  <bpmn:startEvent id="Start_ts_migration_run" name="Ts migration run needed">
   <bpmn:outgoing>Flow_Start_ts_migration_run__Task_load_ts_from_odoo</bpmn:outgoing>
  </bpmn:startEvent>
  <bpmn:serviceTask id="Task_load_ts_from_odoo" name="Load Odoo's timesheets" dodil:step="load_ts_from_odoo" implementation="##unspecified">
   <bpmn:documentation>By: The system. From none to loaded. When: hr's and projects' migrations signed. Effect: v2 (pattern §11, seemo's decided answer 4): staging rows only (ts_migration_row, keyed by the source id); nothing written to the ledger, balances or journals.</bpmn:documentation>
   <bpmn:incoming>Flow_Start_ts_migration_run__Task_load_ts_from_odoo</bpmn:incoming>
   <bpmn:outgoing>Flow_Task_load_ts_from_odoo__Gateway_ts_migration_run_loaded__if</bpmn:outgoing>
  </bpmn:serviceTask>
  <bpmn:serviceTask id="Task_reconcile_ts_migration" name="Reconcile against Odoo" dodil:step="reconcile_ts_migration" implementation="##unspecified">
   <bpmn:documentation>By: The system. From loaded to reconciled.</bpmn:documentation>
   <bpmn:incoming>Flow_Gateway_ts_migration_run_loaded__if__Task_reconcile_ts_migration</bpmn:incoming>
   <bpmn:outgoing>Flow_Task_reconcile_ts_migration__Gateway_ts_migration_run_reconciled__if</bpmn:outgoing>
  </bpmn:serviceTask>
  <bpmn:userTask id="Task_sign_ts_migration" name="Sign the reconciliation" dodil:step="sign_ts_migration" dodil:approval="true">
   <bpmn:documentation>By: The owner (or whoever the owner names). From reconciled to signed. When: every check equal or explained. Effect: v2 (decided answer 4): the staged rows written through this module's normal use cases, idempotent on the source key; the first write to the ledger; a signed run is later reversed by reversing entries, never deleted. An approval.</bpmn:documentation>
   <bpmn:incoming>Flow_Gateway_ts_migration_run_reconciled__if__Task_sign_ts_migration</bpmn:incoming>
   <bpmn:outgoing>Flow_Task_sign_ts_migration__End_ts_migration_run_signed</bpmn:outgoing>
  </bpmn:userTask>
  <bpmn:userTask id="Task_discard_ts_migration" name="Discard the run" dodil:step="discard_ts_migration">
   <bpmn:documentation>By: The owner (or whoever the owner names). From loaded / reconciled to discarded. Requires: reason. Effect: v2 (decided answer 4): the run's staging rows deleted, nothing else (no ledger row was written).</bpmn:documentation>
   <bpmn:incoming>Flow_Gateway_ts_migration_run_loaded__if__Task_discard_ts_migration</bpmn:incoming>
   <bpmn:incoming>Flow_Gateway_ts_migration_run_reconciled__if__Task_discard_ts_migration</bpmn:incoming>
   <bpmn:outgoing>Flow_Task_discard_ts_migration__End_ts_migration_run_discarded</bpmn:outgoing>
  </bpmn:userTask>
  <bpmn:exclusiveGateway id="Gateway_ts_migration_run_loaded__if" name="Ts migration run loaded: what next?">
   <bpmn:incoming>Flow_Task_load_ts_from_odoo__Gateway_ts_migration_run_loaded__if</bpmn:incoming>
   <bpmn:outgoing>Flow_Gateway_ts_migration_run_loaded__if__Task_reconcile_ts_migration</bpmn:outgoing>
   <bpmn:outgoing>Flow_Gateway_ts_migration_run_loaded__if__Task_discard_ts_migration</bpmn:outgoing>
  </bpmn:exclusiveGateway>
  <bpmn:exclusiveGateway id="Gateway_ts_migration_run_reconciled__if" name="Ts migration run reconciled: what next?">
   <bpmn:incoming>Flow_Task_reconcile_ts_migration__Gateway_ts_migration_run_reconciled__if</bpmn:incoming>
   <bpmn:outgoing>Flow_Gateway_ts_migration_run_reconciled__if__Task_sign_ts_migration</bpmn:outgoing>
   <bpmn:outgoing>Flow_Gateway_ts_migration_run_reconciled__if__Task_discard_ts_migration</bpmn:outgoing>
  </bpmn:exclusiveGateway>
  <bpmn:endEvent id="End_ts_migration_run_signed" name="Ts migration run signed">
   <bpmn:incoming>Flow_Task_sign_ts_migration__End_ts_migration_run_signed</bpmn:incoming>
  </bpmn:endEvent>
  <bpmn:endEvent id="End_ts_migration_run_discarded" name="Ts migration run discarded">
   <bpmn:incoming>Flow_Task_discard_ts_migration__End_ts_migration_run_discarded</bpmn:incoming>
  </bpmn:endEvent>
  <bpmn:sequenceFlow id="Flow_Start_ts_migration_run__Task_load_ts_from_odoo" sourceRef="Start_ts_migration_run" targetRef="Task_load_ts_from_odoo" />
  <bpmn:sequenceFlow id="Flow_Gateway_ts_migration_run_loaded__if__Task_reconcile_ts_migration" sourceRef="Gateway_ts_migration_run_loaded__if" targetRef="Task_reconcile_ts_migration" />
  <bpmn:sequenceFlow id="Flow_Gateway_ts_migration_run_loaded__if__Task_discard_ts_migration" sourceRef="Gateway_ts_migration_run_loaded__if" targetRef="Task_discard_ts_migration" />
  <bpmn:sequenceFlow id="Flow_Task_load_ts_from_odoo__Gateway_ts_migration_run_loaded__if" sourceRef="Task_load_ts_from_odoo" targetRef="Gateway_ts_migration_run_loaded__if" />
  <bpmn:sequenceFlow id="Flow_Gateway_ts_migration_run_reconciled__if__Task_sign_ts_migration" sourceRef="Gateway_ts_migration_run_reconciled__if" targetRef="Task_sign_ts_migration" />
  <bpmn:sequenceFlow id="Flow_Gateway_ts_migration_run_reconciled__if__Task_discard_ts_migration" sourceRef="Gateway_ts_migration_run_reconciled__if" targetRef="Task_discard_ts_migration" />
  <bpmn:sequenceFlow id="Flow_Task_reconcile_ts_migration__Gateway_ts_migration_run_reconciled__if" sourceRef="Task_reconcile_ts_migration" targetRef="Gateway_ts_migration_run_reconciled__if" />
  <bpmn:sequenceFlow id="Flow_Task_sign_ts_migration__End_ts_migration_run_signed" sourceRef="Task_sign_ts_migration" targetRef="End_ts_migration_run_signed" />
  <bpmn:sequenceFlow id="Flow_Task_discard_ts_migration__End_ts_migration_run_discarded" sourceRef="Task_discard_ts_migration" targetRef="End_ts_migration_run_discarded" />
 </bpmn:process>
 <bpmndi:BPMNDiagram id="BPMNDiagram_timesheets_v2">
  <bpmndi:BPMNPlane id="BPMNPlane_timesheets_v2" bpmnElement="Collaboration_timesheets_v2">
   <bpmndi:BPMNShape id="Participant_timesheets_ts_migration_run_di" bpmnElement="Participant_timesheets_ts_migration_run" isHorizontal="true">
    <dc:Bounds x="0" y="0" width="1300" height="400" />
   </bpmndi:BPMNShape>
   <bpmndi:BPMNShape id="Lane_ts_migration_run_system_di" bpmnElement="Lane_ts_migration_run_system" isHorizontal="true">
    <dc:Bounds x="30" y="0" width="1270" height="140" />
   </bpmndi:BPMNShape>
   <bpmndi:BPMNShape id="Lane_ts_migration_run_owner_di" bpmnElement="Lane_ts_migration_run_owner" isHorizontal="true">
    <dc:Bounds x="30" y="140" width="1270" height="260" />
   </bpmndi:BPMNShape>
   <bpmndi:BPMNShape id="Start_ts_migration_run_di" bpmnElement="Start_ts_migration_run">
    <dc:Bounds x="157" y="42" width="36" height="36" />
   </bpmndi:BPMNShape>
   <bpmndi:BPMNShape id="Task_load_ts_from_odoo_di" bpmnElement="Task_load_ts_from_odoo">
    <dc:Bounds x="295" y="20" width="100" height="80" />
   </bpmndi:BPMNShape>
   <bpmndi:BPMNShape id="Task_reconcile_ts_migration_di" bpmnElement="Task_reconcile_ts_migration">
    <dc:Bounds x="635" y="20" width="100" height="80" />
   </bpmndi:BPMNShape>
   <bpmndi:BPMNShape id="Task_sign_ts_migration_di" bpmnElement="Task_sign_ts_migration">
    <dc:Bounds x="975" y="160" width="100" height="80" />
   </bpmndi:BPMNShape>
   <bpmndi:BPMNShape id="Task_discard_ts_migration_di" bpmnElement="Task_discard_ts_migration">
    <dc:Bounds x="635" y="160" width="100" height="80" />
   </bpmndi:BPMNShape>
   <bpmndi:BPMNShape id="Gateway_ts_migration_run_loaded__if_di" bpmnElement="Gateway_ts_migration_run_loaded__if">
    <dc:Bounds x="490" y="35" width="50" height="50" />
   </bpmndi:BPMNShape>
   <bpmndi:BPMNShape id="Gateway_ts_migration_run_reconciled__if_di" bpmnElement="Gateway_ts_migration_run_reconciled__if">
    <dc:Bounds x="830" y="175" width="50" height="50" />
   </bpmndi:BPMNShape>
   <bpmndi:BPMNShape id="End_ts_migration_run_signed_di" bpmnElement="End_ts_migration_run_signed">
    <dc:Bounds x="1177" y="182" width="36" height="36" />
   </bpmndi:BPMNShape>
   <bpmndi:BPMNShape id="End_ts_migration_run_discarded_di" bpmnElement="End_ts_migration_run_discarded">
    <dc:Bounds x="837" y="302" width="36" height="36" />
   </bpmndi:BPMNShape>
   <bpmndi:BPMNEdge id="Flow_Start_ts_migration_run__Task_load_ts_from_odoo_di" bpmnElement="Flow_Start_ts_migration_run__Task_load_ts_from_odoo">
    <di:waypoint x="193" y="60" />
    <di:waypoint x="295" y="60" />
   </bpmndi:BPMNEdge>
   <bpmndi:BPMNEdge id="Flow_Gateway_ts_migration_run_loaded__if__Task_reconcile_ts_migration_di" bpmnElement="Flow_Gateway_ts_migration_run_loaded__if__Task_reconcile_ts_migration">
    <di:waypoint x="540" y="60" />
    <di:waypoint x="635" y="60" />
   </bpmndi:BPMNEdge>
   <bpmndi:BPMNEdge id="Flow_Gateway_ts_migration_run_loaded__if__Task_discard_ts_migration_di" bpmnElement="Flow_Gateway_ts_migration_run_loaded__if__Task_discard_ts_migration">
    <di:waypoint x="540" y="60" />
    <di:waypoint x="610" y="60" />
    <di:waypoint x="610" y="200" />
    <di:waypoint x="635" y="200" />
   </bpmndi:BPMNEdge>
   <bpmndi:BPMNEdge id="Flow_Task_load_ts_from_odoo__Gateway_ts_migration_run_loaded__if_di" bpmnElement="Flow_Task_load_ts_from_odoo__Gateway_ts_migration_run_loaded__if">
    <di:waypoint x="395" y="60" />
    <di:waypoint x="490" y="60" />
   </bpmndi:BPMNEdge>
   <bpmndi:BPMNEdge id="Flow_Gateway_ts_migration_run_reconciled__if__Task_sign_ts_migration_di" bpmnElement="Flow_Gateway_ts_migration_run_reconciled__if__Task_sign_ts_migration">
    <di:waypoint x="880" y="200" />
    <di:waypoint x="975" y="200" />
   </bpmndi:BPMNEdge>
   <bpmndi:BPMNEdge id="Flow_Gateway_ts_migration_run_reconciled__if__Task_discard_ts_migration_di" bpmnElement="Flow_Gateway_ts_migration_run_reconciled__if__Task_discard_ts_migration">
    <di:waypoint x="855" y="225" />
    <di:waypoint x="855" y="255" />
    <di:waypoint x="685" y="255" />
    <di:waypoint x="685" y="240" />
   </bpmndi:BPMNEdge>
   <bpmndi:BPMNEdge id="Flow_Task_reconcile_ts_migration__Gateway_ts_migration_run_reconciled__if_di" bpmnElement="Flow_Task_reconcile_ts_migration__Gateway_ts_migration_run_reconciled__if">
    <di:waypoint x="735" y="60" />
    <di:waypoint x="805" y="60" />
    <di:waypoint x="805" y="200" />
    <di:waypoint x="830" y="200" />
   </bpmndi:BPMNEdge>
   <bpmndi:BPMNEdge id="Flow_Task_sign_ts_migration__End_ts_migration_run_signed_di" bpmnElement="Flow_Task_sign_ts_migration__End_ts_migration_run_signed">
    <di:waypoint x="1075" y="200" />
    <di:waypoint x="1177" y="200" />
   </bpmndi:BPMNEdge>
   <bpmndi:BPMNEdge id="Flow_Task_discard_ts_migration__End_ts_migration_run_discarded_di" bpmnElement="Flow_Task_discard_ts_migration__End_ts_migration_run_discarded">
    <di:waypoint x="735" y="200" />
    <di:waypoint x="812" y="200" />
    <di:waypoint x="812" y="320" />
    <di:waypoint x="837" y="320" />
   </bpmndi:BPMNEdge>
  </bpmndi:BPMNPlane>
 </bpmndi:BPMNDiagram>
</bpmn:definitions>