Comments out study workflow for now. Fixes failing unit tests.

This commit is contained in:
Aaron Louie 2020-02-11 13:40:14 -05:00
parent 0ef1a178ed
commit 0a3a932c50
4 changed files with 38 additions and 51 deletions

View File

@ -9,14 +9,14 @@
<camunda:formData>
<camunda:formField id="StudyShortName" label="Study Short Name" type="string" />
<camunda:formField id="PIExperience" label="Investigator&#39;s Experience" type="string" />
<camunda:formField id="PIStudyAccess" label="Should the PI have Study Team editing access in the system?" type="boolean" defaultValue="Yes" />
<camunda:formField id="PIStudyAccess" label="Should the PI have Study Team editing access in the system?" type="boolean" defaultValue="True" />
<camunda:formField id="PIAutoEmails" label="Should the PI receive automated email notifications?" type="boolean" defaultValue="True" />
</camunda:formData>
</bpmn:extensionElements>
<bpmn:incoming>SequenceFlow_0dsj62d</bpmn:incoming>
<bpmn:incoming>SequenceFlow_13sjege</bpmn:incoming>
<bpmn:outgoing>SequenceFlow_1doa5ln</bpmn:outgoing>
</bpmn:userTask>
<bpmn:sequenceFlow id="SequenceFlow_13sjege" sourceRef="StartEvent_1" targetRef="script_IRBDocAPI" />
<bpmn:sequenceFlow id="SequenceFlow_13sjege" sourceRef="StartEvent_1" targetRef="EnterSetUp" />
<bpmn:userTask id="EnterDSP" name="Enter DSP" camunda:formKey="DSP Entry">
<bpmn:extensionElements>
<camunda:formData>
@ -68,18 +68,22 @@
<camunda:formField id="CollStorUVaLocPaperOther" label="Other: (Please describe)" type="textarea" />
</camunda:formData>
</bpmn:extensionElements>
<bpmn:incoming>SequenceFlow_1cf9ps4</bpmn:incoming>
<bpmn:incoming>SequenceFlow_15tszx8</bpmn:incoming>
<bpmn:outgoing>SequenceFlow_1ts885e</bpmn:outgoing>
</bpmn:userTask>
<bpmn:userTask id="EnterFinance" name="Enter Finance" camunda:formKey="Finance">
<bpmn:extensionElements>
<camunda:formData>
<camunda:formField id="Budget" label="Is there a budget document for this study?" type="boolean">
<camunda:formField id="isBudgetDoc" label="Is there a budget document for this study?" type="boolean">
<camunda:validation>
<camunda:constraint name="required" config="true" />
</camunda:validation>
</camunda:formField>
<camunda:formField id="BudgetDraft" label="Draft Budget" type="file" />
<camunda:formField id="BudgetDraft" label="Draft Budget" type="file">
<camunda:properties>
<camunda:property id="hide_expression" value="!(model.isBudgetDoc)" />
</camunda:properties>
</camunda:formField>
</camunda:formData>
</bpmn:extensionElements>
<bpmn:incoming>SequenceFlow_03v7kc7</bpmn:incoming>
@ -101,7 +105,7 @@
<bpmn:outgoing>SequenceFlow_15tszx8</bpmn:outgoing>
</bpmn:parallelGateway>
<bpmn:sequenceFlow id="SequenceFlow_0xvbe57" sourceRef="EnterFinance" targetRef="ExclusiveGateway_0hffz7d" />
<bpmn:sequenceFlow id="SequenceFlow_15tszx8" sourceRef="ExclusiveGateway_0hffz7d" targetRef="ExclusiveGateway_0gj51xo" />
<bpmn:sequenceFlow id="SequenceFlow_15tszx8" sourceRef="ExclusiveGateway_0hffz7d" targetRef="EnterDSP" />
<bpmn:sequenceFlow id="SequenceFlow_1ts885e" sourceRef="EnterDSP" targetRef="EndEvent_0pb0i5b" />
<bpmn:userTask id="SelectReviewType" name="Select Review Type" camunda:formKey="ReviewType">
<bpmn:extensionElements>
@ -119,41 +123,27 @@
</bpmn:userTask>
<bpmn:sequenceFlow id="SequenceFlow_1fioi5l" sourceRef="ExclusiveGateway_1aeninh" targetRef="SelectReviewType" />
<bpmn:sequenceFlow id="SequenceFlow_1brwirp" sourceRef="SelectReviewType" targetRef="ExclusiveGateway_0hffz7d" />
<bpmn:exclusiveGateway id="ExclusiveGateway_0gj51xo">
<bpmn:extensionElements>
<camunda:executionListener expression="" event="start" />
</bpmn:extensionElements>
<bpmn:incoming>SequenceFlow_15tszx8</bpmn:incoming>
<bpmn:outgoing>SequenceFlow_1cf9ps4</bpmn:outgoing>
</bpmn:exclusiveGateway>
<bpmn:sequenceFlow id="SequenceFlow_1cf9ps4" sourceRef="ExclusiveGateway_0gj51xo" targetRef="EnterDSP" />
<bpmn:sequenceFlow id="SequenceFlow_0dsj62d" sourceRef="script_IRBDocAPI" targetRef="EnterSetUp" />
<bpmn:scriptTask id="script_IRBDocAPI" name="IRB Doc API">
<bpmn:incoming>SequenceFlow_13sjege</bpmn:incoming>
<bpmn:outgoing>SequenceFlow_0dsj62d</bpmn:outgoing>
<bpmn:script>scripts.IRBDocAPI</bpmn:script>
</bpmn:scriptTask>
</bpmn:process>
<bpmndi:BPMNDiagram id="BPMNDiagram_1">
<bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="Process_1uzs4e7">
<bpmndi:BPMNShape id="_BPMNShape_StartEvent_2" bpmnElement="StartEvent_1">
<dc:Bounds x="160" y="219" width="36" height="36" />
<dc:Bounds x="228" y="219" width="36" height="36" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="UserTask_04sxlow_di" bpmnElement="EnterSetUp">
<dc:Bounds x="400" y="197" width="100" height="80" />
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge id="SequenceFlow_13sjege_di" bpmnElement="SequenceFlow_13sjege">
<di:waypoint x="196" y="237" />
<di:waypoint x="237" y="237" />
<di:waypoint x="264" y="237" />
<di:waypoint x="400" y="237" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNShape id="UserTask_1yoscoq_di" bpmnElement="EnterDSP">
<dc:Bounds x="1208" y="197" width="100" height="80" />
<dc:Bounds x="1021" y="197" width="100" height="80" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="UserTask_0gu3eep_di" bpmnElement="EnterFinance">
<dc:Bounds x="682" y="306" width="100" height="80" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="EndEvent_0pb0i5b_di" bpmnElement="EndEvent_0pb0i5b">
<dc:Bounds x="1380" y="219" width="36" height="36" />
<dc:Bounds x="1285" y="219" width="36" height="36" />
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge id="SequenceFlow_1doa5ln_di" bpmnElement="SequenceFlow_1doa5ln">
<di:waypoint x="500" y="237" />
@ -177,11 +167,11 @@
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="SequenceFlow_15tszx8_di" bpmnElement="SequenceFlow_15tszx8">
<di:waypoint x="901" y="237" />
<di:waypoint x="1086" y="237" />
<di:waypoint x="1021" y="237" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="SequenceFlow_1ts885e_di" bpmnElement="SequenceFlow_1ts885e">
<di:waypoint x="1308" y="237" />
<di:waypoint x="1380" y="237" />
<di:waypoint x="1121" y="237" />
<di:waypoint x="1285" y="237" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNShape id="UserTask_0xr3q5b_di" bpmnElement="SelectReviewType">
<dc:Bounds x="682" y="78" width="100" height="80" />
@ -196,20 +186,6 @@
<di:waypoint x="876" y="118" />
<di:waypoint x="876" y="212" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNShape id="ExclusiveGateway_0gj51xo_di" bpmnElement="ExclusiveGateway_0gj51xo" isMarkerVisible="true">
<dc:Bounds x="1086" y="212" width="50" height="50" />
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge id="SequenceFlow_1cf9ps4_di" bpmnElement="SequenceFlow_1cf9ps4">
<di:waypoint x="1136" y="237" />
<di:waypoint x="1208" y="237" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="SequenceFlow_0dsj62d_di" bpmnElement="SequenceFlow_0dsj62d">
<di:waypoint x="337" y="237" />
<di:waypoint x="400" y="237" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNShape id="ScriptTask_0m5671s_di" bpmnElement="script_IRBDocAPI">
<dc:Bounds x="237" y="197" width="100" height="80" />
</bpmndi:BPMNShape>
</bpmndi:BPMNPlane>
</bpmndi:BPMNDiagram>
</bpmn:definitions>

