mule dataweave条件检查循环

时间:2016-09-19 14:28:14

标签: loops conditional dataweave

我需要执行以下操作

1)如果addressline4存在,则提取addressline4并与Addressline1连接 2)如果地址线4不存在且地址线3存在,则提取地址线3并与地址线1连接 3)如果地址线4不存在,如果地址线3不存在且地址线2存在,则提取地址线2并与地址线1连接 4)仅提取Addressline1,其余全部为空

我尝试了以下内容,但似乎没有用,非常感谢任何帮助。另外我需要将街道的字符限制为40:

street:flowVars.addressLine1 ++''++ flowVars.addressLine4 when flowVars.addressLine4!=''否则flowVars.addressLine1 ++''++ flowVars.addressLine3 when flowVars.addressLine3!=''否则为flowVars.addressLine1 ++'''++ flowVars.addressLine2 when flowVars.addressLine2!=''否则为flowVars.addressLine1

1 个答案:

答案 0 :(得分:0)

我认为你的订单刚刚结束。

试试这个:

t: flowVars.addressLine1 ++ ' ' ++ flowVars.addressLine2 when flowVars.addressLine2 !='' otherwise flowVars.addressLine1 ++ ' ' ++ flowVars.addressLine3 when flowVars.addressLine3 !='' otherwise flowVars.addressLine1 ++ ' ' ++ flowVars.addressLine4 when flowVars.addressLine4 !='' otherwise flowVars.addressLine1