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 16:36 Go to next message
trimech saber is currently offline trimech saber
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 04:37 Go to previous message
Ed Willink is currently offline Ed Willink
Messages: 4008
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: Tue Jul 29 06:45:53 EDT 2014

Powered by FUDForum. Page generated in 0.01869 seconds