acceleo 3 - passing collection type as a parameter to a Java service problem [message #870717] |
Wed, 09 May 2012 08:36  |
Eclipse User |
|
|
|
Hi,
I am merging a plug-in written in Acceleo 2 to the new version Acceleo 3. In the old plug-in there are several calls to some java services with collection parameters. When I try to pass a collection to a Java service, I receive errors. I would like to know if it is possible to pass a collection from a template to a Java service as a parameter?
Thanks in advance.
|
|
|
|
|
Re: acceleo 3 - passing collection type as a parameter to a Java service problem [message #872073 is a reply to message #871538] |
Tue, 15 May 2012 08:13  |
Eclipse User |
|
|
|
Hi,
You should use in your Java service something like "sortTransitions(List<Transition> list)" and call it from a query with a Sequence(Transition). If I recall correctly the ability to use collections as a parameter of Java services was not included in Acceleo 3.0.x, I think we have introduced it in Acceleo 3.1.0 (we've just released 3.2.1). By the way, an operation named "sortedBy" is also available so you may not need the Java service at all.
Expression: [Sequence{'aaaa', 'bb', 'ccc'}->sortedBy(s: String | s.size())/]
Result: Sequence{'bb', 'ccc', 'aaaa'}
Regards,
Stephane Begaudeau, Obeo
--
Twitter: @sbegaudeau & @acceleo
Google+: stephane.begaudeau & acceleo
Blog: http://stephanebegaudeau.tumblr.com
Acceleo Documentation: http://docs.obeonetwork.com/acceleo
|
|
|
Powered by
FUDForum. Page generated in 0.03488 seconds