From 024d8163f9f90ef14441b40f155962500ad1cddd Mon Sep 17 00:00:00 2001 From: MarcusRostSAP <146723913+MarcusRostSAP@users.noreply.github.com> Date: Thu, 12 Oct 2023 14:19:46 +0200 Subject: [PATCH] Fix pr (#4) * Small changes based on review comments * Linting issue * lint * lint * lint --------- Co-authored-by: MarcusRostSAP --- bpmnconstraints/parser/bpmn_parser.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/bpmnconstraints/parser/bpmn_parser.py b/bpmnconstraints/parser/bpmn_parser.py index 97bcbd1..a61c6ee 100644 --- a/bpmnconstraints/parser/bpmn_parser.py +++ b/bpmnconstraints/parser/bpmn_parser.py @@ -59,14 +59,18 @@ def run(self): self.__mark_gateway_elements() if self.transitivity: self.__add_transitivity() - self.validate_edge_cases() + self.validate_splitting_and_joining_gateway_cases() return self.sequence except Exception: logging.warning( "\nCould not execute model. Make sure that model is:\n1. Formatted correctly.\n2. File ends with .xml or .json." ) - def validate_edge_cases(self): + def validate_splitting_and_joining_gateway_cases(self): + """Update 'is start' and 'is end' attributes of cfo based on splitting/joining gateways. + Otherwise, the parser interprets the gateways as start/end events instead of the activities. + """ + item_indices = {item["name"]: index for index, item in enumerate(self.sequence)} for cfo in self.sequence: if cfo["is start"] and cfo["name"] == "XOR":