Skip to content

Commit

Permalink
Fix pr (#4)
Browse files Browse the repository at this point in the history
* Small changes based on review comments

* Linting issue

* lint

* lint

* lint

---------

Co-authored-by: MarcusRostSAP <[email protected]>
  • Loading branch information
MarcusRostSAP and MarcusRost authored Oct 12, 2023
1 parent 2590954 commit 024d816
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions bpmnconstraints/parser/bpmn_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -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":
Expand Down

0 comments on commit 024d816

Please sign in to comment.