Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Sirius » String concatenation using Accelo(Label description in Basic Family tutorial)
String concatenation using Accelo [message #1245852] Fri, 14 February 2014 10:57 Go to next message
Philippe EUGENE is currently offline Philippe EUGENE
Messages: 26
Registered: January 2011
Junior Member
Hi,
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.

I trying multiple forms using : +, single quote, double quote. Nothings works.

Finally, i used the concat method on String.
[name.concat(' ').concat(eContainer(Family).name)/]. This syntax works.

Did i must install an extension or a plugin to use the syntax describe into the manual ?
Thanks,
--
Philippe
Re: String concatenation using Accelo [message #1245885 is a reply to message #1245852] Fri, 14 February 2014 12:04 Go to previous messageGo to next message
Pierre-Charles David is currently offline Pierre-Charles David
Messages: 128
Registered: July 2009
Senior Member
Le 14/02/2014 11:57, Philippe EUGENE a écrit :
> Hi,

Hi.

> 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
> works.

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 and
org.eclipse.sirius.common.acceleo.mtl.ide, you have everything you need.


Regards,
Pierre-Charles David
Re: String concatenation using Accelo [message #1245914 is a reply to message #1245885] Fri, 14 February 2014 12:53 Go to previous message
Philippe EUGENE is currently offline Philippe EUGENE
Messages: 26
Registered: January 2011
Junior Member
Yes, it's works fine.
I had to made a syntax error when i did my tests.
Previous Topic:Limit selection of candidates for association
Next Topic:Finding the target of the edge for setting the label
Goto Forum:
  


Current Time: Tue Sep 16 13:36:31 GMT 2014

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

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