-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixes for Issues #8 and #9 #49
Merged
Merged
Changes from 15 commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
0638438
Added conf to gitignore
MarcusRost e90abf6
added new branch for issue #8
MarcusRost bd1a14c
Fixed issue #8 with TDD
MarcusRost 383cf8f
Merge branch 'main' of https://github.com/signavio/bpmn2constraints
MarcusRost 96cf615
added tests for expected outcome
MarcusRost 3db1835
added init edge case check
MarcusRost 517c3d5
reformatted for lint-bot
MarcusRost 22f6975
further formatting
MarcusRost 0205dfd
formatted test_end_constraints
MarcusRost 8f20e77
formatted changes in bpmn_parser
MarcusRost a956665
formatted 2 files for linter
MarcusRost 0e4bc61
fixed invisible space
MarcusRost 265e017
formatting
MarcusRost 85596bf
Removed unnecessary comment
MarcusRost dfcfd8c
Merge pull request #2 from MarcusRostSAP/issue_#9
MarcusRostSAP 2590954
Update .gitignore
MarcusRostSAP 024d816
Fix pr (#4)
MarcusRostSAP File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -134,4 +134,7 @@ dmypy.json | |
# JetBrains IDE | ||
.idea/ | ||
|
||
.vscode/ | ||
.vscode/ | ||
|
||
tutorial/conf.py | ||
test.mmd | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -59,12 +59,25 @@ def run(self): | |
self.__mark_gateway_elements() | ||
if self.transitivity: | ||
self.__add_transitivity() | ||
self.validate_edge_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): | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can you add a comment/docstring here that describes the edge cases that you are fixing? |
||
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": | ||
cfo["is start"] = False | ||
for successor in cfo["successor"]: | ||
self.sequence[item_indices[successor["name"]]]["is start"] = True | ||
if cfo["is end"] and cfo["name"] in GATEWAY_NAMES: | ||
cfo["is end"] = False | ||
for predecessor in cfo["predecessor"]: | ||
self.sequence[item_indices[predecessor["name"]]]["is end"] = True | ||
|
||
def __mark_gateway_elements(self): | ||
for cfo in self.sequence: | ||
predecessors = cfo.get("predecessor") | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit-pick: I wouldn't ignore the
test.mmd
file, which seems to be kind of random...