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

时间:2020-10-28 16:22:21

标签: java delegates 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\",\"2\"]",
    "type": "Object"
}

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

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

1 个答案:

答案 0 :(得分:1)

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