View File

@ -37,11 +37,11 @@ class ExampleDataLoader:
name="m2_demo",
display_name="Milestone 2 Demo",
description='A simplified CR Connect workflow for demonstration purposes.')
workflow_specifications += \
self.create_spec(id="crc_study_workflow",
name="crc_study_workflow",
display_name="CR Connect Study Workflow",
description='Draft workflow for CR Connect studies.')
# workflow_specifications += \
# self.create_spec(id="crc_study_workflow",
# name="crc_study_workflow",
# display_name="CR Connect Study Workflow",
# description='Draft workflow for CR Connect studies.')
workflow_specifications += \
self.create_spec(id="random_fact",
name="random_fact",

View File

@ -20,7 +20,7 @@ class TestApiFiles(BaseTest):
json_data = json.loads(rv.get_data(as_text=True))
self.assertEqual(1, len(json_data))
file = FileModelSchema(many=True).load(json_data, session=session)
self.assertEqual("random_fact.bpmn", file[0].name)
self.assertEqual("m2_demo.bpmn", file[0].name)
def test_list_multiple_files_for_workflow_spec(self):
self.load_example_data()

View File

@ -79,6 +79,8 @@ class TestWorkflowProcessor(BaseTest):
study = session.query(StudyModel).first()
processor = WorkflowProcessor.create(study.id, workflow_spec_model.id)
self.assertEqual(WorkflowStatus.user_input_required, processor.get_status())
# Complete the first steps of the 4 parallel tasks
next_user_tasks = processor.next_user_tasks()
self.assertEqual(4, len(next_user_tasks))
self._populate_form_with_random_data(next_user_tasks[0])
@ -89,7 +91,8 @@ class TestWorkflowProcessor(BaseTest):
processor.complete_task(next_user_tasks[1])
processor.complete_task(next_user_tasks[2])
processor.complete_task(next_user_tasks[3])
# There are another 4 tasks to complete (each task, had a follow up task in the parallel list)
# There are another 4 tasks to complete (each parallel task has a follow-up task)
next_user_tasks = processor.next_user_tasks()
self.assertEqual(4, len(next_user_tasks))
self._populate_form_with_random_data(next_user_tasks[0])
@ -100,6 +103,14 @@ class TestWorkflowProcessor(BaseTest):
processor.complete_task(next_user_tasks[1])
processor.complete_task(next_user_tasks[2])
processor.complete_task(next_user_tasks[3])
processor.do_engine_steps()
# Should be one last step after the above are complete
final_user_tasks = processor.next_user_tasks()
self.assertEqual(1, len(final_user_tasks))
self._populate_form_with_random_data(final_user_tasks[0])
processor.complete_task(final_user_tasks[0])
processor.do_engine_steps()
self.assertTrue(processor.bpmn_workflow.is_completed())
@ -163,4 +174,4 @@ class TestWorkflowProcessor(BaseTest):
file_data = session.query(FileDataModel).filter(FileDataModel.file_model_id == files[0].id).first()
self.assertIsNotNone(file_data.data)
self.assertTrue(len(file_data.data) > 0)
# Not going any farther here, assuming this is tested in libraries correctly.
# Not going any farther here, assuming this is tested in libraries correctly.