311 lines
15 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:spiffworkflow="http://spiffworkflow.org/bpmn/schema/1.0/core" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" id="Definitions_96f6665" targetNamespace="http://bpmn.io/schema/bpmn" exporter="Camunda Modeler" exporterVersion="3.0.0-dev">
<bpmn:process id="Process_czj1py8" isExecutable="true">
<bpmn:startEvent id="StartEvent_1">
<bpmn:outgoing>Flow_0t3woax</bpmn:outgoing>
</bpmn:startEvent>
<bpmn:sequenceFlow id="Flow_0t3woax" sourceRef="StartEvent_1" targetRef="Activity_1hyh6xu" />
<bpmn:endEvent id="Event_0rz08m3">
<bpmn:incoming>Flow_0hrrnys</bpmn:incoming>
</bpmn:endEvent>
<bpmn:sequenceFlow id="Flow_0lhcp2j" sourceRef="Activity_1hyh6xu" targetRef="select_pizza" />
<bpmn:manualTask id="Activity_1hyh6xu" name="Welcome Message">
<bpmn:extensionElements>
<spiffworkflow:instructionsForEndUser># Welcome to Dan's Pizza Palace!
For all your pizza ordering needs! </spiffworkflow:instructionsForEndUser>
</bpmn:extensionElements>
<bpmn:incoming>Flow_0t3woax</bpmn:incoming>
<bpmn:incoming>Flow_104dgqz</bpmn:incoming>
<bpmn:outgoing>Flow_0lhcp2j</bpmn:outgoing>
</bpmn:manualTask>
<bpmn:sequenceFlow id="Flow_11zyvp0" sourceRef="select_pizza" targetRef="Activity_0idlgxz" />
<bpmn:userTask id="select_pizza" name="Select Pizza">
<bpmn:extensionElements>
<spiffworkflow:properties>
<spiffworkflow:property name="formJsonSchemaFilename" value="select-pizza-schema.json" />
<spiffworkflow:property name="formUiSchemaFilename" value="select-pizza-uischema.json" />
</spiffworkflow:properties>
<spiffworkflow:preScript>pizza_sizes = [
{
"value": "small",
"label": "small"
},
{
"value": "medium",
"label": "medium"
},
{
"value": "large",
"label": "large"
}
]</spiffworkflow:preScript>
<spiffworkflow:postScript>del(pizza_sizes)</spiffworkflow:postScript>
</bpmn:extensionElements>
<bpmn:incoming>Flow_0lhcp2j</bpmn:incoming>
<bpmn:outgoing>Flow_11zyvp0</bpmn:outgoing>
</bpmn:userTask>
<bpmn:sequenceFlow id="Flow_0ugax3q" sourceRef="Activity_0idlgxz" targetRef="Activity_052l6z4" />
<bpmn:businessRuleTask id="Activity_0idlgxz" name="Calculate Cost">
<bpmn:extensionElements>
<spiffworkflow:calledDecisionId>decision_1</spiffworkflow:calledDecisionId>
</bpmn:extensionElements>
<bpmn:incoming>Flow_11zyvp0</bpmn:incoming>
<bpmn:outgoing>Flow_0ugax3q</bpmn:outgoing>
</bpmn:businessRuleTask>
<bpmn:sequenceFlow id="Flow_1dwsykg" sourceRef="Activity_086k3bi" targetRef="Activity_0z41lb5" />
<bpmn:manualTask id="Activity_086k3bi" name="Show total">
<bpmn:extensionElements>
<spiffworkflow:instructionsForEndUser># Here is your order total:
Pizza Price: {{base_price}}
Topping Price: {{topping_price}}
---
# Total Price: {{ total_price }}</spiffworkflow:instructionsForEndUser>
<spiffworkflow:preScript />
</bpmn:extensionElements>
<bpmn:incoming>Flow_0sh7nk8</bpmn:incoming>
<bpmn:outgoing>Flow_1dwsykg</bpmn:outgoing>
</bpmn:manualTask>
<bpmn:boundaryEvent id="Event_1ndfzwj" attachedToRef="Activity_086k3bi">
<bpmn:extensionElements>
<spiffworkflow:signalButtonLabel>Change Order</spiffworkflow:signalButtonLabel>
</bpmn:extensionElements>
<bpmn:outgoing>Flow_104dgqz</bpmn:outgoing>
<bpmn:signalEventDefinition id="SignalEventDefinition_19wqf31" />
</bpmn:boundaryEvent>
<bpmn:sequenceFlow id="Flow_104dgqz" sourceRef="Event_1ndfzwj" targetRef="Activity_1hyh6xu" />
<bpmn:sequenceFlow id="Flow_0vogwzf" sourceRef="Activity_0z41lb5" targetRef="Activity_1dexdgc" />
<bpmn:subProcess id="Activity_0z41lb5" name="Collect Payment">
<bpmn:incoming>Flow_1dwsykg</bpmn:incoming>
<bpmn:outgoing>Flow_0vogwzf</bpmn:outgoing>
<bpmn:startEvent id="Event_0i0xpj0">
<bpmn:outgoing>Flow_1ngmo3m</bpmn:outgoing>
</bpmn:startEvent>
<bpmn:sequenceFlow id="Flow_1ngmo3m" sourceRef="Event_0i0xpj0" targetRef="select_payment" />
<bpmn:userTask id="select_payment" name="Select Payment">
<bpmn:extensionElements>
<spiffworkflow:properties>
<spiffworkflow:property name="formJsonSchemaFilename" value="payment-schema.json" />
<spiffworkflow:property name="formUiSchemaFilename" value="payment-uischema.json" />
</spiffworkflow:properties>
</bpmn:extensionElements>
<bpmn:incoming>Flow_1ngmo3m</bpmn:incoming>
<bpmn:outgoing>Flow_0qtfbg4</bpmn:outgoing>
</bpmn:userTask>
<bpmn:exclusiveGateway id="Gateway_0cxkx00" default="Flow_15wd6dg">
<bpmn:incoming>Flow_0qtfbg4</bpmn:incoming>
<bpmn:outgoing>Flow_0hwo1vp</bpmn:outgoing>
<bpmn:outgoing>Flow_15wd6dg</bpmn:outgoing>
</bpmn:exclusiveGateway>
<bpmn:sequenceFlow id="Flow_0qtfbg4" sourceRef="select_payment" targetRef="Gateway_0cxkx00" />
<bpmn:sequenceFlow id="Flow_0hwo1vp" name="credit" sourceRef="Gateway_0cxkx00" targetRef="Activity_0c55onz">
<bpmn:conditionExpression>payment_type == "credit"</bpmn:conditionExpression>
</bpmn:sequenceFlow>
<bpmn:sequenceFlow id="Flow_15wd6dg" sourceRef="Gateway_0cxkx00" targetRef="Activity_0e20kuc" />
<bpmn:manualTask id="Activity_0c55onz" name="Selected Credit">
<bpmn:extensionElements>
<spiffworkflow:instructionsForEndUser># You selected Credit!</spiffworkflow:instructionsForEndUser>
</bpmn:extensionElements>
<bpmn:incoming>Flow_0hwo1vp</bpmn:incoming>
<bpmn:outgoing>Flow_1owmjku</bpmn:outgoing>
</bpmn:manualTask>
<bpmn:manualTask id="Activity_0e20kuc" name="Selected Paypal">
<bpmn:extensionElements>
<spiffworkflow:instructionsForEndUser># You selected PayPal!</spiffworkflow:instructionsForEndUser>
</bpmn:extensionElements>
<bpmn:incoming>Flow_15wd6dg</bpmn:incoming>
<bpmn:outgoing>Flow_1bterx1</bpmn:outgoing>
</bpmn:manualTask>
<bpmn:exclusiveGateway id="Gateway_1etapcn">
<bpmn:incoming>Flow_1bterx1</bpmn:incoming>
<bpmn:incoming>Flow_1owmjku</bpmn:incoming>
<bpmn:outgoing>Flow_084l56o</bpmn:outgoing>
</bpmn:exclusiveGateway>
<bpmn:sequenceFlow id="Flow_1bterx1" sourceRef="Activity_0e20kuc" targetRef="Gateway_1etapcn" />
<bpmn:sequenceFlow id="Flow_1owmjku" sourceRef="Activity_0c55onz" targetRef="Gateway_1etapcn" />
<bpmn:endEvent id="Event_151xjzk">
<bpmn:incoming>Flow_084l56o</bpmn:incoming>
</bpmn:endEvent>
<bpmn:sequenceFlow id="Flow_084l56o" sourceRef="Gateway_1etapcn" targetRef="Event_151xjzk" />
</bpmn:subProcess>
<bpmn:sequenceFlow id="Flow_0hrrnys" sourceRef="Activity_1dexdgc" targetRef="Event_0rz08m3" />
<bpmn:callActivity id="Activity_1dexdgc" name="Cook and deliver" calledElement="cook_and_deliver_dan">
<bpmn:incoming>Flow_0vogwzf</bpmn:incoming>
<bpmn:outgoing>Flow_0hrrnys</bpmn:outgoing>
</bpmn:callActivity>
<bpmn:sequenceFlow id="Flow_0sh7nk8" sourceRef="Activity_052l6z4" targetRef="Activity_086k3bi" />
<bpmn:scriptTask id="Activity_052l6z4" name="Calculate Total">
<bpmn:extensionElements>
<spiffworkflow:unitTests>
<spiffworkflow:unitTest id="test1">
<spiffworkflow:inputJson>{
"toppings": [
"onions"
],
"base_price": 10,
"pizza_size": "medium",
"topping_price": 1
}</spiffworkflow:inputJson>
<spiffworkflow:expectedOutputJson>{
"toppings": [
"onions"
],
"base_price": 10,
"pizza_size": "medium",
"topping_price": 1,
"total_price": 11
}</spiffworkflow:expectedOutputJson>
</spiffworkflow:unitTest>
</spiffworkflow:unitTests>
</bpmn:extensionElements>
<bpmn:incoming>Flow_0ugax3q</bpmn:incoming>
<bpmn:outgoing>Flow_0sh7nk8</bpmn:outgoing>
<bpmn:script>total_price = base_price + topping_price * len(toppings)</bpmn:script>
</bpmn:scriptTask>
</bpmn:process>
<bpmndi:BPMNDiagram id="BPMNDiagram_1">
<bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="Process_czj1py8">
<bpmndi:BPMNShape id="_BPMNShape_StartEvent_2" bpmnElement="StartEvent_1">
<dc:Bounds x="-248" y="-38" width="36" height="36" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="Event_0rz08m3_di" bpmnElement="Event_0rz08m3">
<dc:Bounds x="812" y="-38" width="36" height="36" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="Activity_1umtp8c_di" bpmnElement="Activity_1hyh6xu">
<dc:Bounds x="-160" y="-60" width="100" height="80" />
<bpmndi:BPMNLabel />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="Activity_0uwjwnd_di" bpmnElement="select_pizza">
<dc:Bounds x="-10" y="-60" width="100" height="80" />
<bpmndi:BPMNLabel />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="Activity_0h6txs2_di" bpmnElement="Activity_0idlgxz">
<dc:Bounds x="130" y="-60" width="100" height="80" />
<bpmndi:BPMNLabel />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="Activity_1u5z3qa_di" bpmnElement="Activity_086k3bi">
<dc:Bounds x="380" y="-60" width="100" height="80" />
<bpmndi:BPMNLabel />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="Activity_1lozqop_di" bpmnElement="Activity_0z41lb5">
<dc:Bounds x="530" y="-60" width="100" height="80" />
<bpmndi:BPMNLabel />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="Activity_1l8h119_di" bpmnElement="Activity_1dexdgc">
<dc:Bounds x="670" y="-60" width="100" height="80" />
<bpmndi:BPMNLabel />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="Activity_1476xe1_di" bpmnElement="Activity_052l6z4">
<dc:Bounds x="260" y="-60" width="100" height="80" />
<bpmndi:BPMNLabel />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="Event_1pq70ev_di" bpmnElement="Event_1ndfzwj">
<dc:Bounds x="422" y="2" width="36" height="36" />
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge id="Flow_0t3woax_di" bpmnElement="Flow_0t3woax">
<di:waypoint x="-212" y="-20" />
<di:waypoint x="-160" y="-20" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="Flow_0lhcp2j_di" bpmnElement="Flow_0lhcp2j">
<di:waypoint x="-60" y="-20" />
<di:waypoint x="-10" y="-20" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="Flow_11zyvp0_di" bpmnElement="Flow_11zyvp0">
<di:waypoint x="90" y="-20" />
<di:waypoint x="130" y="-20" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="Flow_0ugax3q_di" bpmnElement="Flow_0ugax3q">
<di:waypoint x="230" y="-20" />
<di:waypoint x="260" y="-20" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="Flow_1dwsykg_di" bpmnElement="Flow_1dwsykg">
<di:waypoint x="480" y="-20" />
<di:waypoint x="530" y="-20" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="Flow_104dgqz_di" bpmnElement="Flow_104dgqz">
<di:waypoint x="440" y="38" />
<di:waypoint x="440" y="58" />
<di:waypoint x="-110" y="58" />
<di:waypoint x="-110" y="20" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="Flow_0vogwzf_di" bpmnElement="Flow_0vogwzf">
<di:waypoint x="630" y="-20" />
<di:waypoint x="670" y="-20" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="Flow_0hrrnys_di" bpmnElement="Flow_0hrrnys">
<di:waypoint x="770" y="-20" />
<di:waypoint x="812" y="-20" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="Flow_0sh7nk8_di" bpmnElement="Flow_0sh7nk8">
<di:waypoint x="360" y="-20" />
<di:waypoint x="380" y="-20" />
</bpmndi:BPMNEdge>
</bpmndi:BPMNPlane>
</bpmndi:BPMNDiagram>
<bpmndi:BPMNDiagram id="BPMNDiagram_1skus10">
<bpmndi:BPMNPlane id="BPMNPlane_0ry9mzi" bpmnElement="Activity_0z41lb5">
<bpmndi:BPMNShape id="Event_0i0xpj0_di" bpmnElement="Event_0i0xpj0">
<dc:Bounds x="182" y="192" width="36" height="36" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="Activity_05d0w4y_di" bpmnElement="select_payment">
<dc:Bounds x="270" y="170" width="100" height="80" />
<bpmndi:BPMNLabel />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="Gateway_0cxkx00_di" bpmnElement="Gateway_0cxkx00" isMarkerVisible="true">
<dc:Bounds x="425" y="185" width="50" height="50" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="Activity_0uc56le_di" bpmnElement="Activity_0c55onz">
<dc:Bounds x="530" y="100" width="100" height="80" />
<bpmndi:BPMNLabel />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="Activity_11iy4mp_di" bpmnElement="Activity_0e20kuc">
<dc:Bounds x="530" y="230" width="100" height="80" />
<bpmndi:BPMNLabel />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="Gateway_1etapcn_di" bpmnElement="Gateway_1etapcn" isMarkerVisible="true">
<dc:Bounds x="685" y="185" width="50" height="50" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="Event_151xjzk_di" bpmnElement="Event_151xjzk">
<dc:Bounds x="792" y="192" width="36" height="36" />
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge id="Flow_1ngmo3m_di" bpmnElement="Flow_1ngmo3m">
<di:waypoint x="218" y="210" />
<di:waypoint x="270" y="210" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="Flow_0qtfbg4_di" bpmnElement="Flow_0qtfbg4">
<di:waypoint x="370" y="210" />
<di:waypoint x="425" y="210" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="Flow_0hwo1vp_di" bpmnElement="Flow_0hwo1vp">
<di:waypoint x="450" y="185" />
<di:waypoint x="450" y="140" />
<di:waypoint x="530" y="140" />
<bpmndi:BPMNLabel>
<dc:Bounds x="466" y="143" width="27" height="14" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="Flow_15wd6dg_di" bpmnElement="Flow_15wd6dg">
<di:waypoint x="450" y="235" />
<di:waypoint x="450" y="270" />
<di:waypoint x="530" y="270" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="Flow_1bterx1_di" bpmnElement="Flow_1bterx1">
<di:waypoint x="630" y="270" />
<di:waypoint x="710" y="270" />
<di:waypoint x="710" y="235" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="Flow_1owmjku_di" bpmnElement="Flow_1owmjku">
<di:waypoint x="630" y="140" />
<di:waypoint x="710" y="140" />
<di:waypoint x="710" y="185" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="Flow_084l56o_di" bpmnElement="Flow_084l56o">
<di:waypoint x="735" y="210" />
<di:waypoint x="792" y="210" />
</bpmndi:BPMNEdge>
</bpmndi:BPMNPlane>
</bpmndi:BPMNDiagram>
</bpmn:definitions>