}
return new DeploymentResourceResponse(resourceId, resourceUrl, resourceContentUrl, contentType, type);
}
public ProcessDefinitionResponse createProcessDefinitionResponse(ProcessDefinition processDefinition, boolean graphicalNotationDefined, String serverRootUrl) {
ProcessDefinitionResponse response = new ProcessDefinitionResponse();
response.setUrl(formatUrl(serverRootUrl, RestUrls.URL_PROCESS_DEFINITION, processDefinition.getId()));
response.setId(processDefinition.getId());
response.setKey(processDefinition.getKey());
response.setVersion(processDefinition.getVersion());
response.setCategory(processDefinition.getCategory());
response.setName(processDefinition.getName());
response.setDescription(processDefinition.getDescription());
response.setSuspended(processDefinition.isSuspended());
response.setStartFormDefined(processDefinition.hasStartFormKey());
response.setGraphicalNotationDefined(graphicalNotationDefined);
response.setTenantId(processDefinition.getTenantId());
// Links to other resources
response.setDeploymentId(processDefinition.getDeploymentId());
response.setDeploymentUrl(formatUrl(serverRootUrl, RestUrls.URL_DEPLOYMENT, processDefinition.getDeploymentId()));
response.setResource(formatUrl(serverRootUrl, RestUrls.URL_DEPLOYMENT_RESOURCE, processDefinition.getDeploymentId(), processDefinition.getResourceName()));
if(processDefinition.getDiagramResourceName() != null) {
response.setDiagramResource(formatUrl(serverRootUrl, RestUrls.URL_DEPLOYMENT_RESOURCE,
processDefinition.getDeploymentId(), processDefinition.getDiagramResourceName()));
}
return response;
}