result.setUrl(formatUrl(serverRootUrl, RestUrls.URL_TABLE, name));
return result;
}
public JobResponse createJobResponse(Job job, String serverRootUrl) {
JobResponse response = new JobResponse();
response.setId(job.getId());
response.setDueDate(job.getDuedate());
response.setExceptionMessage(job.getExceptionMessage());
response.setExecutionId(job.getExecutionId());
response.setProcessDefinitionId(job.getProcessDefinitionId());
response.setProcessInstanceId(job.getProcessInstanceId());
response.setRetries(job.getRetries());
response.setTenantId(job.getTenantId());
response.setUrl(formatUrl(serverRootUrl, RestUrls.URL_JOB, job.getId()));
if (job.getProcessDefinitionId() != null) {
response.setProcessDefinitionUrl(formatUrl(serverRootUrl, RestUrls.URL_PROCESS_DEFINITION, job.getProcessDefinitionId()));
}
if (job.getProcessInstanceId() != null) {
response.setProcessInstanceUrl(formatUrl(serverRootUrl, RestUrls.URL_PROCESS_INSTANCE, job.getProcessInstanceId()));
}
if (job.getExecutionId() != null) {
response.setExecutionUrl(formatUrl(serverRootUrl, RestUrls.URL_EXECUTION, job.getExecutionId()));
}
return response;
}