40.6. 複数ステートメントのスクリプトから結果を取得する方法
Groovy スクリプトエンジンの evaluate メソッドは、複数のステートメントのスクリプトを実行すると Null を返します。Camel は、値セットから result のキーを使用して、スクリプトの結果の値を検索します。複数のステートメントスクリプトがある場合は、result 変数の値をスクリプトの戻り値として設定してください。
bar = "baz";
# some other statements ...
# camel take the result value as the script evaluation result
result = body * 2 + 1