Serialize variable in script task

Hi everyone

How can I serialize an array of objects (for example array of employees) via inline script task?
I want to use it as a collection in parallel multiinstance task.

Thanks

As far as I know, saving a variable in the process execution automatically serializes it in the database. Use setVariable, setVariables, setVariableLocal etc. all call to set the variable in the variable map in the process instance you are operating in and serialize it for the next activities to see and operate on.

I hope I understood your question correctly.