dodil/erp-method

modules/timesheets/signoff/timesheets/history/timesheets_timesheet.v2.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_timesheet" name="Timesheet" processRef="Process_timesheets_timesheet_v2" />
 </bpmn:collaboration>
 <bpmn:process id="Process_timesheets_timesheet_v2" name="Timesheet" isExecutable="false">
  <bpmn:documentation>Lifecycle of the timesheet, generated from module.yaml by erp-compose bpmn; change the workflow there, not this file. States: open, submitted, approved, returned, superseded. Note: returned and superseded are terminal for their revision; the week continues as revision n+1, so no state is ever re-entered</bpmn:documentation>
  <bpmn:laneSet id="LaneSet_timesheet">
   <bpmn:lane id="Lane_timesheet_employee" name="Anyone who records time">
    <bpmn:flowNodeRef>Start_timesheet</bpmn:flowNodeRef>
    <bpmn:flowNodeRef>Task_open_timesheet</bpmn:flowNodeRef>
    <bpmn:flowNodeRef>Task_submit_timesheet</bpmn:flowNodeRef>
   </bpmn:lane>
   <bpmn:lane id="Lane_timesheet_project_lead" name="Project lead (from projects)">
    <bpmn:flowNodeRef>Task_approve_project_lines</bpmn:flowNodeRef>
    <bpmn:flowNodeRef>Gateway_approve_project_lines__if</bpmn:flowNodeRef>
    <bpmn:flowNodeRef>Gateway_approve_project_lines__if_end</bpmn:flowNodeRef>
   </bpmn:lane>
   <bpmn:lane id="Lane_timesheet_manager" name="Line manager (derived from hr)">
    <bpmn:flowNodeRef>Task_approve_timesheet</bpmn:flowNodeRef>
    <bpmn:flowNodeRef>Task_return_timesheet</bpmn:flowNodeRef>
    <bpmn:flowNodeRef>Gateway_timesheet_submitted__if</bpmn:flowNodeRef>
    <bpmn:flowNodeRef>End_timesheet_returned</bpmn:flowNodeRef>
   </bpmn:lane>
   <bpmn:lane id="Lane_timesheet_finance" name="Finance / the biller">
    <bpmn:flowNodeRef>Task_reopen_timesheet</bpmn:flowNodeRef>
    <bpmn:flowNodeRef>End_timesheet_superseded</bpmn:flowNodeRef>
   </bpmn:lane>
  </bpmn:laneSet>
  <bpmn:startEvent id="Start_timesheet" name="Timesheet needed">
   <bpmn:outgoing>Flow_Start_timesheet__Task_open_timesheet</bpmn:outgoing>
  </bpmn:startEvent>
  <bpmn:task id="Task_open_timesheet" name="Open the week" dodil:step="open_timesheet">
   <bpmn:documentation>By: Anyone who records time or The system. From none to open. When: employed on a day of the week (hr). Effect: sheet_id &lt;person_id&gt;:&lt;iso week&gt;, revision 1; expected minutes from hr; approved absences as read-only lines.</bpmn:documentation>
   <bpmn:incoming>Flow_Start_timesheet__Task_open_timesheet</bpmn:incoming>
   <bpmn:outgoing>Flow_Task_open_timesheet__Task_submit_timesheet</bpmn:outgoing>
  </bpmn:task>
  <bpmn:userTask id="Task_submit_timesheet" name="Submit the week" dodil:step="submit_timesheet">
   <bpmn:documentation>By: Anyone who records time. From open to submitted. When: hours_covered; lines bookable on their days; cost centres open; not_stale. Effect: lines frozen; the route fixed (approval_route in force on the week's Monday); the approver derived from hr on the Monday.</bpmn:documentation>
   <bpmn:incoming>Flow_Task_open_timesheet__Task_submit_timesheet</bpmn:incoming>
   <bpmn:outgoing>Flow_Task_submit_timesheet__Gateway_approve_project_lines__if</bpmn:outgoing>
  </bpmn:userTask>
  <bpmn:userTask id="Task_approve_project_lines" name="Approve the project lines" dodil:step="approve_project_lines" dodil:approval="true">
   <bpmn:documentation>By: Project lead (from projects). From submitted to submitted. When: approval_route project_lead_then_manager; the lead leads the line's project and is not the sheet's person (email AND sub). Effect: the line approvals recorded. An approval.</bpmn:documentation>
   <bpmn:incoming>Flow_Gateway_approve_project_lines__if__Task_approve_project_lines</bpmn:incoming>
   <bpmn:outgoing>Flow_Task_approve_project_lines__Gateway_approve_project_lines__if_end</bpmn:outgoing>
  </bpmn:userTask>
  <bpmn:userTask id="Task_approve_timesheet" name="Approve the week" dodil:step="approve_timesheet" dodil:approval="true">
   <bpmn:documentation>By: Line manager (derived from hr) or Finance / the biller. From submitted to approved. When: the approver is the sheet's approver or a delegate and not its person (email AND sub); every project line approved when the route asks; not_stale. Effect: after commit, from pending rows: the labour journal (TS-11), deliveries (TS-12), billing claims (TS-13); payroll and time-off can read the hours. An approval.</bpmn:documentation>
   <bpmn:incoming>Flow_Gateway_timesheet_submitted__if__Task_approve_timesheet</bpmn:incoming>
   <bpmn:outgoing>Flow_Task_approve_timesheet__Task_reopen_timesheet</bpmn:outgoing>
  </bpmn:userTask>
  <bpmn:userTask id="Task_return_timesheet" name="Return with a question" dodil:step="return_timesheet">
   <bpmn:documentation>By: Line manager (derived from hr) or Project lead (from projects) or Finance / the biller. From submitted to returned. Requires: reason. Effect: revision n+1 opens with the lines copied; rev n approvals void.</bpmn:documentation>
   <bpmn:incoming>Flow_Gateway_timesheet_submitted__if__Task_return_timesheet</bpmn:incoming>
   <bpmn:outgoing>Flow_Task_return_timesheet__End_timesheet_returned</bpmn:outgoing>
  </bpmn:userTask>
  <bpmn:userTask id="Task_reopen_timesheet" name="Reopen an approved week for a correction" dodil:step="reopen_timesheet">
   <bpmn:documentation>By: Finance / the biller. From approved to superseded. When: the reopener is neither the sheet's person nor its approver (email AND sub). Requires: reason. Effect: revision n+1 opens with the lines copied; on its approval revision n's journal is reversed and every downstream effect moves by the difference.</bpmn:documentation>
   <bpmn:incoming>Flow_Task_approve_timesheet__Task_reopen_timesheet</bpmn:incoming>
   <bpmn:outgoing>Flow_Task_reopen_timesheet__End_timesheet_superseded</bpmn:outgoing>
  </bpmn:userTask>
  <bpmn:exclusiveGateway id="Gateway_approve_project_lines__if" name="approval_route project_lead_then_manager; the lead leads the line's project and is not the sheet's person (email AND sub)?">
   <bpmn:incoming>Flow_Task_submit_timesheet__Gateway_approve_project_lines__if</bpmn:incoming>
   <bpmn:outgoing>Flow_Gateway_approve_project_lines__if__Task_approve_project_lines</bpmn:outgoing>
   <bpmn:outgoing>Flow_Gateway_approve_project_lines__if__Gateway_approve_project_lines__if_end</bpmn:outgoing>
  </bpmn:exclusiveGateway>
  <bpmn:exclusiveGateway id="Gateway_approve_project_lines__if_end">
   <bpmn:incoming>Flow_Gateway_approve_project_lines__if__Gateway_approve_project_lines__if_end</bpmn:incoming>
   <bpmn:incoming>Flow_Task_approve_project_lines__Gateway_approve_project_lines__if_end</bpmn:incoming>
   <bpmn:outgoing>Flow_Gateway_approve_project_lines__if_end__Gateway_timesheet_submitted__if</bpmn:outgoing>
  </bpmn:exclusiveGateway>
  <bpmn:exclusiveGateway id="Gateway_timesheet_submitted__if" name="Timesheet submitted: what next?">
   <bpmn:incoming>Flow_Gateway_approve_project_lines__if_end__Gateway_timesheet_submitted__if</bpmn:incoming>
   <bpmn:outgoing>Flow_Gateway_timesheet_submitted__if__Task_approve_timesheet</bpmn:outgoing>
   <bpmn:outgoing>Flow_Gateway_timesheet_submitted__if__Task_return_timesheet</bpmn:outgoing>
  </bpmn:exclusiveGateway>
  <bpmn:endEvent id="End_timesheet_returned" name="Timesheet returned">
   <bpmn:incoming>Flow_Task_return_timesheet__End_timesheet_returned</bpmn:incoming>
  </bpmn:endEvent>
  <bpmn:endEvent id="End_timesheet_superseded" name="Timesheet superseded">
   <bpmn:incoming>Flow_Task_reopen_timesheet__End_timesheet_superseded</bpmn:incoming>
  </bpmn:endEvent>
  <bpmn:sequenceFlow id="Flow_Start_timesheet__Task_open_timesheet" sourceRef="Start_timesheet" targetRef="Task_open_timesheet" />
  <bpmn:sequenceFlow id="Flow_Task_open_timesheet__Task_submit_timesheet" sourceRef="Task_open_timesheet" targetRef="Task_submit_timesheet" />
  <bpmn:sequenceFlow id="Flow_Gateway_approve_project_lines__if__Task_approve_project_lines" name="approval_route project_lead_then_manager; the lead leads the line's project and is not the sheet's person (email AND sub)" sourceRef="Gateway_approve_project_lines__if" targetRef="Task_approve_project_lines" />
  <bpmn:sequenceFlow id="Flow_Gateway_approve_project_lines__if__Gateway_approve_project_lines__if_end" name="otherwise" sourceRef="Gateway_approve_project_lines__if" targetRef="Gateway_approve_project_lines__if_end" />
  <bpmn:sequenceFlow id="Flow_Task_approve_project_lines__Gateway_approve_project_lines__if_end" sourceRef="Task_approve_project_lines" targetRef="Gateway_approve_project_lines__if_end" />
  <bpmn:sequenceFlow id="Flow_Gateway_timesheet_submitted__if__Task_approve_timesheet" sourceRef="Gateway_timesheet_submitted__if" targetRef="Task_approve_timesheet" />
  <bpmn:sequenceFlow id="Flow_Gateway_timesheet_submitted__if__Task_return_timesheet" sourceRef="Gateway_timesheet_submitted__if" targetRef="Task_return_timesheet" />
  <bpmn:sequenceFlow id="Flow_Gateway_approve_project_lines__if_end__Gateway_timesheet_submitted__if" sourceRef="Gateway_approve_project_lines__if_end" targetRef="Gateway_timesheet_submitted__if" />
  <bpmn:sequenceFlow id="Flow_Task_submit_timesheet__Gateway_approve_project_lines__if" sourceRef="Task_submit_timesheet" targetRef="Gateway_approve_project_lines__if" />
  <bpmn:sequenceFlow id="Flow_Task_approve_timesheet__Task_reopen_timesheet" sourceRef="Task_approve_timesheet" targetRef="Task_reopen_timesheet" />
  <bpmn:sequenceFlow id="Flow_Task_return_timesheet__End_timesheet_returned" sourceRef="Task_return_timesheet" targetRef="End_timesheet_returned" />
  <bpmn:sequenceFlow id="Flow_Task_reopen_timesheet__End_timesheet_superseded" sourceRef="Task_reopen_timesheet" targetRef="End_timesheet_superseded" />
 </bpmn:process>
 <bpmndi:BPMNDiagram id="BPMNDiagram_timesheets_v2">
  <bpmndi:BPMNPlane id="BPMNPlane_timesheets_v2" bpmnElement="Collaboration_timesheets_v2">
   <bpmndi:BPMNShape id="Participant_timesheets_timesheet_di" bpmnElement="Participant_timesheets_timesheet" isHorizontal="true">
    <dc:Bounds x="0" y="0" width="1640" height="800" />
   </bpmndi:BPMNShape>
   <bpmndi:BPMNShape id="Lane_timesheet_employee_di" bpmnElement="Lane_timesheet_employee" isHorizontal="true">
    <dc:Bounds x="30" y="0" width="1610" height="140" />
   </bpmndi:BPMNShape>
   <bpmndi:BPMNShape id="Lane_timesheet_project_lead_di" bpmnElement="Lane_timesheet_project_lead" isHorizontal="true">
    <dc:Bounds x="30" y="140" width="1610" height="260" />
   </bpmndi:BPMNShape>
   <bpmndi:BPMNShape id="Lane_timesheet_manager_di" bpmnElement="Lane_timesheet_manager" isHorizontal="true">
    <dc:Bounds x="30" y="400" width="1610" height="260" />
   </bpmndi:BPMNShape>
   <bpmndi:BPMNShape id="Lane_timesheet_finance_di" bpmnElement="Lane_timesheet_finance" isHorizontal="true">
    <dc:Bounds x="30" y="660" width="1610" height="140" />
   </bpmndi:BPMNShape>
   <bpmndi:BPMNShape id="Start_timesheet_di" bpmnElement="Start_timesheet">
    <dc:Bounds x="157" y="42" width="36" height="36" />
   </bpmndi:BPMNShape>
   <bpmndi:BPMNShape id="Task_open_timesheet_di" bpmnElement="Task_open_timesheet">
    <dc:Bounds x="295" y="20" width="100" height="80" />
   </bpmndi:BPMNShape>
   <bpmndi:BPMNShape id="Task_submit_timesheet_di" bpmnElement="Task_submit_timesheet">
    <dc:Bounds x="465" y="20" width="100" height="80" />
   </bpmndi:BPMNShape>
   <bpmndi:BPMNShape id="Task_approve_project_lines_di" bpmnElement="Task_approve_project_lines">
    <dc:Bounds x="805" y="160" width="100" height="80" />
   </bpmndi:BPMNShape>
   <bpmndi:BPMNShape id="Task_approve_timesheet_di" bpmnElement="Task_approve_timesheet">
    <dc:Bounds x="1145" y="420" width="100" height="80" />
   </bpmndi:BPMNShape>
   <bpmndi:BPMNShape id="Task_return_timesheet_di" bpmnElement="Task_return_timesheet">
    <dc:Bounds x="1145" y="540" width="100" height="80" />
   </bpmndi:BPMNShape>
   <bpmndi:BPMNShape id="Task_reopen_timesheet_di" bpmnElement="Task_reopen_timesheet">
    <dc:Bounds x="1315" y="680" width="100" height="80" />
   </bpmndi:BPMNShape>
   <bpmndi:BPMNShape id="Gateway_approve_project_lines__if_di" bpmnElement="Gateway_approve_project_lines__if">
    <dc:Bounds x="660" y="175" width="50" height="50" />
   </bpmndi:BPMNShape>
   <bpmndi:BPMNShape id="Gateway_approve_project_lines__if_end_di" bpmnElement="Gateway_approve_project_lines__if_end">
    <dc:Bounds x="830" y="295" width="50" height="50" />
   </bpmndi:BPMNShape>
   <bpmndi:BPMNShape id="Gateway_timesheet_submitted__if_di" bpmnElement="Gateway_timesheet_submitted__if">
    <dc:Bounds x="1000" y="435" width="50" height="50" />
   </bpmndi:BPMNShape>
   <bpmndi:BPMNShape id="End_timesheet_returned_di" bpmnElement="End_timesheet_returned">
    <dc:Bounds x="1347" y="442" width="36" height="36" />
   </bpmndi:BPMNShape>
   <bpmndi:BPMNShape id="End_timesheet_superseded_di" bpmnElement="End_timesheet_superseded">
    <dc:Bounds x="1517" y="702" width="36" height="36" />
   </bpmndi:BPMNShape>
   <bpmndi:BPMNEdge id="Flow_Start_timesheet__Task_open_timesheet_di" bpmnElement="Flow_Start_timesheet__Task_open_timesheet">
    <di:waypoint x="193" y="60" />
    <di:waypoint x="295" y="60" />
   </bpmndi:BPMNEdge>
   <bpmndi:BPMNEdge id="Flow_Task_open_timesheet__Task_submit_timesheet_di" bpmnElement="Flow_Task_open_timesheet__Task_submit_timesheet">
    <di:waypoint x="395" y="60" />
    <di:waypoint x="465" y="60" />
   </bpmndi:BPMNEdge>
   <bpmndi:BPMNEdge id="Flow_Gateway_approve_project_lines__if__Task_approve_project_lines_di" bpmnElement="Flow_Gateway_approve_project_lines__if__Task_approve_project_lines">
    <di:waypoint x="710" y="200" />
    <di:waypoint x="805" y="200" />
   </bpmndi:BPMNEdge>
   <bpmndi:BPMNEdge id="Flow_Gateway_approve_project_lines__if__Gateway_approve_project_lines__if_end_di" bpmnElement="Flow_Gateway_approve_project_lines__if__Gateway_approve_project_lines__if_end">
    <di:waypoint x="710" y="200" />
    <di:waypoint x="805" y="200" />
    <di:waypoint x="805" y="320" />
    <di:waypoint x="830" y="320" />
   </bpmndi:BPMNEdge>
   <bpmndi:BPMNEdge id="Flow_Task_approve_project_lines__Gateway_approve_project_lines__if_end_di" bpmnElement="Flow_Task_approve_project_lines__Gateway_approve_project_lines__if_end">
    <di:waypoint x="855" y="240" />
    <di:waypoint x="855" y="360" />
    <di:waypoint x="855" y="360" />
    <di:waypoint x="855" y="345" />
   </bpmndi:BPMNEdge>
   <bpmndi:BPMNEdge id="Flow_Gateway_timesheet_submitted__if__Task_approve_timesheet_di" bpmnElement="Flow_Gateway_timesheet_submitted__if__Task_approve_timesheet">
    <di:waypoint x="1050" y="460" />
    <di:waypoint x="1145" y="460" />
   </bpmndi:BPMNEdge>
   <bpmndi:BPMNEdge id="Flow_Gateway_timesheet_submitted__if__Task_return_timesheet_di" bpmnElement="Flow_Gateway_timesheet_submitted__if__Task_return_timesheet">
    <di:waypoint x="1050" y="460" />
    <di:waypoint x="1120" y="460" />
    <di:waypoint x="1120" y="580" />
    <di:waypoint x="1145" y="580" />
   </bpmndi:BPMNEdge>
   <bpmndi:BPMNEdge id="Flow_Gateway_approve_project_lines__if_end__Gateway_timesheet_submitted__if_di" bpmnElement="Flow_Gateway_approve_project_lines__if_end__Gateway_timesheet_submitted__if">
    <di:waypoint x="880" y="320" />
    <di:waypoint x="975" y="320" />
    <di:waypoint x="975" y="460" />
    <di:waypoint x="1000" y="460" />
   </bpmndi:BPMNEdge>
   <bpmndi:BPMNEdge id="Flow_Task_submit_timesheet__Gateway_approve_project_lines__if_di" bpmnElement="Flow_Task_submit_timesheet__Gateway_approve_project_lines__if">
    <di:waypoint x="565" y="60" />
    <di:waypoint x="635" y="60" />
    <di:waypoint x="635" y="200" />
    <di:waypoint x="660" y="200" />
   </bpmndi:BPMNEdge>
   <bpmndi:BPMNEdge id="Flow_Task_approve_timesheet__Task_reopen_timesheet_di" bpmnElement="Flow_Task_approve_timesheet__Task_reopen_timesheet">
    <di:waypoint x="1245" y="460" />
    <di:waypoint x="1290" y="460" />
    <di:waypoint x="1290" y="720" />
    <di:waypoint x="1315" y="720" />
   </bpmndi:BPMNEdge>
   <bpmndi:BPMNEdge id="Flow_Task_return_timesheet__End_timesheet_returned_di" bpmnElement="Flow_Task_return_timesheet__End_timesheet_returned">
    <di:waypoint x="1245" y="580" />
    <di:waypoint x="1322" y="580" />
    <di:waypoint x="1322" y="460" />
    <di:waypoint x="1347" y="460" />
   </bpmndi:BPMNEdge>
   <bpmndi:BPMNEdge id="Flow_Task_reopen_timesheet__End_timesheet_superseded_di" bpmnElement="Flow_Task_reopen_timesheet__End_timesheet_superseded">
    <di:waypoint x="1415" y="720" />
    <di:waypoint x="1517" y="720" />
   </bpmndi:BPMNEdge>
  </bpmndi:BPMNPlane>
 </bpmndi:BPMNDiagram>
</bpmn:definitions>