** WIP **

Committing so I can work on another ticket.
This commit is contained in:
mike cullerton 2022-01-21 14:37:11 -05:00
parent e67a1554ea
commit 91fa44b2ab
4 changed files with 137 additions and 1 deletions

View File

@ -22,7 +22,10 @@ known_errors = {'Non-default exclusive outgoing sequence flow without condition
'for the property.'},
'Error opening excel file .*, with file_model_id:':
{'hint': 'It looks like you are trying to use an older xls file. '
'Try uploading a newer xlsx file.'}}
'Try uploading a newer xlsx file.'},
'Failed to parse the Workflow Specification. Error is \'The process \'(.+)\' was not found. Did you mean one of the following: .*':
{'hint': 'The workflow spec could not be parsed. If you are loading a library, check whether the name is correct.'}
}
class ValidationErrorService(object):

View File

@ -0,0 +1,75 @@
<?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:camunda="http://camunda.org/schema/1.0/bpmn" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" id="Definitions_070ba96" targetNamespace="http://bpmn.io/schema/bpmn" exporter="Camunda Modeler" exporterVersion="3.0.0-dev">
<bpmn:process id="Process_TestMultiple" name="Test Multiple" isExecutable="true">
<bpmn:startEvent id="StartEvent_1">
<bpmn:outgoing>Flow_1w8il3k</bpmn:outgoing>
</bpmn:startEvent>
<bpmn:sequenceFlow id="Flow_1w8il3k" sourceRef="StartEvent_1" targetRef="Activity_GetNumbers" />
<bpmn:sequenceFlow id="Flow_0zy8gri" sourceRef="Activity_GetNumbers" targetRef="Activity_1ie5wag" />
<bpmn:callActivity id="Activity_1ie5wag" name="Multiply" calledElement="Process_Multiply">
<bpmn:incoming>Flow_0zy8gri</bpmn:incoming>
<bpmn:outgoing>Flow_0mtrjqf</bpmn:outgoing>
</bpmn:callActivity>
<bpmn:task id="Activity_1iai20j" name="Display Multiple">
<bpmn:documentation>## Multiple
{{ multiple }}
</bpmn:documentation>
<bpmn:incoming>Flow_0mtrjqf</bpmn:incoming>
<bpmn:outgoing>Flow_0zy8247</bpmn:outgoing>
</bpmn:task>
<bpmn:sequenceFlow id="Flow_0mtrjqf" sourceRef="Activity_1ie5wag" targetRef="Activity_1iai20j" />
<bpmn:endEvent id="Event_1hiokdc">
<bpmn:incoming>Flow_0zy8247</bpmn:incoming>
</bpmn:endEvent>
<bpmn:sequenceFlow id="Flow_0zy8247" sourceRef="Activity_1iai20j" targetRef="Event_1hiokdc" />
<bpmn:userTask id="Activity_GetNumbers" name="Get Numbers" camunda:formKey="NumberForm">
<bpmn:extensionElements>
<camunda:formData>
<camunda:formField id="num_1" label="First Number" type="long">
<camunda:validation>
<camunda:constraint name="required" config="True" />
</camunda:validation>
</camunda:formField>
<camunda:formField id="num_2" label="Second Number" type="long" />
</camunda:formData>
</bpmn:extensionElements>
<bpmn:incoming>Flow_1w8il3k</bpmn:incoming>
<bpmn:outgoing>Flow_0zy8gri</bpmn:outgoing>
</bpmn:userTask>
</bpmn:process>
<bpmndi:BPMNDiagram id="BPMNDiagram_1">
<bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="Process_TestMultiple">
<bpmndi:BPMNEdge id="Flow_0zy8247_di" bpmnElement="Flow_0zy8247">
<di:waypoint x="690" y="177" />
<di:waypoint x="752" y="177" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="Flow_0mtrjqf_di" bpmnElement="Flow_0mtrjqf">
<di:waypoint x="530" y="177" />
<di:waypoint x="590" y="177" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="Flow_0zy8gri_di" bpmnElement="Flow_0zy8gri">
<di:waypoint x="370" y="177" />
<di:waypoint x="430" y="177" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="Flow_1w8il3k_di" bpmnElement="Flow_1w8il3k">
<di:waypoint x="215" y="177" />
<di:waypoint x="270" y="177" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNShape id="_BPMNShape_StartEvent_2" bpmnElement="StartEvent_1">
<dc:Bounds x="179" y="159" width="36" height="36" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="Activity_10bb50r_di" bpmnElement="Activity_1ie5wag">
<dc:Bounds x="430" y="137" width="100" height="80" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="Activity_1iai20j_di" bpmnElement="Activity_1iai20j">
<dc:Bounds x="590" y="137" width="100" height="80" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="Event_1hiokdc_di" bpmnElement="Event_1hiokdc">
<dc:Bounds x="752" y="159" width="36" height="36" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="Activity_1kqfoxq_di" bpmnElement="Activity_GetNumbers">
<dc:Bounds x="270" y="137" width="100" height="80" />
</bpmndi:BPMNShape>
</bpmndi:BPMNPlane>
</bpmndi:BPMNDiagram>
</bpmn:definitions>

