Use javascript script to modify list (camunda 7) `Cannot find serializer for value 'Untyped value '[]', isTransient = false'.`


I am using camunda 7.19. I’ve created small BPMN which has a process variable listValue

I would like to use js to modify the values of the list

the script is

function getNumber(){
    var number = execution.getVariable('number')
    print("found number " + number);
    var listValues = execution.getVariable('listValues');
    for (var i=0; i<listValues.length; i++)
        print(i + ". " + listValues[i]);

    const newList = [];
    execution.setVariable('listValues', newList);


I’ve added GraalVM Js to use this in the tests


the js script is called and I am able to read the values but the setVariable fails with Cannot find serializer for value 'Untyped value '[]', isTransient = false'.

I have checked and listValues is an array (with Array.isArray) but it doesn’t have the methods I would expect from an array (e.g. push).

Question: how do you manipulate the BPMN list variables in javascript?

do I have to use “Camunda Spin”?

Hello my friend \o

Yes, Camunda SpinJson “S()” would help you to solve your problem.
Look for Spin’s S() method.

Below JavaDoc SpinJsonNode:

I hope this helps!

William Robert Alves