简体   繁体   中英

Conditional logic in logger in dataweave for Mulesoft

I need help on conditional logic in logger.

I am using attached code in logger processor but getting errors:

在此处输入图像描述

Are you looking to achieve something like below?

在此处输入图像描述

Update:

Try with the Logger content in the screenshot:

<logger level="INFO" doc:name="Logger" doc:id="a45f1214-f063-47bc-8c8f-a72b65b5633f" message='#[%dw 2.0
output  /java
var TxId="1"
---
if(!isEmpty(vars.TxType)) "Trx Id:" ++ TxId ++ " Trx Type:" ++ vars.TxType  else "Invalid Partner"]'/>

在此处输入图像描述

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.

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