sample-process-models/test/submit-invoice/submit-invoice.bpmn

327 lines
17 KiB
XML

<?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">
<bpmn:process id="Proccess_tlws0al" 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 Bamboo 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 Bamboo 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_1t2wqtp" />
<bpmn:sequenceFlow id="Flow_1wgjnl6" sourceRef="Activity_1t2wqtp" targetRef="Event_13o3qhm" />
<bpmn:businessRuleTask id="Activity_1t2wqtp" name="Check Match?">
<bpmn:extensionElements>
<spiffworkflow:calledDecisionId>Check_Amount</spiffworkflow:calledDecisionId>
<spiffworkflow:preScript>invoiceAmount = 10000</spiffworkflow:preScript>
</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 Approval Rejected">
<bpmn:incoming>Flow_0am2zl6</bpmn:incoming>
<bpmn:outgoing>Flow_16zu8rv</bpmn:outgoing>
</bpmn:intermediateThrowEvent>
<bpmn:intermediateThrowEvent id="Event_049kpe7" name="Invoice Approved">
<bpmn:incoming>Flow_15po8b6</bpmn:incoming>
<bpmn:outgoing>Flow_0w45gin</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:incoming>Flow_0w45gin</bpmn:incoming>
<bpmn:outgoing>Flow_0a7bzy1</bpmn:outgoing>
</bpmn:serviceTask>
<bpmn:sequenceFlow id="Flow_18gjso9" sourceRef="Activity_1hdxh4e" targetRef="Event_03t9lyz" />
<bpmn:exclusiveGateway id="Gateway_0eaocp0" name="Matchn?" default="Flow_0bfsldt">
<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="No" sourceRef="Gateway_0eaocp0" targetRef="Event_1x4b5bx">
<bpmn:conditionExpression>not(isMatch)</bpmn:conditionExpression>
</bpmn:sequenceFlow>
<bpmn:sequenceFlow id="Flow_0bfsldt" name="Yes" sourceRef="Gateway_0eaocp0" targetRef="Activity_1d3xl48" />
<bpmn:sequenceFlow id="Flow_0w45gin" sourceRef="Event_049kpe7" targetRef="Activity_0jewccr" />
<bpmn:endEvent id="Event_03qfuyf">
<bpmn:incoming>Flow_0a7bzy1</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: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:incoming>Flow_16zu8rv</bpmn:incoming>
<bpmn:outgoing>Flow_1mlodba</bpmn:outgoing>
</bpmn:exclusiveGateway>
<bpmn:sequenceFlow id="Flow_1mlodba" sourceRef="Gateway_0r4645z" targetRef="Activity_0yes9h3" />
<bpmn:sequenceFlow id="Flow_16zu8rv" sourceRef="Event_1x4b5bx" targetRef="Gateway_0r4645z" />
<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:sequenceFlow id="Flow_0a7bzy1" sourceRef="Activity_0jewccr" targetRef="Event_03qfuyf" />
<bpmn:endEvent id="Event_1dggzfv">
<bpmn:incoming>Flow_1bvgiwf</bpmn:incoming>
</bpmn:endEvent>
<bpmn:sequenceFlow id="Flow_1n259k2" sourceRef="Gateway_1x62lwb" targetRef="Event_1r9nmyo" />
<bpmn:intermediateThrowEvent id="Event_1r9nmyo" name="Invoice Rejection 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:process>
<bpmndi:BPMNDiagram id="BPMNDiagram_1">
<bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="Proccess_tlws0al">
<bpmndi:BPMNShape id="Activity_1we7w4j_di" bpmnElement="Activity_0yes9h3">
<dc:Bounds x="390" y="220" width="100" height="80" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="Gateway_0r4645z_di" bpmnElement="Gateway_0r4645z" isMarkerVisible="true">
<dc:Bounds x="305" y="235" width="50" height="50" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="Event_08s3g0c_di" bpmnElement="Event_08s3g0c">
<dc:Bounds x="232" y="242" width="36" height="36" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="Activity_0kzge8i_di" bpmnElement="Activity_1hdxh4e">
<dc:Bounds x="530" y="220" width="100" height="80" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="Event_03t9lyz_di" bpmnElement="Event_03t9lyz">
<dc:Bounds x="662" y="242" width="36" height="36" />
<bpmndi:BPMNLabel>
<dc:Bounds x="636" y="285" width="88" height="14" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="Event_1x4b5bx_di" bpmnElement="Event_1x4b5bx">
<dc:Bounds x="762" y="82" width="36" height="36" />
<bpmndi:BPMNLabel>
<dc:Bounds x="740" y="125" width="81" height="27" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="Gateway_0eaocp0_di" bpmnElement="Gateway_0eaocp0" isMarkerVisible="true">
<dc:Bounds x="855" y="235" width="50" height="50" />
<bpmndi:BPMNLabel>
<dc:Bounds x="859" y="292" width="43" height="14" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="Activity_0j0s0xr_di" bpmnElement="Activity_1d3xl48">
<dc:Bounds x="940" y="220" width="100" height="80" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="Gateway_1x62lwb_di" bpmnElement="Gateway_1x62lwb" isMarkerVisible="true">
<dc:Bounds x="1085" y="235" width="50" height="50" />
<bpmndi:BPMNLabel>
<dc:Bounds x="1084" y="211" width="53" height="14" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="Event_1r9nmyo_di" bpmnElement="Event_1r9nmyo">
<dc:Bounds x="1092" y="332" width="36" height="36" />
<bpmndi:BPMNLabel>
<dc:Bounds x="996.5" y="336" width="85" height="27" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="Event_1dggzfv_di" bpmnElement="Event_1dggzfv">
<dc:Bounds x="1192" y="332" width="36" height="36" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="Event_049kpe7_di" bpmnElement="Event_049kpe7">
<dc:Bounds x="1192" y="242" width="36" height="36" />
<bpmndi:BPMNLabel>
<dc:Bounds x="1168" y="285" width="85" height="14" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="Activity_051lqwz_di" bpmnElement="Activity_0jewccr">
<dc:Bounds x="1280" y="220" width="100" height="80" />
<bpmndi:BPMNLabel />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="Event_03qfuyf_di" bpmnElement="Event_03qfuyf">
<dc:Bounds x="1422" y="242" width="36" height="36" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="Activity_0kd0p6j_di" bpmnElement="Activity_1p94uz7">
<dc:Bounds x="730" y="220" width="100" height="80" />
<bpmndi:BPMNLabel />
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge id="Flow_18gjso9_di" bpmnElement="Flow_18gjso9">
<di:waypoint x="630" y="260" />
<di:waypoint x="662" y="260" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="Flow_0am2zl6_di" bpmnElement="Flow_0am2zl6">
<di:waypoint x="880" y="235" />
<di:waypoint x="880" y="100" />
<di:waypoint x="798" y="100" />
<bpmndi:BPMNLabel>
<dc:Bounds x="888" y="164" width="15" height="14" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="Flow_0bfsldt_di" bpmnElement="Flow_0bfsldt">
<di:waypoint x="905" y="260" />
<di:waypoint x="940" y="260" />
<bpmndi:BPMNLabel>
<dc:Bounds x="907" y="246" width="18" height="14" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="Flow_0w45gin_di" bpmnElement="Flow_0w45gin">
<di:waypoint x="1228" y="260" />
<di:waypoint x="1280" y="260" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="Flow_1c0gxtj_di" bpmnElement="Flow_1c0gxtj">
<di:waypoint x="698" y="260" />
<di:waypoint x="730" y="260" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="Flow_1nktb7x_di" bpmnElement="Flow_1nktb7x">
<di:waypoint x="268" y="260" />
<di:waypoint x="305" y="260" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="Flow_1dsayaa_di" bpmnElement="Flow_1dsayaa">
<di:waypoint x="830" y="260" />
<di:waypoint x="855" y="260" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="Flow_07p0ofh_di" bpmnElement="Flow_07p0ofh">
<di:waypoint x="490" y="260" />
<di:waypoint x="530" y="260" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="Flow_060ixxf_di" bpmnElement="Flow_060ixxf">
<di:waypoint x="1040" y="260" />
<di:waypoint x="1085" y="260" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="Flow_1mlodba_di" bpmnElement="Flow_1mlodba">
<di:waypoint x="355" y="260" />
<di:waypoint x="390" y="260" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="Flow_16zu8rv_di" bpmnElement="Flow_16zu8rv">
<di:waypoint x="762" y="100" />
<di:waypoint x="330" y="100" />
<di:waypoint x="330" y="235" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="Flow_15po8b6_di" bpmnElement="Flow_15po8b6">
<di:waypoint x="1135" y="260" />
<di:waypoint x="1192" y="260" />
<bpmndi:BPMNLabel>
<dc:Bounds x="1155" y="242" width="18" height="14" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="Flow_0a7bzy1_di" bpmnElement="Flow_0a7bzy1">
<di:waypoint x="1380" y="260" />
<di:waypoint x="1422" y="260" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="Flow_1n259k2_di" bpmnElement="Flow_1n259k2">
<di:waypoint x="1110" y="285" />
<di:waypoint x="1110" y="332" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="Flow_1bvgiwf_di" bpmnElement="Flow_1bvgiwf">
<di:waypoint x="1128" y="350" />
<di:waypoint x="1192" y="350" />
</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: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_19io0i1_di" bpmnElement="Activity_1t2wqtp">
<dc:Bounds x="690" 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="690" y="230" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="Flow_1wgjnl6_di" bpmnElement="Flow_1wgjnl6">
<di:waypoint x="790" y="230" />
<di:waypoint x="872" y="230" />
</bpmndi:BPMNEdge>
</bpmndi:BPMNPlane>
</bpmndi:BPMNDiagram>
</bpmn:definitions>