Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » M2T (model-to-text transformation) » Acceleo how to change the value of a variable of type String
icon5.gif  Acceleo how to change the value of a variable of type String [message #1272397] Mon, 17 March 2014 20:36 Go to next message
trimech saber is currently offline trimech saberFriend
Messages: 5
Registered: March 2014
Junior Member
Hi,
I created a variable of type String with the default value an empty string {test: String ='';}, I would like to change this value according to a conditional test , I try assignment with operation '=' [test = 'Public' /]
  but it does not work, I try [test.concat ('Public') /] but this command display the result in the file generation, I just made ​​the change the value of variable without displaying the result ......
Re: Acceleo how to change the value of a variable of type String [message #1272577 is a reply to message #1272397] Tue, 18 March 2014 08:37 Go to previous message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7679
Registered: July 2009
Senior Member
Hi

I suspect that you are trying to make an immutable String mutable, but
it's only a guess. Acceleo extends OCL and is declarative so you cannot
reassign variables, you create new ones.

You might find https://wiki.eclipse.org/OCL/ForumNetiquette provides
some ideas on more effective communication.

Regards

Ed Willink



On 17/03/2014 20:36, trimech saber wrote:
> Hi, I created a variable of type String with the default value an
> empty string {test: String ='';}, I would like to change this value
> according to a conditional test , I try assignment with operation
> '=' [test = 'Public' /] but it does not work, I try [test.concat
> ('Public') /] but this command display the result in the file
> generation, I just made ​​the change the value of variable without
> displaying the result ......
Previous Topic:[Acceleo] how to inject manual model
Next Topic:[Acceleo] How to get attributes from this meta-model
Goto Forum:
  


Current Time: Sat Nov 09 00:30:27 GMT 2024

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

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

Back to the top