|
Re: [Acceleo] Start a module with a SET parameter [message #765225 is a reply to message #764641] |
Tue, 13 December 2011 16:53 |
Ed Willink Messages: 7655 Registered: July 2009 |
Senior Member |
|
|
Hi
The root match condition is a variation point in transformation languages.
I think that, Acceleo iterates over all incoming root objects, so your
incoming set would be transformed element-wise.
Sets are not first class objects, so they are not really eligible for
matching.
I would recommend providing a first class object to contain your set,
otherwise you could live with Acceleo transforming each one by one, but
arrange for a guard so that only the first element produced a result on
behalf of all other elements.
Regards
Ed Willink
On 12/12/2011 07:22, Timothy Marc wrote:
> Hi all,
>
> I was wondering, whether it is possible to invoke a main module with a
> set of EObjects instead of only one EObject, something like this:
>
> [tempate myModule ( elements : Set(Element))]
> //...
> [/template]
>
> The generated API of the launcher allows only one single EObject. Can
> this be somehow achieved?
>
> Thanks for your hint.
>
> Timothy
|
|
|
Re: [Acceleo] Start a module with a SET parameter [message #765597 is a reply to message #765225] |
Wed, 14 December 2011 11:07 |
|
Hi Timothy,
The generated launcher is meant to be a simple starting point. It is sufficient for most cases, but it is extensible when you have more complex needs. What you wish to do is possible, but you'll have to customize the launcher in order to call the accuare APIs. Specifically, you should either
- Mark the "doGenerate" method "not generated" and change it to call the proper API
- Override the "generate" method directly
The "proper API" I mention is "AcceleoService.doGenerateTemplate(Module, String, List<? extends Object>, File, Monitor)" where the list of Object is the actual set of arguments you which to call the template with, instead of the standard "doGenerate" that iterates over the model for a corresponding element. Do not hesitate to ask if the API isn't clear on how to call it, or if you think we could simplify this .
Laurent Goubet
Obeo
|
|
|
Powered by
FUDForum. Page generated in 0.03770 seconds