camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gavindscott <gavindsc...@gmail.com>
Subject Re: Invoking a bean returned by a previous bean invocation
Date Thu, 03 May 2012 18:24:30 GMT

Claus Ibsen-2 wrote
> 
> On Tue, May 1, 2012 at 8:11 PM, Purple Tea &lt;maisa_manoel@&gt; wrote:
>> Thank you for your reply.
>>
>> Does the simple language also allows us to send multiple method
>> parameters
>> like the new features offered in the bean binding?
>>
> 
> Yes, just provide a method signature such with the parameters
> separated by comma.
> There is a limitation on what can be passed in as parameters, but
> thats documented on that bean binding page
> 
> <simple>${body.doSomething("Hi Camel", ${header.bar}, true)}</simple>
> [ SNIP ]
> 

This seems to only work when the parameters are simple values such as
strings, integers, etc.  For example:

	public void testBodyOgnlOnAnimalWithOgnlParams() throws Exception {
		exchange.getIn().setBody(new Animal("tiger", 13));
		exchange.getIn().setHeader("friend", new Animal("donkey", 4));
		assertExpression("${body.setFriend(${header.friend})}", null);
	}

Fails with org.apache.camel.NoTypeConversionAvailableException: No type
converter available to convert from type: java.lang.String to the required
type: org.apache.camel.language.simple.SimpleTest.Animal with value donkey

Is that a known limitation?

--
Gavin Scott

--
View this message in context: http://camel.465427.n5.nabble.com/Invoking-a-bean-returned-by-a-previous-bean-invocation-tp5676696p5684000.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Mime
View raw message