in src/main/java/com/epam/digital/data/platform/bpwebservice/service/StartBpService.java [258:272]
private Map<String, Object> getBusinessProcessOutputParameters(
BusinessProcessProperties bpProperties, ProcessInstanceWithVariablesDto processInstance) {
var processInstanceVars = processInstance.getVariables();
if (Objects.isNull(bpProperties.getReturnVars()) || Objects.isNull(processInstanceVars)) {
return Collections.emptyMap();
}
var bpOutputParameters = new HashMap<String, Object>();
bpProperties.getReturnVars().forEach(returnVar -> {
var value = processInstanceVars.get(returnVar);
bpOutputParameters.put(returnVar, Objects.isNull(value) || Objects.isNull(value.getValue())
? null : value.getValue().toString());
});
return Collections.unmodifiableMap(bpOutputParameters);
}