(self)
| 108 | return task_spec |
| 109 | |
| 110 | def _parse(self): |
| 111 | # here we only look in the top level, We will have another |
| 112 | # bpmn:startEvent if we have a subworkflow task |
| 113 | start_node_list = self.xpath('./bpmn:startEvent') |
| 114 | if not start_node_list and self.process_executable: |
| 115 | raise ValidationException("No start event found", node=self.node, file_name=self.filename) |
| 116 | if not self.process_executable: |
| 117 | raise ValidationException(f"Process {self.bpmn_id} is not executable.", node=self.node, file_name=self.filename) |
| 118 | self.spec = BpmnProcessSpec(name=self.bpmn_id, description=self.get_name(), filename=self.filename) |
| 119 | |
| 120 | # Get the data objects |
| 121 | for obj in self.xpath('./bpmn:dataObject'): |
| 122 | data_object = self.parse_data_object(obj) |
| 123 | self.spec.data_objects[data_object.bpmn_id] = data_object |
| 124 | |
| 125 | # Check for an IO Specification. |
| 126 | io_spec = first(self.xpath('./bpmn:ioSpecification')) |
| 127 | if io_spec is not None: |
| 128 | self.spec.io_specification = self.parse_io_spec() |
| 129 | |
| 130 | # set the data stores on the process spec so they can survive |
| 131 | # serialization |
| 132 | self.spec.data_stores = self.data_stores |
| 133 | for node in start_node_list: |
| 134 | self.parse_node(node) |
| 135 | |
| 136 | if len(start_node_list) > 1: |
| 137 | split_task = StartEventSplit(self.spec, 'StartEventSplit') |
| 138 | join_task = StartEventJoin(self.spec, 'StartEventJoin', split_task='StartEventSplit', threshold=1, cancel=True) |
| 139 | for spec in self.spec.start.outputs: |
| 140 | spec.inputs = [split_task] |
| 141 | spec.connect(join_task) |
| 142 | split_task.outputs = self.spec.start.outputs |
| 143 | self.spec.start.outputs = [split_task] |
| 144 | split_task.inputs = [self.spec.start] |
| 145 | |
| 146 | def parse_data_object(self, obj): |
| 147 | return self.create_data_spec(obj, DataObject) |
no test coverage detected