View File

@ -0,0 +1,42 @@
<?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" id="Definitions_1df176c" targetNamespace="http://bpmn.io/schema/bpmn" exporter="Camunda Modeler" exporterVersion="3.0.0-dev">
<bpmn:process id="Process_Multiplyx" name="Multiply" isExecutable="true">
<bpmn:startEvent id="StartEvent_1">
<bpmn:outgoing>Flow_1ncal2l</bpmn:outgoing>
</bpmn:startEvent>
<bpmn:sequenceFlow id="Flow_1ncal2l" sourceRef="StartEvent_1" targetRef="Activity_GetMultiple" />
<bpmn:endEvent id="Event_1dms7bp" name="&#10;">
<bpmn:incoming>Flow_1q7r744</bpmn:incoming>
</bpmn:endEvent>
<bpmn:sequenceFlow id="Flow_1q7r744" sourceRef="Activity_GetMultiple" targetRef="Event_1dms7bp" />
<bpmn:scriptTask id="Activity_GetMultiple" name="Get Multiple">
<bpmn:incoming>Flow_1ncal2l</bpmn:incoming>
<bpmn:outgoing>Flow_1q7r744</bpmn:outgoing>
<bpmn:script>multiple = num_1 * num_2</bpmn:script>
</bpmn:scriptTask>
</bpmn:process>
<bpmndi:BPMNDiagram id="BPMNDiagram_1">
<bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="Process_Multiplyx">
<bpmndi:BPMNEdge id="Flow_1q7r744_di" bpmnElement="Flow_1q7r744">
<di:waypoint x="370" y="177" />
<di:waypoint x="432" y="177" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="Flow_1ncal2l_di" bpmnElement="Flow_1ncal2l">
<di:waypoint x="215" y="177" />
<di:waypoint x="270" y="177" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNShape id="_BPMNShape_StartEvent_2" bpmnElement="StartEvent_1">
<dc:Bounds x="179" y="159" width="36" height="36" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="Event_1dms7bp_di" bpmnElement="Event_1dms7bp">
<dc:Bounds x="432" y="159" width="36" height="36" />
<bpmndi:BPMNLabel>
<dc:Bounds x="445" y="202" width="10" height="14" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="Activity_1d2feti_di" bpmnElement="Activity_GetMultiple">
<dc:Bounds x="270" y="137" width="100" height="80" />
</bpmndi:BPMNShape>
</bpmndi:BPMNPlane>
</bpmndi:BPMNDiagram>
</bpmn:definitions>

View File

@ -0,0 +1,16 @@
from tests.base_test import BaseTest
from example_data import ExampleDataLoader
class TestDuplicateWorkflowSpecFile(BaseTest):
def test_duplicate_workflow_spec_file(self):
spec1 = ExampleDataLoader().create_spec('missing_library', 'Missing Library', category_id=0, library=False,
from_tests=True)
workflow = self.create_workflow('missing_library')
with self.assertRaises(AssertionError) as ae:
workflow_api = self.get_workflow_api(workflow)
# task = workflow_api.next_task
# self.complete_form(workflow, task, {'num_1': 4, 'num_2': 5})
print('test_duplicate_workflow_spec_file')