Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Sirius » Precondition on table creation
Precondition on table creation [message #1706975] Tue, 01 September 2015 09:08 Go to next message
Tiago Jorge is currently offline Tiago JorgeFriend
Messages: 10
Registered: July 2015
Junior Member
Hello,

When using a table creation tool, mapping from a specific type, I would like to have a precondition enforcing that the creation option is only available if no table of that type exists already.

What expression should I use to test if the element from which I am mapping already has an associated table of that type?

Does these kind of queries over the representations themselves require that the specifier is comfortable with the sirius metamodels referred in the developer manual?

Regards
Re: Precondition on table creation [message #1707764 is a reply to message #1706975] Wed, 09 September 2015 09:03 Go to previous messageGo to next message
Tiago Jorge is currently offline Tiago JorgeFriend
Messages: 10
Registered: July 2015
Junior Member
Any help here?
Re: Precondition on table creation [message #1707782 is a reply to message #1706975] Wed, 09 September 2015 10:41 Go to previous message
Maxime Porhel is currently offline Maxime PorhelFriend
Messages: 500
Registered: July 2009
Location: Nantes, France
Senior Member
Hi Tiago,

Le 01/09/2015 11:08, Tiago Jorge a écrit :
> Hello,
>
> When using a table creation tool, mapping from a specific type, I would
> like to have a precondition enforcing that the creation option is only
> available if no table of that type exists already.
>
> What expression should I use to test if the element from which I am
> mapping already has an associated table of that type?

The main idea would be to retrieve the existing DTable elements and
filter them using the table description id (attribute name in the
metamodel).

Which version of Sirius and which interpreters do you currently use ?


With aql, i would try:

aql:self.eInverse(table::DTable)->select(rep:DRepresentation |
repElt.description.name = 'yourDescriptionId')->isEmpty()



> Does these kind of queries over the representations themselves require
> that the specifier is comfortable with the sirius metamodels referred in
> the developer manual?

This requires to know some parts of the Sirius metamodels:
. the DSemanticDecorator which has a target feature to reference a
semantic EObject,
. the DRepresentation which is the common abstract class between the
DSemanticDiagram, the DTable and the DTree,
. the DRepresenationElement which is the common abstract class between
the DDiagramElement (DNode, DEdge, DNodeContainer, DNodeList), the
DTableElement (DCell, DLine, DColumn) and the DTreeItem.
. DRepresentationElement.getMapping() or
DRepresentation.getDescription() will allow you to navigate to the
description model (the VSM)




>
> Regards

Regards

--
Maxime - Obeo

Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius


Maxime Porhel - Obeo

Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
Previous Topic:Label for Container necessary?
Next Topic:Is Sirius based on GMF?
Goto Forum:
  


Current Time: Wed Jan 20 19:28:33 GMT 2021

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

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

Back to the top