127.9. 如何从多个语句脚本获得结果
从 Camel 2.14 开始提供
因为 scripteengine evale 方法只在运行多个 statments 脚本时返回 Null。Camel 现在通过使用值集中的"result"键查找脚本结果的值。如果您有多个语句脚本,则需要确保将 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