return result;
}
@SuppressWarnings("deprecation")
public HistoricProcessInstanceResponse createHistoricProcessInstanceResponse(HistoricProcessInstance processInstance, String serverRootUrl) {
HistoricProcessInstanceResponse result = new HistoricProcessInstanceResponse();
result.setBusinessKey(processInstance.getBusinessKey());
result.setDeleteReason(processInstance.getDeleteReason());
result.setDurationInMillis(processInstance.getDurationInMillis());
result.setEndActivityId(processInstance.getEndActivityId());
result.setEndTime(processInstance.getEndTime());
result.setId(processInstance.getId());
result.setProcessDefinitionId(processInstance.getProcessDefinitionId());
result.setProcessDefinitionUrl(formatUrl(serverRootUrl, RestUrls.URL_PROCESS_DEFINITION, processInstance.getProcessDefinitionId()));
result.setStartActivityId(processInstance.getStartActivityId());
result.setStartTime(processInstance.getStartTime());
result.setStartUserId(processInstance.getStartUserId());
result.setSuperProcessInstanceId(processInstance.getSuperProcessInstanceId());
result.setUrl(formatUrl(serverRootUrl, RestUrls.URL_HISTORIC_PROCESS_INSTANCE, processInstance.getId()));
if (processInstance.getProcessVariables() != null) {
Map<String, Object> variableMap = processInstance.getProcessVariables();
for (String name : variableMap.keySet()) {
result.addVariable(createRestVariable(name, variableMap.get(name),
RestVariableScope.LOCAL, processInstance.getId(), VARIABLE_HISTORY_PROCESS, false, serverRootUrl));
}
}
result.setTenantId(processInstance.getTenantId());
return result;
}