Most of the camel-script use cases are just a simple expression, we can polish the camel script code with your solution. Do you mind fill a JIRA[1] and submit a patch with a test case for it?
[1]https://issues.apache.org/jira/browse/CAMEL -- Willem Jiang Red Hat, Inc. Web: http://www.redhat.com Blog: http://willemjiang.blogspot.com (English) http://jnn.iteye.com (Chinese) Twitter: willemjiang Weibo: 姜宁willem On June 30, 2014 at 4:22:25 AM, Matt Sicker (boa...@gmail.com) wrote: > I'm not sure on the "proper" way to do it, but what I'd do is write a > Processor or similar in Jython for more complex Python scripts. > > > On 29 June 2014 10:09, Tim Dudgeon wrote: > > > I'd like to follow up on this as I've just hit the same issue. I know this > > thread dates from a year and a half ago, but it seems unanswered. > > > > The issue is that if you are using a Python script using the language > > component, it works fine if the script is a one line piece of text. e.g. > > the whole script is this: > > > > "Hello World!" > > > > In that case the return value of the script, and so what get's set to the > > message body is "Hello World!". > > But if its anything more complex like: > > > > val = 1 + 2 > > "Hello World!" > > > > then the return value from the script is null. > > I did find a workaround - set the return value to the request.body property > > in the Python script, and use the transform=false attribute for the > > language > > component URL. But was wondering what the way to get a multi-line script > > working correctly was. > > > > Tim > > > > > > > > -- > > View this message in context: > > http://camel.465427.n5.nabble.com/Return-Value-from-Python-Script-Not-In-Message-Body-tp5724056p5753009.html > > > > Sent from the Camel - Users mailing list archive at Nabble.com. > > > > > > -- > Matt Sicker >