mirror of
https://github.com/sartography/sample-process-models.git
synced 2025-02-24 05:38:06 +00:00
205 lines
12 KiB
XML
205 lines
12 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="3.0.0-dev">
|
|
<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: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="{ "ContributorName": contributorName, "ContributorId": contributorId, "InvoiceId": invoiceId, "InvoiceAmount": invoiceAmount, "InvoiceCurrency": invoiceCurrency, "DueDate": dueDate }" />
|
|
<spiffworkflow:parameter id="table_name" type="str" value=""Invoice"" />
|
|
</spiffworkflow:parameters>
|
|
</spiffworkflow:serviceTaskOperator>
|
|
</bpmn:extensionElements>
|
|
</bpmn:serviceTask>
|
|
<bpmn:serviceTask id="Activity_00fpxb0" name="Save PDF Document to S3">
|
|
<bpmn:extensionElements>
|
|
<spiffworkflow:serviceTaskOperator id="aws/UploadFileData" resultVariable="resp_UploadFileData">
|
|
<spiffworkflow:parameters>
|
|
<spiffworkflow:parameter id="bucket" type="str" value="'sartography-status-pdfs'" />
|
|
<spiffworkflow:parameter id="file_data" type="str" value="filesAccept" />
|
|
<spiffworkflow:parameter id="object_name" type="str" value="'Invoice_xxxx.pdf'" />
|
|
</spiffworkflow:parameters>
|
|
</spiffworkflow:serviceTaskOperator>
|
|
<spiffworkflow:postScript />
|
|
</bpmn:extensionElements>
|
|
</bpmn:serviceTask>
|
|
<bpmn:scriptTask id="Activity_0y8b7ok" name="Delete Temp File">
|
|
<bpmn:script>del(filesAccept)</bpmn:script>
|
|
</bpmn:scriptTask>
|
|
<bpmn:serviceTask id="Activity_1lu7ioj" name="Send Waku Message: Invoice Submitted">
|
|
<bpmn:extensionElements>
|
|
<spiffworkflow:serviceTaskOperator id="waku/SendMessage" resultVariable="wr_SendInvocieSubmitted">
|
|
<spiffworkflow:parameters>
|
|
<spiffworkflow:parameter id="message" type="str" value=""Invocie submitted"" />
|
|
<spiffworkflow:parameter id="message_type" type="str" value=""wakuext_sendOneToOneMessage"" />
|
|
<spiffworkflow:parameter id="recipient" type="str" value=""0x04622cf750e9f79e60546258bebd4be274f75720b16862bb0c496aaeab746b6fbe897f956b2b08152bc3def5297bed95986a5211ae1a34491d35f51f69713cbf9d"" />
|
|
</spiffworkflow:parameters>
|
|
</spiffworkflow:serviceTaskOperator>
|
|
</bpmn:extensionElements>
|
|
</bpmn:serviceTask>
|
|
<bpmn:intermediateThrowEvent id="Event_03t9lyz" name="Invoice Submitted" />
|
|
<bpmn:subProcess id="Activity_1p94uz7" name="Compare Submitted with Bamboo Salary">
|
|
<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:outgoing>Flow_0wa6brf</bpmn:outgoing>
|
|
</bpmn:serviceTask>
|
|
<bpmn:scriptTask id="Activity_1s9t7oz" name="Set 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_0wa6brf</bpmn:incoming>
|
|
<bpmn:outgoing>Flow_1j5gzff</bpmn:outgoing>
|
|
<bpmn:script>annual_salary_str = resp_GetPayRate["amount"]
|
|
annual_salary = float(annual_salary_str)</bpmn:script>
|
|
</bpmn:scriptTask>
|
|
<bpmn:sequenceFlow id="Flow_1j5gzff" sourceRef="Activity_1s9t7oz" targetRef="Activity_1idn241" />
|
|
<bpmn:businessRuleTask id="Activity_1idn241" name="Check Amounts">
|
|
<bpmn:extensionElements>
|
|
<spiffworkflow:calledDecisionId>Check_Amounts</spiffworkflow:calledDecisionId>
|
|
</bpmn:extensionElements>
|
|
<bpmn:incoming>Flow_1j5gzff</bpmn:incoming>
|
|
</bpmn:businessRuleTask>
|
|
<bpmn:sequenceFlow id="Flow_0wa6brf" sourceRef="Activity_0vjn1x3" targetRef="Activity_1s9t7oz" />
|
|
</bpmn:subProcess>
|
|
<bpmn:intermediateThrowEvent id="Event_1x4b5bx" name="Invoice Approval Rejected" />
|
|
<bpmn:intermediateThrowEvent id="Event_049kpe7" name="Invoice Approved" />
|
|
<bpmn:startEvent id="Event_1t15ahv" />
|
|
<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=""secret:xero/OAuth"" />
|
|
<spiffworkflow:parameter id="amount" type="str" value="invoiceAmount" />
|
|
<spiffworkflow:parameter id="contact_email" type="str" value="'harmeet@status.im'" />
|
|
<spiffworkflow:parameter id="contact_name" type="str" value="contributorName" />
|
|
<spiffworkflow:parameter id="description" type="str" value="'Monthly pay'" />
|
|
</spiffworkflow:parameters>
|
|
</spiffworkflow:serviceTaskOperator>
|
|
</bpmn:extensionElements>
|
|
</bpmn:serviceTask>
|
|
<bpmn:serviceTask id="Activity_12nu7wk" 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:serviceTask>
|
|
<bpmn:scriptTask id="Activity_00amiia" name="Set 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:script>annual_salary_str = resp_GetPayRate["amount"]
|
|
annual_salary = float(annual_salary_str)</bpmn:script>
|
|
</bpmn:scriptTask>
|
|
<bpmn:businessRuleTask id="Activity_123qmhe" name="Check Amounts">
|
|
<bpmn:extensionElements>
|
|
<spiffworkflow:calledDecisionId>Check_Amounts</spiffworkflow:calledDecisionId>
|
|
</bpmn:extensionElements>
|
|
</bpmn:businessRuleTask>
|
|
</bpmn:process>
|
|
<bpmndi:BPMNDiagram id="BPMNDiagram_1">
|
|
<bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="Proccess_tlws0al">
|
|
<bpmndi:BPMNShape id="Activity_0kzge8i_di" bpmnElement="Activity_1hdxh4e">
|
|
<dc:Bounds x="440" y="580" width="100" height="80" />
|
|
</bpmndi:BPMNShape>
|
|
<bpmndi:BPMNShape id="Activity_1mjhyvs_di" bpmnElement="Activity_00fpxb0">
|
|
<dc:Bounds x="580" y="580" width="100" height="80" />
|
|
</bpmndi:BPMNShape>
|
|
<bpmndi:BPMNShape id="Activity_0i29no8_di" bpmnElement="Activity_0y8b7ok">
|
|
<dc:Bounds x="710" y="580" width="100" height="80" />
|
|
</bpmndi:BPMNShape>
|
|
<bpmndi:BPMNShape id="Activity_1m5hrik_di" bpmnElement="Activity_1lu7ioj">
|
|
<dc:Bounds x="860" y="580" width="100" height="80" />
|
|
</bpmndi:BPMNShape>
|
|
<bpmndi:BPMNShape id="Event_03t9lyz_di" bpmnElement="Event_03t9lyz">
|
|
<dc:Bounds x="1012" y="602" width="36" height="36" />
|
|
<bpmndi:BPMNLabel>
|
|
<dc:Bounds x="987" y="645" width="88" height="14" />
|
|
</bpmndi:BPMNLabel>
|
|
</bpmndi:BPMNShape>
|
|
<bpmndi:BPMNShape id="Event_1t15ahv_di" bpmnElement="Event_1t15ahv">
|
|
<dc:Bounds x="132" y="159" width="36" height="36" />
|
|
</bpmndi:BPMNShape>
|
|
<bpmndi:BPMNShape id="BPMNShape_1ullu4q" bpmnElement="Activity_12nu7wk">
|
|
<dc:Bounds x="1220" y="580" width="100" height="80" />
|
|
</bpmndi:BPMNShape>
|
|
<bpmndi:BPMNShape id="BPMNShape_1i3tn4m" bpmnElement="Activity_123qmhe">
|
|
<dc:Bounds x="1460" y="580" width="100" height="80" />
|
|
</bpmndi:BPMNShape>
|
|
<bpmndi:BPMNShape id="BPMNShape_0w5h19r" bpmnElement="Activity_00amiia">
|
|
<dc:Bounds x="1340" y="580" width="100" height="80" />
|
|
</bpmndi:BPMNShape>
|
|
<bpmndi:BPMNShape id="Event_1x4b5bx_di" bpmnElement="Event_1x4b5bx">
|
|
<dc:Bounds x="1602" y="592" width="36" height="36" />
|
|
<bpmndi:BPMNLabel>
|
|
<dc:Bounds x="1580" y="635" width="81" height="27" />
|
|
</bpmndi:BPMNLabel>
|
|
</bpmndi:BPMNShape>
|
|
<bpmndi:BPMNShape id="Event_049kpe7_di" bpmnElement="Event_049kpe7">
|
|
<dc:Bounds x="1712" y="592" width="36" height="36" />
|
|
<bpmndi:BPMNLabel>
|
|
<dc:Bounds x="1688" y="635" width="85" height="14" />
|
|
</bpmndi:BPMNLabel>
|
|
</bpmndi:BPMNShape>
|
|
<bpmndi:BPMNShape id="Activity_051lqwz_di" bpmnElement="Activity_0jewccr">
|
|
<dc:Bounds x="1810" y="580" width="100" height="80" />
|
|
<bpmndi:BPMNLabel />
|
|
</bpmndi:BPMNShape>
|
|
<bpmndi:BPMNShape id="Activity_1we7w4j_di" bpmnElement="Activity_0yes9h3">
|
|
<dc:Bounds x="300" y="580" width="100" height="80" />
|
|
</bpmndi:BPMNShape>
|
|
<bpmndi:BPMNShape id="Activity_0kd0p6j_di" bpmnElement="Activity_1p94uz7">
|
|
<dc:Bounds x="1090" y="580" width="100" height="80" />
|
|
<bpmndi:BPMNLabel />
|
|
</bpmndi:BPMNShape>
|
|
</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="Activity_1o0ktq1_di" bpmnElement="Activity_1s9t7oz">
|
|
<dc:Bounds x="510" y="190" width="100" height="80" />
|
|
</bpmndi:BPMNShape>
|
|
<bpmndi:BPMNShape id="Activity_0uvbn2c_di" bpmnElement="Activity_1idn241">
|
|
<dc:Bounds x="670" y="190" width="100" height="80" />
|
|
</bpmndi:BPMNShape>
|
|
<bpmndi:BPMNEdge id="Flow_1j5gzff_di" bpmnElement="Flow_1j5gzff">
|
|
<di:waypoint x="610" y="230" />
|
|
<di:waypoint x="670" y="230" />
|
|
</bpmndi:BPMNEdge>
|
|
<bpmndi:BPMNEdge id="Flow_0wa6brf_di" bpmnElement="Flow_0wa6brf">
|
|
<di:waypoint x="450" y="230" />
|
|
<di:waypoint x="510" y="230" />
|
|
</bpmndi:BPMNEdge>
|
|
</bpmndi:BPMNPlane>
|
|
</bpmndi:BPMNDiagram>
|
|
</bpmn:definitions>
|