Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Sirius » Create Instance in Tree Description
Create Instance in Tree Description [message #1792305] Sun, 15 July 2018 20:29 Go to next message
Camilo Mendoza is currently offline Camilo MendozaFriend
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 #1792357 is a reply to message #1792305] Mon, 16 July 2018 12:34 Go to previous messageGo to next message
Pierre Guilet is currently offline Pierre GuiletFriend
Messages: 250
Registered: June 2017
Senior Member
Hi,
If create tools are not working, it is likely because they are not defined correctly.
The tool is using the same model operation as the ones in diagrams: https://wiki.eclipse.org/Sirius/Tutorials/StarterTutorial#Add_a_Node_Creation
Can you show us your tool definition?

Regards,



Pierre Guilet - Obeo
Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
Re: Create Instance in Tree Description [message #1792389 is a reply to message #1792305] Mon, 16 July 2018 20:17 Go to previous messageGo to next message
Camilo Mendoza is currently offline Camilo MendozaFriend
Messages: 5
Registered: May 2018
Junior Member
Hi, thanks for the answer.

I have defined a Create Tool within a Tree Item (I also tried moving it up to be its sibling) with a Create Instance operation.

index.php/fa/33411/0/

My metamodel is as follows. Rule class has a reference to Pattern class. ReferenceArchitecture is the DomainClass in the TreeDescriptor.

index.php/fa/33410/0/

Create Tool has these properties

index.php/fa/33409/0/

And Create instance has these properties

index.php/fa/33408/0/

Hope this helps and thank you again.
Re: Create Instance in Tree Description [message #1792463 is a reply to message #1792389] Wed, 18 July 2018 10:06 Go to previous message
Pierre Guilet is currently offline Pierre GuiletFriend
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

Previous Topic:Set model element properties in custom widget
Next Topic:Any support for spinning wheel/ wait gif in Sirius?
Goto Forum:
  


Current Time: Thu Mar 28 22:43:53 GMT 2024

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

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

Back to the top