2017-09-23 46 views
1

我想在下面的mule Transform消息中連接字符串,但我在運行時遇到下面的異常。任何人都可以請幫助我嗎?我也是新來的騾子。如何在mule變換消息中附加/連接字符串?

%dw 1.0 
%output application/json 
--- 
{ 
    references : "" when payload[0].person_id==null otherwise "person/"+payload[0].person_id, 
} 

異常:

Root Exception stack trace: 
com.mulesoft.weave.mule.exception.WeaveExecutionException: Exception while executing: 
    references : "" when payload[0].person_id==null otherwise "person/"+payload[0].person_id, 
                  ^
Type mismatch for '+' operator 
    found :string, :number 

回答

2

參考Mule Documentation爲騾子Dataweave運營商。應該使用連接字符串++運算符。像

%dw 1.0 
%output application/json 
--- 
{ 
    references : "" when payload[0].person_id==null otherwise "person/" ++ payload[0].person_id 
} 

希望這有助於。

+0

Anupambhusari其工作。謝謝!!!!。 –