Camunda在启动过程时将列表作为过程变量发送

问题描述

我的Springboot应用程序中有一些过程,想通过休息来启动它。

http://localhost:8080/rest/process-deFinition/Kvorum:2:c10196c1-1935-11eb-b60d-7a7bf841afbd/start

连身:

{
    "variables": {
        "list": {
            "value": "[\"1\",\"2\"]","type": "String"
        }
    },"businessKey": "myBusinessKey","withVariablesInReturn": true
}

我需要在这里写什么:

"list": {
    "value": "[\"1\","type": "Object"
}

接收List而不是String,并在JavaDelegate中将其用于代码如下:

List<String> list = (List) execution.getvariable("list");

解决方法

    "list": {
        "value": "[\"1\",\"2\"]","type": "Object","valueInfo" : {"objectTypeName": "java.util.ArrayList","serializationDataFormat":"application/json"}
    }