我有一个外部groovy文件,它有3个在整个应用程序中使用的函数。它们的脚本与示例中使用的简单示例不同。如何从脚本组件中调用特定函数?例如,如果我在文件myscript.groovy中有以下函数:
def convert(valueList){
valueList.each{
//.... do some conversion
}
}
def convert(valueList, dataUsage){
valueList.each{
//.... do some conversion
}
}
///I want to be able to call it from a script component like below:
<script:component>
<script:script engine="groovy" file="myscript.groovy">
// How can I call the convert methods here...
</script:script>
<.script:component>
如何从脚本组件中调用mule app中的不同函数,如上所示?