Hello Camunda Community,
i’m working with the camunda rest api and found a litte “mistake”.
I want to start a new workflow and found this api call:
https://docs.camunda.org/manual/7.4/reference/rest/process-definition/post-start-process-instance/
Yes this works, but it’s a little bit unclean, because you don’t use an JSON Array for multiple variables.
Your request looks so:
{“variables”:
{“aVariable” : {“value” : “aStringValue”, “type”: “String”},
“anotherVariable” : {“value” : true, “type”: “Boolean”}},
“businessKey” : “myBusinessKey”
}
Now when i try to parse objects with the “gson”-lib, i can’t rebuild this request, because a list of ofjects will be parsed as an array:
{“variables”:
[
{“variableName”: “myVariable”, “value” : “aStringValue”, “type”: “String”},
{“variableName”: “anotherVariable”, “value” : “aStringValue”, “type”: “String”},
]
“businessKey” : “myBusinessKey”
}
So i have to build this request manualy instead of generating it with “gson”.
It would be very nice, if you could change this in future
Regards