}
ProcessDefinitionQuery processDefinitionQuery = getProcessEngine().getRepositoryService().createProcessDefinitionQuery();
processDefinitionQuery = processDefinitionQuery.processDefinitionKey(processDefinitionKey);
ProcessDefinition processDefinition = processDefinitionQuery.latestVersion().singleResult();
if (processDefinition == null) {
String errorMessage = String.format("No matching process definition with key: %s ", processDefinitionKey);
throw new RestException(Status.NOT_FOUND, errorMessage);
}