[
https://issues.apache.org/activemq/browse/CAMEL-655?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Don Coleman updated CAMEL-655:
------------------------------
Attachment: CAMEL-655.patch.txt
The Jython JSR-223 engine defaults to compiling code in "exec" mode.
Changing this to "eval" mode allows Py.runCode() to return results to
engine.eval()
{code}
if (isPython()) {
ScriptContext context = engine.getContext();
context.setAttribute("com.sun.script.jython.comp.mode", "eval",
ScriptContext.ENGINE_SCOPE);
}
{code}
> Jython Expressions always return null/false
> -------------------------------------------
>
> Key: CAMEL-655
> URL: https://issues.apache.org/activemq/browse/CAMEL-655
> Project: Apache Camel
> Issue Type: Bug
> Components: camel-script
> Affects Versions: 1.3.0, 1.4.0
> Environment: Jython 2.2.1, camel-script 1.3.0/1.4.0-SNAPSHOT, jython
> integration lib from java.net or logicblaze.com repo
> Reporter: Aaron Mulder
> Assignee: Willem Jiang
> Attachments: CAMEL-655.patch.txt
>
>
> A Jython expression used for example like this always returns null, which is
> now translated to false:
> from("...").choice().when().jython("some expression").to(...)
> For example, here's an expression that always evaluates to null/false:
> request.headers['foo'] == 'bar'
> To see this, look at the test PythonExpressionTest in the camel-script module.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.