簡體   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