Hi,
I’ve created a ProcessInstance object using below code:
ProcessInstanceBuilder processInstanceBuilder = runtimeService.createProcessInstanceBuilder();
//add metadata as variables.
processInstanceBuilder.name(createProcessInstanceVO.getAppName());
processInstanceBuilder.processDefinitionKey(processDefinitionKey);
//TODO get rid of hardcoded strings.
processInstanceBuilder.variable("teamName", createProcessInstanceVO.getTeamName());
processInstanceBuilder.variable("serviceNowReference", createProcessInstanceVO.getServiceNowReference());
return processInstanceBuilder.start();
The returned object is of type ProcessInstance. When I debug my API, I can see that the object has a “variableInstances” object containing the “teamName” and “serviceNowReference”. So far, so good.
However, calling getVariables() on this returned object, results in an empty array.
I did not expect this and I am not sure how to retrieve the variables “teamName” and “serviceNowReference”
Am I conceptually missing something when it comes to creating and manipulating process instances?
edit: using flowable 6.0.0 and I’m excited to see that 6.0.1 is out already
Regards,
Chris