|
Re: Predicate expression in Conditional Edge Style Description [message #1239578 is a reply to message #1239465] |
Tue, 04 February 2014 14:18 |
|
Hello,
Is the active editor, when you wrote the expression [self.target.toString().contains('xxx')/] on the Model Request Interpreter, a diagramme with a selected edge? In that case, the selected element is not your semantic element but the graphical element (DEdge). In that case, your expression works because "target" is the reference to the semantic element (See DSemanticDecorator.target in the metamodel). Therefore, if you want to use your expression on a semantic element, or in your Viewpoint Specification Model (odesign), you should remove the "target" reference.
Regards,
Steve
Steve Monnier - Obeo Canada
Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
|
|
|
|
|
|
Re: Predicate expression in Conditional Edge Style Description [message #1693158 is a reply to message #1693109] |
Wed, 22 April 2015 07:14 |
|
Le 21/04/2015 21:26, Maxence Lafon a écrit :
> Hello,
Hi.
> I have a similar problem.
> I want to add in my Viewpoint Specification Model (.odesign) a
> conditional style to a Node claimed that this Node is connected or not
> (i.e. if its outgoingEdges and incomingEdges are empty or not). But
> "outgoingEdges" and "incomingEdges" refer to the diagram element (DNode)
> : I can access them by typing [thisEObject.incomingEdges/] when I'm
> working directly onto the diagram but I can't access them from the
> .odesign file (though diagram elements are defined in this file !).
I assume the when you say "working directly onto the diagram" you mean
using the "Interpreter" view? The input element which serves as context
("self" or "thisEObject") in this view is indeed the Sirius-specific
graphical model element currently selected, i.e. a DNode, DNodeContainer
or DEdge for example.
The expressions in the VSM (.odesign) are usually evaluated relative to
the semantic/domain model element, which does not know about
Sirius-specific graphical elements (its the other way around).
> So my question is : how is it possible to access to the diagram element
> features in the Viewpoint Specification Model ?
In general when it makes sense for an expression in the VSM to have
access to the graphical model (and not just the semantic/domain layer),
Sirius provides it through variables which are automatically available
when the expression is evaluated. They are typically called "view",
"containerView" or something similar. This is the case for conditional
style expression: the variable "view" will be set with the graphical
element whose style is tested.
Regards,
--
Pierre-Charles David - Obeo
Need professional services for Sirius?
http://www.obeodesigner.com/sirius
Pierre-Charles David - Obeo
Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
|
|
|
|
Powered by
FUDForum. Page generated in 0.03941 seconds