use of org.activiti.rest.service.api.history.HistoricProcessInstanceResponse in project Activiti by Activiti.
the class RestResponseFactory method createHistoricProcessInstanceResponseList.
public List<HistoricProcessInstanceResponse> createHistoricProcessInstanceResponseList(List<HistoricProcessInstance> processInstances) {
RestUrlBuilder urlBuilder = createUrlBuilder();
List<HistoricProcessInstanceResponse> responseList = new ArrayList<HistoricProcessInstanceResponse>();
for (HistoricProcessInstance instance : processInstances) {
responseList.add(createHistoricProcessInstanceResponse(instance, urlBuilder));
}
return responseList;
}
use of org.activiti.rest.service.api.history.HistoricProcessInstanceResponse in project Activiti by Activiti.
the class RestResponseFactory method createHistoricProcessInstanceResponse.
@SuppressWarnings("deprecation")
public HistoricProcessInstanceResponse createHistoricProcessInstanceResponse(HistoricProcessInstance processInstance, RestUrlBuilder urlBuilder) {
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.setName(processInstance.getName());
result.setProcessDefinitionId(processInstance.getProcessDefinitionId());
result.setProcessDefinitionUrl(urlBuilder.buildUrl(RestUrls.URL_PROCESS_DEFINITION, processInstance.getProcessDefinitionId()));
result.setStartActivityId(processInstance.getStartActivityId());
result.setStartTime(processInstance.getStartTime());
result.setStartUserId(processInstance.getStartUserId());
result.setSuperProcessInstanceId(processInstance.getSuperProcessInstanceId());
result.setUrl(urlBuilder.buildUrl(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, urlBuilder));
}
}
result.setTenantId(processInstance.getTenantId());
return result;
}
Aggregations