How can I write this expression in mule 4 migrating from mule 3

Viewed 13

I am migrating mule 3 code to mule 4 and this is the code in Expression component .How can I migrate this into mule 4.

{
    vars.MessageArray = new java.util.ArrayList();
    vars.combinedArray = new java.util.ArrayList();
}

I am new to Mulesoft, and working on migration. I search around for above problem but I didn't got the correct answer. Can anyone help me what should I do in this?

1 Answers

This is just setting to vars to an empty Array. You can just two set-variable to set these variables and give the value []

For example:

<set-variable value="#[]" doc:name="combinedArray" variableName="combinedArray"/>
Related