Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Sirius » Predicate expression in Conditional Edge Style Description(Cannot access [self.target/] in Predicate expression)
Predicate expression in Conditional Edge Style Description [message #1239465] Tue, 04 February 2014 09:07 Go to next message
Martin Gröger is currently offline Martin GrögerFriend
Messages: 3
Registered: February 2014
Junior Member
Hello,

I tried to color an edge depending on data of the model element.
With the Model Request Interpreter I can use the term: [self.target.toString().contains('xxx')/],
but when I try to use this term as a predicate expression, then I get the message

!ENTRY org.eclipse.acceleo.parser 4 0 2014-02-04 09:58:41.441
!MESSAGE Compilation error for expression [self.target.toString().contains('xxx')/] : Unrecognized variable: (target)

So how is it possible to access the model content for this purpose?

Thanks, Martin
Re: Predicate expression in Conditional Edge Style Description [message #1239578 is a reply to message #1239465] Tue, 04 February 2014 14:18 Go to previous messageGo to next message
Steve Monnier is currently offline Steve MonnierFriend
Messages: 66
Registered: May 2011
Member
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
Re: Predicate expression in Conditional Edge Style Description [message #1239586 is a reply to message #1239578] Tue, 04 February 2014 14:37 Go to previous messageGo to next message
Steve Monnier is currently offline Steve MonnierFriend
Messages: 66
Registered: May 2011
Member
By the way, are you sure you want to use the toString() method in your expression? It might be better (even in performance) to write your expression based on a "name" feature for example.

Regards,
Steve
Re: Predicate expression in Conditional Edge Style Description [message #1239595 is a reply to message #1239586] Tue, 04 February 2014 15:02 Go to previous message
Martin Gröger is currently offline Martin GrögerFriend
Messages: 3
Registered: February 2014
Junior Member
Seems like the semantic of [self/] is in this case the model obejct itself, not the object of the representation.
The toString() method was only a workaround as long as I didn't get aceess to the attributes of the object itself.

Anyway thanks for the help,
Martin

Previous Topic:UML models as semantic models in a Modelling Project
Next Topic:Sample Model in Tutorial
Goto Forum:
  


Current Time: Mon Nov 24 18:13:05 GMT 2014

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

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