[Acceleo] Filename based on result of EOperation [message #1781429] |
Wed, 07 February 2018 04:44  |
Eclipse User |
|
|
|
I would like to generate a file whose name depends on the result of a called EOperation which returns a string.
So instead of doing this:
[file ('APPLICATION.'.concat(application.name), false, 'UTF-8')]
contents
[/file]
which works fine.
I would like to do this where getPropertyFileName is an EOperation I have added to the application model element.
[file ('APPLICATION.'.concat(application.getPropertyFileName()), false, 'UTF-8')]
contents
[/file]
But I get an error from Acceleo:
org.eclipse.acceleo.engine.AcceleoEvaluationException: Couldn't evaluate URL of the file at line 310 in Module generate for block file('APPLICATION.'.concat(application.getPropertyFileName()), false, 'UTF-8'). Last recorded value of self was mymodel.impl.ApplicationImpl@3c77d488 (name: MyApp).
Not sure what the error message is doing to help me here?
Does the Acceleo file creation support the calling of an EOperation? It shows up as valid when I do ctrl-space.
Regards,
Bruce
[Updated on: Wed, 07 February 2018 04:45] by Moderator
|
|
|
Re: [Acceleo] Filename based on result of EOperation [message #1782436 is a reply to message #1781429] |
Fri, 23 February 2018 08:42  |
Eclipse User |
|
|
|
Hello Bruce,
What you're pasting here looks alright, this should have worked, as long as "getPropertyFileName" exists on "application" and can be called. You can try to check what would happen with the following:
[file ('log', false, 'UTF-8')]
[application.getPropertyFileName()/]
[/file]
[file ('APPLICATION.'.concat(application.getPropertyFileName()), false, 'UTF-8')]
...
This will force Acceleo into trying to generate the result of calling "getPropertyFileName()" into a file named "log" at your generation root and help us debug the issue.
Laurent Goubet
Obeo
|
|
|
Powered by
FUDForum. Page generated in 0.05295 seconds