我有一个名为“finalPrice”的全局函数,它在我的 configuration.xml 文件中定义。该函数接受一个值 - 对其进行处理 - 并返回最终值。我从 DataWeave 中引用该函数。当我单击“预览”时,我可以在预览窗口中看到正确的输出。但是,当我运行它时,我得到了错误:
消息:执行时出现异常:
没有名为“finalPrice”的变量。
我已经在本地机器和 CloudHub 上运行了代码,得到了相同的结果
XML 代码:
<configuration doc:name="Configuration">
<expression-language>
<global-functions>
<!-- This function is called by the 'Validate and Transform' dataweave component in the 'main' flow-->
def finalPrice(incoming_value)
{
import java.lang.String;
import java.math.RoundingMode;
// Do Stuff
return strFinalNumber;
}
</global-functions>
</expression-language>
</configuration>
数据编织代码:
//Refer to "finalPrice" Global Function in the main.xml configuration file
DB_FINL_PRCE: "field_missing" when payload01.DB_FINL_PRCE == "" otherwise finalPrice(payload01.DB_FINL_PRCE)
任何帮助表示赞赏