Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » M2T (model-to-text transformation) » query with multiple parameters([Acceleo] invoking java method with multiple parameters)
query with multiple parameters [message #1737855] Wed, 13 July 2016 14:28 Go to next message
Viktoria Fink is currently offline Viktoria FinkFriend
Messages: 11
Registered: May 2016
Junior Member
Hi,

I try to pass two or more parameters to a java class. Every time I do that I get an error.

Invalid result for expression self.invoke('generator.extension.Extension', 'test(java.lang.Integer, java.lang.Integer)', Sequence {id, str}) at line 30 in Module generate for query test(Integer,String).


The query to this:

[query public test(id : Integer, str : String) :  String = invoke('generator.extension.Extension', 'test(java.lang.Integer, java.lang.Integer)', Sequence{id, str}) /]


It works with one parameter. I wonder if it's not designted to pass more than one or I'm doing something wrong.

EDIT:
Ok, I got the error now. It works if I don't mess up the data types. I'm good at making things chaotic.

Viktoria

[Updated on: Wed, 13 July 2016 15:02]

Report message to a moderator

Re: query with multiple parameters [message #1737859 is a reply to message #1737855] Wed, 13 July 2016 14:40 Go to previous message
Ed Willink is currently offline Ed WillinkFriend
Messages: 5977
Registered: July 2009
Senior Member
Hi

If you add an extra argument/parameter you must:

a) add an extra Parameter to the called Java operation
b) add an extra parameter to the invoke type signature definition
c) add an extra argument to the invoke Sequence of arguments
d) add an extra parameter to the wrapping query
e) add an extra argument to the query invocation

Miss any one and you have an obscure error message, possibly only at
run-time.

IIRC I raised a Bugzilla for a validation of this long time ago.

Regards

Ed Willink

On 13/07/2016 15:28, Viktoria Fink wrote:
> Hi,
>
> I try to pass two or more parameters to a java class. Every time I do
> that I get an error.
>
>
> Invalid result for expression
> self.invoke('generator.extension.Extension', 'test(java.lang.Integer,
> java.lang.Integer)', Sequence {id, str}) at line 30 in Module generate
> for query test(Integer,String).
>
>
> The query to this:
>
> [query public test(id : Integer, str : String) : String =
> invoke('generator.extension.Extension', 'test(java.lang.Integer,
> java.lang.Integer)', Sequence{id, str}) /]
>
> It works with one parameter. I wonder if it's not designted to pass
> more than one or I'm doing something wrong.
>
> Viktoria
Previous Topic:Template parameter altered by passing the result of a query
Next Topic:Operation and parameters code generation queries
Goto Forum:
  


Current Time: Thu Jul 19 09:40:51 GMT 2018

Powered by FUDForum. Page generated in 0.02193 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top