Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Sirius » Creating a node for a specific container(How to create a node for a specific container in a deep model)
icon5.gif  Creating a node for a specific container [message #1750198] Sat, 17 December 2016 13:08 Go to next message
Anton Mising name is currently offline Anton Mising nameFriend
Messages: 7
Registered: August 2010
Junior Member
Hello,

my model is of the form A <>--> B <>--> C where A is the root. A can have multiple children of type B and B can have multiple children of type C.

As A is the root of the model, this one is used when creating an instance of the model; it also serves as a container for my class diagram.

Now I want to add another node of type C - I did everything with Node Creation and the design itself is valid. The only problem is the operation "Change Context" with "var:container" - as the container is of type A, there is no way to make this work - I somehow need first to select to which instance of B the new C has to be attached.

So what are my options here?
1) create a second diagram where B is the root so that I can add instances of type C - the user would have to double-click on some B instance in the first diagram and then the second diagram will be opened
2) activate the "Node Creation" for C only if B is selected in the main class diagram so that I know to which B the new C has to be attached. Is this possible?
3) create a new relation from A to C so that I can create C instances in the main diagram and then reattach them to B?
4) ...?

Best regards
Anton
Re: Creating a node for a specific container [message #1750288 is a reply to message #1750198] Mon, 19 December 2016 15:12 Go to previous messageGo to next message
Florian Barbin is currently offline Florian BarbinFriend
Messages: 270
Registered: August 2010
Senior Member
Hi Anton,

In your Node Creation tool you can create a new B instance (using the Create Instance operation). This B instance can be retrieved by using the variable defined in "Variable Name" ("instance" by default) or by defining a new Create Instance operation for C, as a child of Create Instance B. In that case the context will be the new B instance.
Begin
  |__Create Instance B
              |__ Create Instance C


Regards,

Florian
Re: Creating a node for a specific container [message #1750297 is a reply to message #1750288] Mon, 19 December 2016 17:05 Go to previous messageGo to next message
Anton Mising name is currently offline Anton Mising nameFriend
Messages: 7
Registered: August 2010
Junior Member
Hi Florian,

thanks for the input. However I'd like to add the new "C" instance to an existing "B" instance and not to create a new "B".

Best regards
Anton
Re: Creating a node for a specific container [message #1750346 is a reply to message #1750297] Tue, 20 December 2016 08:48 Go to previous messageGo to next message
Florian Barbin is currently offline Florian BarbinFriend
Messages: 270
Registered: August 2010
Senior Member
Ok. In that case you can use a Selection Wizard to let the user choosing in which "B" instance he want to create the new "C" instance.

Florian
Re: Creating a node for a specific container [message #1821057 is a reply to message #1750198] Tue, 04 February 2020 22:50 Go to previous messageGo to next message
Burak Karaduman is currently offline Burak KaradumanFriend
Messages: 84
Registered: July 2018
Member
So, related to the above discussion, Is there any way to create a new C, without using any existing B?

Re: Creating a node for a specific container [message #1821212 is a reply to message #1821057] Fri, 07 February 2020 09:20 Go to previous message
Pierre-Charles David is currently offline Pierre-Charles DavidFriend
Messages: 703
Registered: July 2009
Senior Member
Burak Karaduman wrote on Tue, 04 February 2020 23:50
So, related to the above discussion, Is there any way to create a new C, without using any existing B?


*Creating* a new C can be done without a B, but for the new instance to be part of your model you will need to attach it to an existing element. Anything which a type-compatible containment feature can be used, you just have to make sure your "Create Instance" operation is executed in the context of such an compatible container element (which itself is attached to the rest of the model) and indicate in the "Create Instance" operation the name of the containment feature (of the parent) to which the newly created C instance should be attached.


Pierre-Charles David - Obeo

Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
Previous Topic:how to locate at the element in table through navigation tool from diagram
Next Topic:How to change Label position
Goto Forum:
  


Current Time: Wed Apr 24 22:55:48 GMT 2024

Powered by FUDForum. Page generated in 0.03368 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top