336 lines
18 KiB
Plaintext
Raw Normal View History

<?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:spiffworkflow="http://spiffworkflow.org/bpmn/schema/1.0/core" id="Definitions_96f6665" targetNamespace="http://bpmn.io/schema/bpmn" exporter="Camunda Modeler" exporterVersion="5.4.2">
2022-11-15 12:31:54 -05:00
<bpmn:process id="Proccess_submit_invoice_1" isExecutable="true">
<bpmn:userTask id="Activity_0yes9h3" name="Submit Invoice">
<bpmn:extensionElements>
<spiffworkflow:properties>
<spiffworkflow:property name="formUiSchemaFilename" value="Submit-the-invoice_UISchema.json" />
<spiffworkflow:property name="formJsonSchemaFilename" value="Submit-the-invoice_JSONSchema.json" />
</spiffworkflow:properties>
</bpmn:extensionElements>
<bpmn:incoming>Flow_1mlodba</bpmn:incoming>
<bpmn:outgoing>Flow_07p0ofh</bpmn:outgoing>
</bpmn:userTask>
<bpmn:serviceTask id="Activity_1hdxh4e" name="Save Invoice Date to DyamoDB">
<bpmn:extensionElements>
<spiffworkflow:serviceTaskOperator id="aws/AddDynamoItem" resultVariable="resp_AddDynamoItem">
<spiffworkflow:parameters>
<spiffworkflow:parameter id="item_data" type="any" value="{ &#34;ContributorName&#34;: contributorName, &#34;ContributorId&#34;: contributorId, &#34;InvoiceId&#34;: invoiceId, &#34;InvoiceAmount&#34;: invoiceAmount, &#34;InvoiceCurrency&#34;: invoiceCurrency, &#34;DueDate&#34;: dueDate }" />
<spiffworkflow:parameter id="table_name" type="str" value="&#34;Invoice&#34;" />
</spiffworkflow:parameters>
</spiffworkflow:serviceTaskOperator>
</bpmn:extensionElements>
<bpmn:incoming>Flow_07p0ofh</bpmn:incoming>
<bpmn:outgoing>Flow_18gjso9</bpmn:outgoing>
</bpmn:serviceTask>
<bpmn:intermediateThrowEvent id="Event_03t9lyz" name="Invoice Submitted">
<bpmn:incoming>Flow_18gjso9</bpmn:incoming>
<bpmn:outgoing>Flow_1c0gxtj</bpmn:outgoing>
</bpmn:intermediateThrowEvent>
<bpmn:subProcess id="Activity_1p94uz7" name="Compare Submitted with Bamboo Salary">
<bpmn:incoming>Flow_1c0gxtj</bpmn:incoming>
<bpmn:outgoing>Flow_1dsayaa</bpmn:outgoing>
<bpmn:serviceTask id="Activity_0vjn1x3" name="Get Annual Salary">
<bpmn:extensionElements>
<spiffworkflow:serviceTaskOperator id="bamboohr/GetPayRate" resultVariable="resp_GetPayRate">
<spiffworkflow:parameters>
<spiffworkflow:parameter id="employee_id" type="str" value="109" />
</spiffworkflow:parameters>
</spiffworkflow:serviceTaskOperator>
</bpmn:extensionElements>
<bpmn:incoming>Flow_1wzdtpe</bpmn:incoming>
<bpmn:outgoing>Flow_1xy0mys</bpmn:outgoing>
</bpmn:serviceTask>
<bpmn:startEvent id="Event_061yjto">
<bpmn:outgoing>Flow_1wzdtpe</bpmn:outgoing>
</bpmn:startEvent>
<bpmn:sequenceFlow id="Flow_1wzdtpe" sourceRef="Event_061yjto" targetRef="Activity_0vjn1x3" />
<bpmn:endEvent id="Event_13o3qhm">
<bpmn:incoming>Flow_1wgjnl6</bpmn:incoming>
</bpmn:endEvent>
<bpmn:sequenceFlow id="Flow_1xy0mys" sourceRef="Activity_0vjn1x3" targetRef="Activity_0t4r74j" />
<bpmn:scriptTask id="Activity_0t4r74j" name="Convert Annual Salary" scriptFormat="python">
<bpmn:extensionElements>
<spiffworkflow:unitTests>
<spiffworkflow:unitTest id="ScriptUnitTest_070ewva">
<spiffworkflow:inputJson>{"resp_BambooPayRate": {"amount": "10000"}}</spiffworkflow:inputJson>
<spiffworkflow:expectedOutputJson>{"annual_salary":10000,"annual_salary_str":"10000","resp_BambooPayRate":{"amount":"10000"}}</spiffworkflow:expectedOutputJson>
</spiffworkflow:unitTest>
</spiffworkflow:unitTests>
</bpmn:extensionElements>
<bpmn:incoming>Flow_1xy0mys</bpmn:incoming>
<bpmn:outgoing>Flow_1fide0x</bpmn:outgoing>
<bpmn:script>annual_salary_str = resp_GetPayRate["amount"]
annual_salary = float(annual_salary_str)</bpmn:script>
</bpmn:scriptTask>
<bpmn:sequenceFlow id="Flow_1fide0x" sourceRef="Activity_0t4r74j" targetRef="Activity_0j1khkj" />
<bpmn:sequenceFlow id="Flow_1wgjnl6" sourceRef="Activity_0j1khkj" targetRef="Event_13o3qhm" />
<bpmn:businessRuleTask id="Activity_0j1khkj" name="Check Match">
<bpmn:extensionElements>
<spiffworkflow:calledDecisionId>Check_Amount_Documentation_Submit_Invoice</spiffworkflow:calledDecisionId>
</bpmn:extensionElements>
<bpmn:incoming>Flow_1fide0x</bpmn:incoming>
<bpmn:outgoing>Flow_1wgjnl6</bpmn:outgoing>
</bpmn:businessRuleTask>
</bpmn:subProcess>
<bpmn:intermediateThrowEvent id="Event_1x4b5bx" name="Invoice Rejected">
<bpmn:incoming>Flow_0am2zl6</bpmn:incoming>
<bpmn:outgoing>Flow_1b9tu4z</bpmn:outgoing>
</bpmn:intermediateThrowEvent>
<bpmn:intermediateThrowEvent id="Event_049kpe7" name="Invoice Approved by Finance">
<bpmn:incoming>Flow_15po8b6</bpmn:incoming>
<bpmn:outgoing>Flow_0373kgo</bpmn:outgoing>
</bpmn:intermediateThrowEvent>
<bpmn:serviceTask id="Activity_0jewccr" name="Create Invoice in Xero">
<bpmn:extensionElements>
<spiffworkflow:serviceTaskOperator id="xero/CreateInvoice" resultVariable="resp_xeroCreateInvoice">
<spiffworkflow:parameters>
<spiffworkflow:parameter id="access_token" type="any" value="&#34;secret:xero/OAuth&#34;" />
<spiffworkflow:parameter id="amount" type="str" value="invoiceAmount" />
<spiffworkflow:parameter id="contact_email" type="str" value="&#39;harmeet@status.im&#39;" />
<spiffworkflow:parameter id="contact_name" type="str" value="contributorName" />
<spiffworkflow:parameter id="description" type="str" value="&#39;Monthly pay&#39;" />
</spiffworkflow:parameters>
</spiffworkflow:serviceTaskOperator>
</bpmn:extensionElements>
</bpmn:serviceTask>
<bpmn:sequenceFlow id="Flow_18gjso9" sourceRef="Activity_1hdxh4e" targetRef="Event_03t9lyz" />
<bpmn:exclusiveGateway id="Gateway_0eaocp0" name="Match?" default="Flow_0am2zl6">
<bpmn:incoming>Flow_1dsayaa</bpmn:incoming>
<bpmn:outgoing>Flow_0am2zl6</bpmn:outgoing>
<bpmn:outgoing>Flow_0bfsldt</bpmn:outgoing>
</bpmn:exclusiveGateway>
<bpmn:sequenceFlow id="Flow_0am2zl6" name="Yes" sourceRef="Gateway_0eaocp0" targetRef="Event_1x4b5bx" />
<bpmn:sequenceFlow id="Flow_0bfsldt" name="No" sourceRef="Gateway_0eaocp0" targetRef="Activity_1d3xl48">
<bpmn:conditionExpression>not(isMatch)</bpmn:conditionExpression>
</bpmn:sequenceFlow>
<bpmn:endEvent id="Event_03qfuyf">
<bpmn:incoming>Flow_0373kgo</bpmn:incoming>
</bpmn:endEvent>
<bpmn:sequenceFlow id="Flow_1c0gxtj" sourceRef="Event_03t9lyz" targetRef="Activity_1p94uz7" />
<bpmn:startEvent id="Event_08s3g0c">
<bpmn:outgoing>Flow_1nktb7x</bpmn:outgoing>
</bpmn:startEvent>
<bpmn:sequenceFlow id="Flow_1nktb7x" sourceRef="Event_08s3g0c" targetRef="Gateway_0r4645z" />
<bpmn:sequenceFlow id="Flow_1dsayaa" sourceRef="Activity_1p94uz7" targetRef="Gateway_0eaocp0" />
<bpmn:sequenceFlow id="Flow_07p0ofh" sourceRef="Activity_0yes9h3" targetRef="Activity_1hdxh4e" />
<bpmn:sequenceFlow id="Flow_060ixxf" sourceRef="Activity_1d3xl48" targetRef="Gateway_1x62lwb" />
<bpmn:userTask id="Activity_1d3xl48" name="Get Finance Approval">
<bpmn:extensionElements>
<spiffworkflow:properties>
<spiffworkflow:property name="formJsonSchemaFilename" value="invoice-approval_JSONSchema.json" />
<spiffworkflow:property name="formUiSchemaFilename" value="invoice-approval_UISchema.json" />
</spiffworkflow:properties>
</bpmn:extensionElements>
<bpmn:incoming>Flow_0bfsldt</bpmn:incoming>
<bpmn:outgoing>Flow_060ixxf</bpmn:outgoing>
</bpmn:userTask>
<bpmn:exclusiveGateway id="Gateway_0r4645z">
<bpmn:incoming>Flow_1nktb7x</bpmn:incoming>
<bpmn:outgoing>Flow_1mlodba</bpmn:outgoing>
</bpmn:exclusiveGateway>
<bpmn:sequenceFlow id="Flow_1mlodba" sourceRef="Gateway_0r4645z" targetRef="Activity_0yes9h3" />
<bpmn:exclusiveGateway id="Gateway_1x62lwb" name="Approved?" default="Flow_15po8b6">
<bpmn:incoming>Flow_060ixxf</bpmn:incoming>
<bpmn:outgoing>Flow_15po8b6</bpmn:outgoing>
<bpmn:outgoing>Flow_1n259k2</bpmn:outgoing>
</bpmn:exclusiveGateway>
<bpmn:sequenceFlow id="Flow_15po8b6" name="Yes" sourceRef="Gateway_1x62lwb" targetRef="Event_049kpe7">
<bpmn:conditionExpression>isTrue</bpmn:conditionExpression>
</bpmn:sequenceFlow>
<bpmn:endEvent id="Event_1dggzfv">
<bpmn:incoming>Flow_1bvgiwf</bpmn:incoming>
</bpmn:endEvent>
<bpmn:sequenceFlow id="Flow_1n259k2" name="No" sourceRef="Gateway_1x62lwb" targetRef="Event_1r9nmyo">
<bpmn:conditionExpression>not(isMatch)</bpmn:conditionExpression>
</bpmn:sequenceFlow>
<bpmn:intermediateThrowEvent id="Event_1r9nmyo" name="Invoice Rejected by Finiance">
<bpmn:incoming>Flow_1n259k2</bpmn:incoming>
<bpmn:outgoing>Flow_1bvgiwf</bpmn:outgoing>
</bpmn:intermediateThrowEvent>
<bpmn:sequenceFlow id="Flow_1bvgiwf" sourceRef="Event_1r9nmyo" targetRef="Event_1dggzfv" />
<bpmn:sequenceFlow id="Flow_0373kgo" sourceRef="Event_049kpe7" targetRef="Event_03qfuyf" />
<bpmn:endEvent id="Event_0mf9je8">
<bpmn:incoming>Flow_1b9tu4z</bpmn:incoming>
</bpmn:endEvent>
<bpmn:sequenceFlow id="Flow_1b9tu4z" sourceRef="Event_1x4b5bx" targetRef="Event_0mf9je8" />
</bpmn:process>
<bpmndi:BPMNDiagram id="BPMNDiagram_1">
<bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="Proccess_submit_invoice_1">
<bpmndi:BPMNShape id="Activity_1we7w4j_di" bpmnElement="Activity_0yes9h3">
<dc:Bounds x="390" y="220" width="100" height="80" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="Activity_0kzge8i_di" bpmnElement="Activity_1hdxh4e">
<dc:Bounds x="550" y="220" width="100" height="80" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="Event_03t9lyz_di" bpmnElement="Event_03t9lyz">
<dc:Bounds x="702" y="242" width="36" height="36" />
<bpmndi:BPMNLabel>
<dc:Bounds x="676" y="285" width="88" height="14" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="Event_1r9nmyo_di" bpmnElement="Event_1r9nmyo">
<dc:Bounds x="1252" y="352" width="36" height="36" />
<bpmndi:BPMNLabel>
<dc:Bounds x="1158" y="360" width="82" height="27" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="Event_1dggzfv_di" bpmnElement="Event_1dggzfv">
<dc:Bounds x="1362" y="352" width="36" height="36" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="Event_0mf9je8_di" bpmnElement="Event_0mf9je8">
<dc:Bounds x="1062" y="352" width="36" height="36" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="Activity_0kd0p6j_di" bpmnElement="Activity_1p94uz7">
<dc:Bounds x="780" y="220" width="100" height="80" />
<bpmndi:BPMNLabel />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="Event_1x4b5bx_di" bpmnElement="Event_1x4b5bx">
<dc:Bounds x="952" y="352" width="36" height="36" />
<bpmndi:BPMNLabel>
<dc:Bounds x="929" y="393" width="82" height="14" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="Event_049kpe7_di" bpmnElement="Event_049kpe7">
<dc:Bounds x="1362" y="242" width="36" height="36" />
<bpmndi:BPMNLabel>
<dc:Bounds x="1338" y="285" width="85" height="27" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="Activity_051lqwz_di" bpmnElement="Activity_0jewccr">
<dc:Bounds x="1430" y="110" width="100" height="80" />
<bpmndi:BPMNLabel />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="Gateway_0eaocp0_di" bpmnElement="Gateway_0eaocp0" isMarkerVisible="true">
<dc:Bounds x="945" y="235" width="50" height="50" />
<bpmndi:BPMNLabel>
<dc:Bounds x="951" y="211" width="37" height="14" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="Event_03qfuyf_di" bpmnElement="Event_03qfuyf">
<dc:Bounds x="1462" y="242" width="36" height="36" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="Event_08s3g0c_di" bpmnElement="Event_08s3g0c">
<dc:Bounds x="152" y="242" width="36" height="36" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="Activity_0j0s0xr_di" bpmnElement="Activity_1d3xl48">
<dc:Bounds x="1080" y="220" width="100" height="80" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="Gateway_0r4645z_di" bpmnElement="Gateway_0r4645z" isMarkerVisible="true">
<dc:Bounds x="255" y="235" width="50" height="50" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="Gateway_1x62lwb_di" bpmnElement="Gateway_1x62lwb" isMarkerVisible="true">
<dc:Bounds x="1245" y="235" width="50" height="50" />
<bpmndi:BPMNLabel>
<dc:Bounds x="1243" y="211" width="54" height="14" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge id="Flow_18gjso9_di" bpmnElement="Flow_18gjso9">
<di:waypoint x="650" y="260" />
<di:waypoint x="702" y="260" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="Flow_0am2zl6_di" bpmnElement="Flow_0am2zl6">
<di:waypoint x="970" y="285" />
<di:waypoint x="970" y="352" />
<bpmndi:BPMNLabel>
<dc:Bounds x="945" y="310" width="18" height="14" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="Flow_0bfsldt_di" bpmnElement="Flow_0bfsldt">
<di:waypoint x="995" y="260" />
<di:waypoint x="1080" y="260" />
<bpmndi:BPMNLabel>
<dc:Bounds x="1015" y="246" width="15" height="14" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="Flow_1c0gxtj_di" bpmnElement="Flow_1c0gxtj">
<di:waypoint x="738" y="260" />
<di:waypoint x="780" y="260" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="Flow_1nktb7x_di" bpmnElement="Flow_1nktb7x">
<di:waypoint x="188" y="260" />
<di:waypoint x="255" y="260" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="Flow_1dsayaa_di" bpmnElement="Flow_1dsayaa">
<di:waypoint x="880" y="260" />
<di:waypoint x="945" y="260" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="Flow_07p0ofh_di" bpmnElement="Flow_07p0ofh">
<di:waypoint x="490" y="260" />
<di:waypoint x="550" y="260" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="Flow_060ixxf_di" bpmnElement="Flow_060ixxf">
<di:waypoint x="1180" y="260" />
<di:waypoint x="1245" y="260" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="Flow_1mlodba_di" bpmnElement="Flow_1mlodba">
<di:waypoint x="305" y="260" />
<di:waypoint x="390" y="260" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="Flow_15po8b6_di" bpmnElement="Flow_15po8b6">
<di:waypoint x="1295" y="260" />
<di:waypoint x="1362" y="260" />
<bpmndi:BPMNLabel>
<dc:Bounds x="1320" y="242" width="18" height="14" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="Flow_1n259k2_di" bpmnElement="Flow_1n259k2">
<di:waypoint x="1270" y="285" />
<di:waypoint x="1270" y="352" />
<bpmndi:BPMNLabel>
<dc:Bounds x="1278" y="318" width="15" height="14" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="Flow_1bvgiwf_di" bpmnElement="Flow_1bvgiwf">
<di:waypoint x="1288" y="370" />
<di:waypoint x="1362" y="370" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="Flow_0373kgo_di" bpmnElement="Flow_0373kgo">
<di:waypoint x="1398" y="260" />
<di:waypoint x="1462" y="260" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="Flow_1b9tu4z_di" bpmnElement="Flow_1b9tu4z">
<di:waypoint x="988" y="370" />
<di:waypoint x="1062" y="370" />
</bpmndi:BPMNEdge>
</bpmndi:BPMNPlane>
</bpmndi:BPMNDiagram>
<bpmndi:BPMNDiagram id="BPMNDiagram_162off7">
<bpmndi:BPMNPlane id="BPMNPlane_1l04ngk" bpmnElement="Activity_1p94uz7">
<bpmndi:BPMNShape id="Activity_0afx55v_di" bpmnElement="Activity_0vjn1x3">
<dc:Bounds x="350" y="190" width="100" height="80" />
<bpmndi:BPMNLabel />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="Event_061yjto_di" bpmnElement="Event_061yjto">
<dc:Bounds x="222" y="212" width="36" height="36" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="Event_13o3qhm_di" bpmnElement="Event_13o3qhm">
<dc:Bounds x="872" y="212" width="36" height="36" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="BPMNShape_15hij05" bpmnElement="Activity_0t4r74j">
<dc:Bounds x="510" y="190" width="100" height="80" />
<bpmndi:BPMNLabel />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="Activity_19c43pl_di" bpmnElement="Activity_0j1khkj">
<dc:Bounds x="680" y="190" width="100" height="80" />
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge id="Flow_1wzdtpe_di" bpmnElement="Flow_1wzdtpe">
<di:waypoint x="258" y="230" />
<di:waypoint x="350" y="230" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="Flow_1xy0mys_di" bpmnElement="Flow_1xy0mys">
<di:waypoint x="450" y="230" />
<di:waypoint x="510" y="230" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="Flow_1fide0x_di" bpmnElement="Flow_1fide0x">
<di:waypoint x="610" y="230" />
<di:waypoint x="680" y="230" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="Flow_1wgjnl6_di" bpmnElement="Flow_1wgjnl6">
<di:waypoint x="780" y="230" />
<di:waypoint x="872" y="230" />
</bpmndi:BPMNEdge>
</bpmndi:BPMNPlane>
</bpmndi:BPMNDiagram>
</bpmn:definitions>