-
Notifications
You must be signed in to change notification settings - Fork 3
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
Add entity inheritances in the diagram representation #90
Conversation
2209f4c
to
ee4b989
Compare
Thanks for the update! I updated the inheritance system diagram to include the existing inheritances (using the 'Create inheritance' tool and that worked good 👍 ). I tested the workings and I have some findings:
|
I think we discussed this at some point and argued that we do not want to restrict the user in advance but much rather indicate an error through validation. In this example, the user would create an intermediate erroneous state that they need to fix afterwards. If this were not be possible, the user would need to delete the other inheritance first before creating the new one. What do you think? If we do want to restrict the user, we need to figure out a good way to indicate to the user why something is not allowed because simply a "forbidden" cursor might not be enough information, especially if cycles can be very complex or not all nodes in the cycle are present in the diagram. |
Yes I remember. At that point I was thinking about indirect cycles, so via another node. But this is a direct cycle. Because the edges are overlapping you can't select 1 and remove it. So either we need to block it or the routing algorithm should change a bit so the lines are not overlapping. Maybe the routing algorithm change would be best indeed. |
0c6287a
to
ee4b989
Compare
- Render entity inheritances as entity edges - Extend edge creation tool to enable creation of new inheritances - Add inheritance creation tool to tool box - Add operation/command handlers on server side for inheritance creation & deletion Also: - Update tsconfig of vscode extension to fix ts errors related to inversify property injection - Fix wrong entity initialization in create operation handler Co-authored-by: Harmen Wessels <[email protected]>
ee4b989
to
16b5fa0
Compare
@harmen-xb Thanks for the detailed review. I have updated the PR as follows:
This is now fixed. A check is in place that prevents the creation of an additional inheritance edge if there is already an edge between the two nodes representing the same inheritance.
Unfortunately a routing algorithm change alone would not be enough. The diagram becomes readonly if there is a validation error. So even if we fix the routing so that the edges don't overlap the error cannot be resolved in the diagram (readonly) and could only be fixed in the textual representation.
I would suggest to tackle this issue in a follow-up task. As you already mentioned this more of a generic issue that also affects other aspects of diagram editing (like entities). Identifying a missing dependency and the corresponding model that needs to be added is not a trivial task. We should come up with a clean generic solution that works for all cases. |
Hi @tortmayr , Thanks for the update! For both not allowing to create an inheritance edge twice and not allowing a direct cyclic inheritance, can we use show it visually in the diagram by showing the stop-sign icon when we or hovering on a target which is not allowed? I think this is more user friendly, than not showing anything (when creating the inheritance twice) or showing a warning afterwards. This behaviour should be equal to how it's implemented in the mapping diagram when using the 'Create Mapping' tool. The stop-sign icon disappears when we are on a target where it is allowed to let go. |
@tortmayr I just had a chat with @martin-fleck-at and the inheritance action where you create an inheritance on a remote entity in the diagram is the only action we have where we need to added the dependencies list. For now I would rather block the action where the child side of the inheritance is a remote entity. It should block just like with creating the same inheritance twice. |
- Implement `SystemEdgeCreationChecker` on server-side that disallows creation of inheritance edges if - a similar directed inheritance already exists - the new inheritance would result in a direct circular inheritance - the inheritance would be create to an external model element that is not a dependency of the source model -Refactor and improve `SystemEdgeCreationTool` - Add support for dynamic server-side edge checking - Greatly improve performance overhead by ensuring that we only update the feedback and invoke the `this.canConnect` method if the current connection context actually changes
@harmen-xb I have updated the PR as discussed and added visual validation to the
demo.mp4I also discovered a significant performance issue with the |
Thanks for the update! The behavior of the inheritance tool looks good now. I tested a bit and I don't see strange things in the UI. Did you implement the optimization genericly for all edge tools? So also for the create mapping tool in the mapping diagram? Also, if you create branches could you prefix them with 'feature/' cause the the CI/CD pipeline is automatically ran at every commit. I noticed renaming doesn't work well in GitHub, but a unit test is failing: https://github.com/CrossBreezeNL/crossmodel/actions/runs/13134077562/job/36645443260 |
- Fix diagram unit tests for relationship edges - Add a test for inheritance edges
No, I only optimized the system edge creation tool. For the create mapping tool this is not necessary. The difference is that the system edge creation tool is a complete custom tool, while the create mapping tool extends the default GLSP
I was not aware of the naming convention. Thank you, I will keep it in mind for future PRs. |
Updated PlayWright cm-app to use relative path from script file, i.s.o. relative path from working directory.
Updated PlayWright cm-app to use relative path from script file, i.s.o. relative path from working directory.
…eNL/crossmodel into graphical-inheritance
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.
Code changes look good to me.
Also: