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

BPMN layout demo & data provider #15

Closed
fabiopigna opened this issue Apr 20, 2021 · 3 comments
Closed

BPMN layout demo & data provider #15

fabiopigna opened this issue Apr 20, 2021 · 3 comments
Assignees
Labels

Comments

@fabiopigna
Copy link

Hello,

I'm Fabio, and I'm evaluating the yFiles layout library.
Experimenting with the BPMN layout code from the demo, I found that (not sure if it's a bug or something I didn't understand):

const affectedEdges = IMapper.fromDelegate(
edge =>
adapter.selectionModel.isSelected(edge) ||
adapter.selectionModel.isSelected(edge.sourceNode) ||
adapter.selectionModel.isSelected(edge.targetNode)
)
adapter.addDataProvider(
INode.$class,
YBoolean.$class,
LayoutKeys.AFFECTED_NODES_DP_KEY,
affectedEdges
)

the mapper maps edges, the data provider is using that mapper for nodes.
Is it correct? What I am missing?

thanks,
Fabio Pignaton

@yGuy
Copy link
Member

yGuy commented Apr 20, 2021

Indeed, this does look fishy. We're checking whether this is just a typo that does not affect functionality or actually a bug.
Good catch!

@yGuy
Copy link
Member

yGuy commented Apr 20, 2021

OK.

The current code does not fail, and it will often have similar effects, but you are right that this is a bug and this should be AFFECTED_EDGES_DP_KEY - with IEdge.$class as the first parameter in the addDataProvider call.

Actually we have fixed the bug recently when we refactored the BpmnLayoutData class, but the fix will only become available with the upcoming 2.4 release. I don't think we will be doing a bugfix release for the demo until then, unless a critical bug is reported against the library that is hard or impossible to work around.

So please make the patch. With the 2.4 release (where this part of the demo will get quite a bit nicer in TypeScript), you can can simply upgrade that file.

Thanks for your report!

@yGuy yGuy added the bug label Apr 20, 2021
@fabiopigna
Copy link
Author

Yep, thanks!

(and upvote to the TypeScript version!)

@yGuy yGuy closed this as completed Mar 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants