171 lines
7.5 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: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_6anuc2e" isExecutable="true">
<bpmn:startEvent id="StartEvent_1">
<bpmn:outgoing>Flow_0y0jhr6</bpmn:outgoing>
</bpmn:startEvent>
<bpmn:sequenceFlow id="Flow_0y0jhr6" sourceRef="StartEvent_1" targetRef="Activity_04dazc1" />
<bpmn:sequenceFlow id="Flow_14tyljc" sourceRef="Activity_04dazc1" targetRef="Gateway_1lvd8c7" />
<bpmn:sequenceFlow id="Flow_0jfr18i" sourceRef="Activity_1bd973z" targetRef="Gateway_1lvd8c7" />
<bpmn:exclusiveGateway id="Gateway_1udhik3" name="Action Requessted" default="Flow_11spu1y">
<bpmn:incoming>Flow_0e9sx03</bpmn:incoming>
<bpmn:outgoing>Flow_094q775</bpmn:outgoing>
<bpmn:outgoing>Flow_11spu1y</bpmn:outgoing>
</bpmn:exclusiveGateway>
<bpmn:sequenceFlow id="Flow_0e9sx03" sourceRef="Activity_1x23xy2" targetRef="Gateway_1udhik3" />
<bpmn:sequenceFlow id="Flow_094q775" name="action==&#34;edit&#34;" sourceRef="Gateway_1udhik3" targetRef="Activity_1bd973z">
<bpmn:conditionExpression>action=="edit"</bpmn:conditionExpression>
</bpmn:sequenceFlow>
<bpmn:endEvent id="Event_00u1ss8">
<bpmn:incoming>Flow_11spu1y</bpmn:incoming>
</bpmn:endEvent>
<bpmn:sequenceFlow id="Flow_11spu1y" name="action==&#34;finish&#34;" sourceRef="Gateway_1udhik3" targetRef="Event_00u1ss8" />
<bpmn:scriptTask id="Activity_04dazc1" name="Load dataset">
<bpmn:incoming>Flow_0y0jhr6</bpmn:incoming>
<bpmn:outgoing>Flow_14tyljc</bpmn:outgoing>
<bpmn:script>dataset=[
{"name": "item1", "x": 1, "y": 2.2, "z": 10},
{"name": "item2", "x": 1.3, "y": 1.4, "z": 10},
{"name": "item3", "x": 0.8, "y": 5, "z": 12}
]
fields = ["name", "x", "y", "z"]
# Create select_enum
item_enum = [
{
"value": "none",
"label": "No Actiion Needed"
},
{
"value": "item_1",
"label": "Edit Item 1"
},
{
"value": "item_2",
"label": "Edit Item 2"
},
{
"value": "item_3",
"label": "Edit Item 3"
}
]</bpmn:script>
</bpmn:scriptTask>
<bpmn:userTask id="Activity_1bd973z" name="Edit row">
<bpmn:extensionElements>
<spiffworkflow:properties>
<spiffworkflow:property name="formJsonSchemaFilename" value="edit-row-schema.json" />
<spiffworkflow:property name="formUiSchemaFilename" value="edit-row-uischema.json" />
</spiffworkflow:properties>
<spiffworkflow:preScript />
<spiffworkflow:postScript>
dataset[0]["name"] = name
dataset[0]["x"] = x
dataset[0]["y"] = y
dataset[0]["z"] = z</spiffworkflow:postScript>
</bpmn:extensionElements>
<bpmn:incoming>Flow_094q775</bpmn:incoming>
<bpmn:outgoing>Flow_0jfr18i</bpmn:outgoing>
</bpmn:userTask>
<bpmn:userTask id="Activity_1x23xy2" name="Display table">
<bpmn:extensionElements>
<spiffworkflow:instructionsForEndUser>{% if dataset is defined and dataset | length &gt; 0 %}
| {{ ' | '.join(fields) }} |
| --- | --- | --- | --- | --- |
{% for item in dataset %}
{%- for f in fields -%}
| {{ item[f] -}}
{%- endfor -%}
{% endfor %}
{% else %}
No Results
{% endif %}
</spiffworkflow:instructionsForEndUser>
<spiffworkflow:postScript>action="edit"
name = dataset[0]["name"]
x = dataset[0]["x"]
y = dataset[0]["y"]
z = dataset[0]["z"]</spiffworkflow:postScript>
<spiffworkflow:properties>
<spiffworkflow:property name="formJsonSchemaFilename" value="item-action-schema.json" />
<spiffworkflow:property name="formUiSchemaFilename" value="item-action-uischema.json" />
</spiffworkflow:properties>
</bpmn:extensionElements>
<bpmn:incoming>Flow_0rqdw3e</bpmn:incoming>
<bpmn:outgoing>Flow_0e9sx03</bpmn:outgoing>
</bpmn:userTask>
<bpmn:exclusiveGateway id="Gateway_1lvd8c7">
<bpmn:incoming>Flow_14tyljc</bpmn:incoming>
<bpmn:incoming>Flow_0jfr18i</bpmn:incoming>
<bpmn:outgoing>Flow_0rqdw3e</bpmn:outgoing>
</bpmn:exclusiveGateway>
<bpmn:sequenceFlow id="Flow_0rqdw3e" sourceRef="Gateway_1lvd8c7" targetRef="Activity_1x23xy2" />
</bpmn:process>
<bpmndi:BPMNDiagram id="BPMNDiagram_1">
<bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="Process_6anuc2e">
<bpmndi:BPMNShape id="_BPMNShape_StartEvent_2" bpmnElement="StartEvent_1">
<dc:Bounds x="52" y="159" width="36" height="36" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="Gateway_1udhik3_di" bpmnElement="Gateway_1udhik3" isMarkerVisible="true">
<dc:Bounds x="615" y="152" width="50" height="50" />
<bpmndi:BPMNLabel>
<dc:Bounds x="611" y="122" width="59" height="27" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="Event_00u1ss8_di" bpmnElement="Event_00u1ss8">
<dc:Bounds x="622" y="372" width="36" height="36" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="Activity_1odusgo_di" bpmnElement="Activity_04dazc1">
<dc:Bounds x="170" y="137" width="100" height="80" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="Activity_0pjo2us_di" bpmnElement="Activity_1bd973z">
<dc:Bounds x="760" y="137" width="100" height="80" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="Activity_0vu99w1_di" bpmnElement="Activity_1x23xy2">
<dc:Bounds x="430" y="137" width="100" height="80" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="Gateway_1lvd8c7_di" bpmnElement="Gateway_1lvd8c7" isMarkerVisible="true">
<dc:Bounds x="325" y="152" width="50" height="50" />
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge id="Flow_0y0jhr6_di" bpmnElement="Flow_0y0jhr6">
<di:waypoint x="88" y="177" />
<di:waypoint x="170" y="177" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="Flow_14tyljc_di" bpmnElement="Flow_14tyljc">
<di:waypoint x="270" y="177" />
<di:waypoint x="325" y="177" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="Flow_0jfr18i_di" bpmnElement="Flow_0jfr18i">
<di:waypoint x="810" y="137" />
<di:waypoint x="810" y="50" />
<di:waypoint x="350" y="50" />
<di:waypoint x="350" y="152" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="Flow_0e9sx03_di" bpmnElement="Flow_0e9sx03">
<di:waypoint x="530" y="177" />
<di:waypoint x="615" y="177" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="Flow_094q775_di" bpmnElement="Flow_094q775">
<di:waypoint x="665" y="177" />
<di:waypoint x="760" y="177" />
<bpmndi:BPMNLabel>
<dc:Bounds x="679" y="159" width="68" height="14" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="Flow_11spu1y_di" bpmnElement="Flow_11spu1y">
<di:waypoint x="640" y="202" />
<di:waypoint x="640" y="372" />
<bpmndi:BPMNLabel>
<dc:Bounds x="617" y="284" width="76" height="14" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="Flow_0rqdw3e_di" bpmnElement="Flow_0rqdw3e">
<di:waypoint x="375" y="177" />
<di:waypoint x="430" y="177" />
</bpmndi:BPMNEdge>
</bpmndi:BPMNPlane>
</bpmndi:BPMNDiagram>
</bpmn:definitions>