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

feat(bpmn): generate edge waypoints #52

Merged
merged 2 commits into from
Oct 6, 2020
Merged

Conversation

tbouffard
Copy link
Member

@tbouffard tbouffard commented Jul 15, 2020

closes #12

BPMNDiagram generated from A.2.0 with 20068e1

Notice that activity and event label positions should be adjusted with #53 (untouched by the changes proposed here)
image

@tbouffard tbouffard added the enhancement New feature or request label Jul 15, 2020
@tbouffard
Copy link
Member Author

The SvgExporter is now able to display edges (without arrow, only segments), for instance with 1096a59 using A.2.0

A 2 0_with_diagram bpmn

wip waypoints computation in algo to model converter

wip waypoints added to display model

waypoints exported in SVG (no arrow)

add additional point for orthogonal segment for BottomLeftToTopRight

we must check if there is a shape obove the current one, to avoid overlapping

intermediate waypoints exported in SVG (no arrow)

intermediate waypoint: position depends on existence of shape above

bpmn exporter: add edge waypoints

bpmn exporter: bpmn shape and edge id based on bpmn element id

no more generated, based on existing id for easier identification

TopLeftToBottomRight: manage 1st vertical or horizontal

SVGExporter: all edge segments have the same color + introduce opacity

Remove system.out

wip: add tests for computeEdgeDirection

wip: add tests for computeEdgeDirection

wip: add tests for computeEdgeDirection

fix computeEdgeDirection_no_elements_between_from_and_top_with_from_on_bottom_left

wip: add tests for computeEdgeDirection

wip: add tests for computeEdgeDirection

wip: add tests for computeEdgeDirection

wip: add tests for computeEdgeDirection

wip update computeWayPoints

wip update computeWayPoints
@tbouffard
Copy link
Member Author

We may probably add more unit tests but I consider this is ok for now

Copy link
Contributor

@baptistemesta baptistemesta left a comment

Choose a reason for hiding this comment

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

Nice work!

.get(); // always exist, otherwise error occur on flow node generation
}

// visible for testing
Copy link
Contributor

Choose a reason for hiding this comment

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

ℹ️ IMO this method is static and visible for testing because it should be extracted in a specific class

// +-----------------+
assertThat(computeEdgeDirection(position(2, 2), position(1, 1), Grid.of(position(2, 1))))
.isEqualTo(BottomRightToTopLeft_FirstHorizontal);
}
Copy link
Contributor

Choose a reason for hiding this comment

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

All theses tests with visual comment make the code easy to understand 👍

@baptistemesta baptistemesta merged commit 11b49f9 into master Oct 6, 2020
@baptistemesta baptistemesta deleted the feat/add_edge_waypoints branch October 6, 2020 06:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

create waypoint for edge
2 participants