I can't call a java wrapping service in Acceleo because it doesn't recognize parameters type. This is my simple test code: the main calls a query stored in Services.mtl, that calls the java service that just return the name of an object "Send"
Main.mtl
[file ('system.P', false, 'UTF-8')]
[for (t : Send | aSystemBehavior.transitions)) ]
[getName(t)/]
[/for]
[/file]
Services.mtl
[query public getName(arg0 : Send) : String
= invoke('myPackage.Services', 'getName(myPackage.Send)', Sequence{arg0})
/]
Services.java
public class Services
{
public String getName(Send t)
{return t.getName();}
}
The Error Log shows:
Invalid result for expression self.invoke('myPakage.Services', 'getName(myPakage.Send)', Sequence {arg0}) at line 0 in Module services for query getName(Send). Last recorded value of self was org.eclipse.emf.ecore.impl.DynamicEObjectImpl@1f00eb36 (eClass: org.eclipse.emf.ecore.impl.EClassImpl@2c2aade3 (name: Send) (instanceClassName: null) (abstract: false, interface: false)). Problem found while generating the file system.P'.
If I use a String as parameter type instead of Send, everything works fine.