Adding a node does not work [message #1861393] |
Tue, 10 October 2023 18:28 |
Ad Mal Messages: 7 Registered: October 2023 |
Junior Member |
|
|
Hello all,
let me write it first: Thanks to the authors for the excellent Sirius!
And now I need your support. Attached is my metamodel and my definition of "Node Creation Server". Most things do work, but as a result I get the node with a red cross. What am I doing wrong?
EDIT and additional information:
According to another post "The red cross on the graphical element means the semantic element behind has been removed." In my case it means that there is no correct instance creation, right?
According to
https://eclipse.dev/sirius/doc/specifier/general/Model_Operations.html#create_instance "The reference name must correspond to a valid containment reference for the context element of the operation, otherwise the newly created object will not be properly integrated into the semantic model." So I should create the instance inside the "asset" container first and connect it to the "contains" reference or just set the "isLocatedIn" reference to the container that was clicked. Am I right on that? Unfortunately this does not work:
1. Click on a container
2. Change context to "System"
3. Create instance within the "asset" containment
4. Set the "isLocatedIn" reference to the clicked container
Why does it not work? Maybe I'm making a basic mistake somewhere. Can you help me please?
Kind regards
[Updated on: Wed, 11 October 2023 16:35] Report message to a moderator
|
|
|
Re: Adding a node does not work [message #1861441 is a reply to message #1861393] |
Thu, 12 October 2023 13:51 |
|
You're right that you should create the instance inside the "asset" container first, so that the newly created element is properly attached to the rest of the model.
The first "Create Instance" is incorrect, as the reference name given ("contains"), despite its name, is not a containment reference.
The browse expression on the second "Change Context", i.e. "aql:m::System" is incorrect. It refers to a type (the m::System EClass), which it should return return the model element instance to "go to".
The steps you mention look right (except the issue above), except "Set the "isLocatedIn" reference to the clicked container". The "isLocatedIn" relation is not between an asset and its container System, but with a Vlan. So it's more like "Set the "isLocatedIn" reference to the one of the clicked container's Vlan".
Pierre-Charles David - Obeo
Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.04346 seconds