0

I am using choice router to evalute expression. Here is the expression

enter image description here

and I tested this expression in dataweave here is the result.

enter image description here

but when I use the choice router to evalute the expression I am getting this result

enter image description here

and another thing the value of "payload.relations.rel" is "Microsoft.VSTS.Common.TestedBy-Reverse" why I am getting false for this expression bench : payload.relations.rel == "Microsoft.VSTS.Common.TestedBy-Reverse"

enter image description here

aled
  • 21,330
  • 3
  • 27
  • 34
kushma gonna
  • 236
  • 3
  • 19
  • Please use text instead of images. See https://meta.stackoverflow.com/questions/285551/why-not-upload-images-of-code-errors-when-asking-a-question for more details on the reason. Instead provide the XML of the flow as text in your question. – aled Mar 31 '22 at 11:29
  • Also you are apparently showing the error returned in Postman. Copy and paste the complete error from the Mule application log, again as text. See https://meta.stackoverflow.com/questions/359146/why-should-i-post-complete-errors-why-isnt-the-message-itself-enough for an explanation. Kindly read https://stackoverflow.com/help/how-to-ask for tips on how to improve your question. – aled Mar 31 '22 at 13:16

1 Answers1

0

The error is not from DataWeave. In Mule 3.x the expression language used is MEL (Mule Expression Language). DataWeave is only used in Transform components. This is different from Mule 4.x where DataWeave 2 is used as the expression language. Testing the expression of the choice in DataWeave is not a good test.

Also your tests show that you are comparing an array (payload.relations.rel) to a String. Try fixing the comparison first. Then if you still have the error try putting it into a logger component before the choice and see if it prints the right result.

aled
  • 21,330
  • 3
  • 27
  • 34