Create Instance in Tree Description [message #1792305] |
Sun, 15 July 2018 20:29 |
Camilo Mendoza Messages: 5 Registered: May 2018 |
Junior Member |
|
|
Hi everyone.
I'm trying to use Sirius to make a Viewpoint with a Tree Description based on a metamodel I have created.
My metamodel has a main class "A" with Class "R" as children and these with "P" as children. In the .odesing I'm showing the current R and P instances in the viewpoint but can't find a way to create new instances of both classes on the Viewpoint. I have searched everywhere for examples of creating instances with Tree Descriptor but haven't found any. Can anyone help me with this?
I already created a Create tool on both parents and children and CreateInstance operation but it does not seem to do anything.
Thanks so much.
[Updated on: Sun, 15 July 2018 20:31] Report message to a moderator
|
|
|
|
|
Re: Create Instance in Tree Description [message #1792463 is a reply to message #1792389] |
Wed, 18 July 2018 10:06 |
Pierre Guilet Messages: 250 Registered: June 2017 |
Senior Member |
|
|
Hi,
The Reference Name must point at the reference where the new instance will be added.
So in your example, this will be the "rules" reference of "ReferenceArchitecture".
But first you must set the context right. Your tool should be at the RuleModel level.
I guess RuleModel has as Domain Class "ReferenceArchitecture".
in this case, in your tool, first add a "change context" operation with var:element as expression. So your context is now the "ReferenceArchitecture" instance.
Then your "create instance" operation that uses "rules" as reference name.
This should work.
Also to define Type I recommend to use this syntax Rules::Rule
Regards,
Pierre Guilet - Obeo
Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
[Updated on: Wed, 18 July 2018 10:08] Report message to a moderator
|
|
|
Powered by
FUDForum. Page generated in 0.03371 seconds