|
|
Re: Precondition on table creation [message #1707782 is a reply to message #1706975] |
Wed, 09 September 2015 10:41 |
|
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
|
|
|
Powered by
FUDForum. Page generated in 0.02535 seconds