Skip to content
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

72 happy path first #73

Merged
merged 4 commits into from
Sep 27, 2024
Merged

72 happy path first #73

merged 4 commits into from
Sep 27, 2024

Conversation

abdul99ahad
Copy link
Contributor

@abdul99ahad abdul99ahad commented Sep 26, 2024

Closes #72

Proposed Changes

The primary path will always come first, with secondary connections following below.
image

Checklist

To ensure you provided everything we need to look at your PR:

  • Brief textual description of the changes present
  • Visual demo attached
  • Steps to try out present, i.e. using the @bpmn-io/sr tool
  • Related issue linked via Closes {LINK_TO_ISSUE} or Related to {LINK_TO_ISSUE}

Comment on lines +123 to +131
// negative dX indicates connection from future to past
if (dX < 0 && dY <= 0) {
return [
getDockingPoint(sourceMid, sourceBounds, 'b'),
{ x: sourceMid.x, y: sourceMid.y + DEFAULT_CELL_HEIGHT / 2 },
{ x: targetMid.x, y: sourceMid.y + DEFAULT_CELL_HEIGHT / 2 },
getDockingPoint(targetMid, targetBounds, 'b')
];
}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nikku Not exactly sure if this is the right approach. I have added the condition when it's a loop (future to past) means dX will be negative and the connection can be either on the same row or row less than the current element (dY <=0).

For reference, It solves this case.
image

@abdul99ahad
Copy link
Contributor Author

@nikku Confused about the strategy of happy path first after Till's comment #50 (comment). Do we consider connections from top or not?

@nikku
Copy link
Member

nikku commented Sep 26, 2024

Do we consider connections from top or not?

I consider that we fully understand our strategy, and take it from there. For me "back loop on top" is nothing that I've seen applied in practice, and it makes it harder to understand the happy path.

Copy link
Member

@nikku nikku left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@abdul99ahad I separated spec and snapshot updates on the PR. This way it was easier to me to review before/after state.

This is a simple, yet effective, change to lead to overall cleaner diagrams, cf. diffs:

image

image

image

Hence, let's move forward with it, and have additional discussions as a follow-up.

@nikku nikku merged commit c5723a7 into main Sep 27, 2024
4 checks passed
@nikku nikku deleted the 72-happy-path-first branch September 27, 2024 08:15
@bpmn-io-tasks bpmn-io-tasks bot removed the needs review Review pending label Sep 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Rule violation: Happy path first
2 participants