45.6. 如何从多个语句脚本获得结果
Groovy 脚本引擎评估方法如果运行了多个语句脚本,则返回 Null
。Camel 使用值集中 的结果
键查找脚本结果值。如果您有多个语句脚本,请确保将 result 变量的值设置为脚本返回值。
bar = "baz"; # some other statements ... # camel take the result value as the script evaluation result result = body * 2 + 1
bar = "baz";
# some other statements ...
# camel take the result value as the script evaluation result
result = body * 2 + 1