eclipse - Invoking Java Code with Acceleo -
eclipse - Invoking Java Code with Acceleo -
i seek invoke java code in template acceleo. code given there : http://wiki.eclipse.org/acceleo/faq#how_to_use_a_java_service_in_acceleo works fine code doesn't , don't find error.
here java function :
public string test(softo.activite activity) { homecoming activity.getmodxname(); } and template code :
[query public gettest(a : activite) : string = invoke('org.eclipse.acceleo.softogen.files.utility','test(softo.activite activity)', sequence{a}) /] [template public createoperationurl(activity : accessibleactivite) ] result : [gettest(activity)/] [/template] i tried replace homecoming function homecoming 'foobar' doesn't work either. don't have message when generate : file contains 'result :'. have checked paths , filenames use.
any thought solve problem ?
edit : okay ! found answer... it's stupid : in query code don't have set argument name, type, :
[query public gettest(a : activite) : string = invoke('org.eclipse.acceleo.softogen.files.utility','test(softo.activite activity)', sequence{a}) /] became :
[query public gettest(a : activite) : string = invoke('org.eclipse.acceleo.softogen.files.utility','test(softo.activite)', sequence{a}) /] and works... know =)
have exported bundle containing java service in manifest? if not, open file manifest.mf, go runtime tab , there, export bundle containing java class. can seek throw new runtimeexception() before "return" in java method if want sure service called.
eclipse templates model acceleo
Comments
Post a Comment