|Re: String concatenation using Accelo [message #1245885 is a reply to message #1245852]
||Fri, 14 February 2014 12:04
| Pierre-Charles David
Registered: July 2009
Le 14/02/2014 11:57, Philippe EUGENE a écrit :|
> Just trying to set a very simple label description on the nodes of the
> BasicFamily diagram.
> Person Name + Family Name
> According with Writing Queries Section (# Using Acceleo) into the Sirus
> Specifier manual, i test like that:
> [name < > eContainer(Family).name/]. It's not working.
The "<prefix>" and "<suffix>" in the example in doc (I assume you are
talking about this one: [‹prefix› + someExpression + ‹suffix›/]) is just
to indicate that they are placeholder for actual string expressions. The
"<" and ">" symbols are not part of the syntax.
> I trying multiple forms using : +, single quote, double quote. Nothings
Acceleo extends OCL, so it uses the same syntax for most things,
including strings. Literal strings are enclosed in single quotes.
I just re-tested it, and this syntax works fine:
[firstName + ' ' + lastName/]
> Finally, i used the concat method on String.
> [name.concat(' ').concat(eContainer(Family).name)/]. This syntax works.
The "+" operator is just a shorthand for this (like in Java).
> Did i must install an extension or a plugin to use the syntax describe
> into the manual ?
You must have the Acceleo 3 support plug-ins installed, but that should
be the case in most situations. If you have
org.eclipse.sirius.common.acceleo.mtl.ide, you have everything you need.
Powered by FUDForum
. Page generated in 0.02314 seconds