Create JSON with Collection for Multi Instance process

Hi,
I’m trying to test this example: https://github.com/mwiede/camunda-samples/tree/master/multi-instance-example to understand how multi instance works, and if it fits to resolve my problem.

I deployed this BPM diagram into my camunda engine, and I not able to start process, because I don’t know how to build a custom variable for the multi instance process.
This is my json request:

{
    "variables": {
        "assignee": {
            "value": ["u1","u2","u3"],
            "type": "Object",
            "valueInfo": {
                "objectTypeName": "java.util.collections",
                "serializationDataFormat":"application/json"
            }
        }
    },
    "businessKey": "123"
}

but i’m getting this error and I don’t know how to solve it:

{
    "type": "InvalidRequestException",
    "message": "Cannot instantiate process definition multiInstanceUser:4:40803c65-e8f8-11e9-9683-2aa92dfa4b86: Must provide 'null' or String value for value of SerializableValue type 'Object'."
}

Could someone provide a valid JSON to send a Collection variable via API Rest? Thanks!

Hey @pipeline,

Thanks for your post. It is necessary to escape the value String as below. Additionally, make sure the ObjectTypeName is the correct one (Uppercase C in Collection). The name of the Collection variable should also be assigneeList instead of assignee.

{
    "variables": {
        "assigneeList": {
            "value": "[\"u1\",\"u2\",\"u3\"]",
            "type": "Object",
            "valueInfo": {
                "objectTypeName": "java.util.Collection",
                "serializationDataFormat":"application/json"
            }
        }
    },
    "businessKey": "123"
}

Does this make sense?

Regards,