由于我们可以使用$ {}访问属性文件中的值,在mule流中的任何位置,我们如何从groovy脚本中访问这些值?
${} properties get expanded in your xml when starting your application, the solution would be the same than for any other value you want available in the groovy script. I would save it as a flow variable and then retrieve it from Groovy through the message:
<flow name="reading-properties">
<set-variable variableName="myvar" value="${myvar}" />
<scripting:transformer name="readingProperties">
<scripting:script engine="groovy">
myvar = message.getInvocationProperty('myvar')
....
</scripting:script>
</scripting:transformer>
</flow>
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.