繁体   English   中英

骡子4中的Dataweave2.0

[英]Dataweave2.0 in mule 4

   notes=(payload.examples if payload.examples != null else “ “) ++ (\n\n**column1:\ntest: “ ++ vars.name) ++ ( “\n column2: “ ++ vars.date) ++ (“\n column3: “ ++ attributes.headers.speech)

这是 DataWeave 2.0,但错误提示输入无效。 有人知道如何在mule 4中解决这个问题吗?

您使用 if 执行条件检查的部分,即 '=.' 应该是'.='。如果这对你有帮助,请告诉我。

根据您对 DataWeave 1.0 的评论代码。 请在下面找到相应的 DataWeave 2.o 代码。

%dw 2.0
output application/json  
---
{
(payload mapObject (value, key) -> {
((key): value) if (key as String != "notes")
}),
notes: 
if (payload.examples != null)
  payload.examples
else
  "" ++ ("\n\n**column1:\ntest: " ++ vars.name) ++ ("\n column2: " ++ vars.date) ++      ("\n column3: " ++ attributes.headers.speech)

}

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM