public static ProcessDefinitionInfo of(ProcessDefinition definition) { ProcessDefinitionInfo info = new ProcessDefinitionInfo(); info.copyFrom(definition); info.hasGraphicalNotation = definition.hasGraphicalNotation(); info.hasStartFormKey = definition.hasStartFormKey(); return info; }
public static ProcessDefinitionInfo of(ProcessDefinition definition) { ProcessDefinitionInfo info = new ProcessDefinitionInfo(); info.copyFrom(definition); info.hasGraphicalNotation = definition.hasGraphicalNotation(); info.hasStartFormKey = definition.hasStartFormKey(); return info; }
private List<ProcessDef> convert(List<ProcessDefinition> defs) { List<ProcessDef> datas = new ArrayList<ProcessDef>(defs.size()); for (int i = 0; defs != null && i < defs.size(); i++) { ProcessDef def = new ProcessDef(); ProcessDefinition def_ = defs.get(i); def.setCATEGORY_(def_.getCategory()); def.setDEPLOYMENT_ID_(def_.getDeploymentId()); def.setDGRM_RESOURCE_NAME_(def_.getDiagramResourceName()); def.setHAS_START_FORM_KEY_(def_.hasStartFormKey() ? 1 : 0); def.setID_(def_.getId()); def.setKEY_(def_.getKey()); def.setNAME_(def_.getName()); def.setRESOURCE_NAME_(def_.getResourceName()); // def.setREV_(def_.) def.setSUSPENSION_STATE_(def_.isSuspended() ? 1 : 0); def.setVERSION_(def_.getVersion()); Deployment deployment = repositoryService.createDeploymentQuery() .deploymentId(def_.getDeploymentId()).singleResult(); def.setDEPLOYMENT_NAME_(deployment.getName()); def.setDEPLOYMENT_TIME_(deployment.getDeploymentTime()); datas.add(def); } return datas; }
public ProcessDefinitionResponse createProcessDefinitionResponse(ProcessDefinition processDefinition, RestUrlBuilder urlBuilder) { ProcessDefinitionResponse response = new ProcessDefinitionResponse(); response.setUrl(urlBuilder.buildUrl(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(processDefinition.hasGraphicalNotation()); response.setTenantId(processDefinition.getTenantId()); // Links to other resources response.setDeploymentId(processDefinition.getDeploymentId()); response.setDeploymentUrl(urlBuilder.buildUrl(RestUrls.URL_DEPLOYMENT, processDefinition.getDeploymentId())); response.setResource(urlBuilder.buildUrl(RestUrls.URL_DEPLOYMENT_RESOURCE, processDefinition.getDeploymentId(), processDefinition.getResourceName())); if (processDefinition.getDiagramResourceName() != null) { response.setDiagramResource(urlBuilder.buildUrl(RestUrls.URL_DEPLOYMENT_RESOURCE, processDefinition.getDeploymentId(), processDefinition.getDiagramResourceName())); } return response; }