Python has been edited by willem jiang (Jul 04, 2008).

Change summary:

Added the discription of how to get the result from Python script

(View changes)

Content:

Python

Camel supports Python among other Scripting Languages to allow an _expression_ or Predicate to be used in the DSL or Xml Configuration.

To use a Python _expression_ use the following Java code

import static org.apache.camel.builder.script.ScriptBuilder.*;

...

... python("somePythonExpression") ...

For example you could use the python function to create an Predicate in a Message Filter or as an _expression_ for a Recipient List

Since you can't get the python _expression_ script evaluation result from the script engine, you need to add a prefix " result = " before your _expression_.
We will take the result variable as the _expression_ result.

Reply via email to