@Override public ProcessSummary getProcessDesc(String deploymentId, String processId) { return ProcessHelper.adapt(bpmn2Service.getProcessDefinition(deploymentId, processId)); }
protected ProcessDefinition findProcessDefinition(String containerId, String processId) { containerId = context.getContainerId(containerId, ContainerLocatorProvider.get().getLocator()); ProcessDefinition procDef = definitionService.getProcessDefinition(containerId, processId); if (procDef == null) { throw new IllegalStateException("Process definition " + containerId + " : " + processId + " not found"); } return procDef; }
public String startProcessWithCorrelation(String containerId, String processId, String correlationKey, String payload, String marshallingType) { containerId = context.getContainerId(containerId, ContainerLocatorProvider.get().getLocator()); // check validity of deployment and process id definitionService.getProcessDefinition(containerId, processId); logger.debug("About to unmarshal parameters from payload: '{}'", payload); Map<String, Object> parameters = marshallerHelper.unmarshal(containerId, payload, marshallingType, Map.class); String[] correlationProperties = correlationKey.split(":"); CorrelationKey actualCorrelationKey = correlationKeyFactory.newCorrelationKey(Arrays.asList(correlationProperties)); logger.debug("Calling start process with id {} on container {} and parameters {}", processId, containerId, parameters); Long processInstanceId = processService.startProcess(containerId, processId, actualCorrelationKey, parameters); // return response String response = marshallerHelper.marshal(containerId, marshallingType, processInstanceId); return response; }
public String startProcess(String containerId, String processId, String payload, String marshallingType) { containerId = context.getContainerId(containerId, ContainerLocatorProvider.get().getLocator()); // check validity of deployment and process id definitionService.getProcessDefinition(containerId, processId); logger.debug("About to unmarshal parameters from payload: '{}'", payload); Map<String, Object> parameters = marshallerHelper.unmarshal(containerId, payload, marshallingType, Map.class); logger.debug("Calling start process with id {} on container {} and parameters {}", processId, containerId, parameters); Long processInstanceId = processService.startProcess(containerId, processId, parameters); // return response String response = marshallerHelper.marshal(containerId, marshallingType, processInstanceId); return response; }
public String startProcess(String containerId, String processId, String marshallingType) { containerId = context.getContainerId(containerId, ContainerLocatorProvider.get().getLocator()); // check validity of deployment and process id definitionService.getProcessDefinition(containerId, processId); logger.debug("Calling start process with id {} on container {} and parameters {}", processId, containerId, null); Long processInstanceId = processService.startProcess(containerId, processId); // return response String response = marshallerHelper.marshal(containerId, marshallingType, processInstanceId); return response; }
public String getFormDisplayProcess(String containerId, String processId, String lang, boolean filterContent, String formType) { containerId = registry.getContainerId(containerId, ContainerLocatorProvider.get().getLocator()); ProcessDefinition processDesc = definitionService.getProcessDefinition(containerId, processId); if (processDesc == null) { throw new IllegalStateException("Process definition " + containerId + " : " + processId + " not found"); } Map<String, String> processData = definitionService.getProcessVariables(containerId, processId); if (processData == null) { processData = new HashMap<>(); } Map<String, Object> renderContext = new HashMap<>(); renderContext.put("process", processDesc); renderContext.put("outputs", processData); renderContext.put("lang", lang); renderContext.put("filterForm", filterContent); for (UIFormProvider provider : providers) { // if there's no formType or formType is ANY the first provider able to generate the formContent wins if (!FormType.ANY.getName().equals(formType) && !provider.getType().equals(formType)) { logger.debug("Provider {} does not support {} form type", provider, formType); continue; } String template = provider.render(processDesc.getName(), processDesc, renderContext); if (!StringUtils.isEmpty(template)) { return template; } } logger.warn("Unable to find form to render for process '{}'", processDesc.getName()); throw new IllegalStateException("No form for process with id " + processDesc.getName() + " found"); }
public String getProcessRenderedForm(String renderer, String containerId, String processId) { String resolvedContainerId = registry.getContainerId(containerId, ContainerLocatorProvider.get().getLocator()); ProcessDefinition processDesc = definitionService.getProcessDefinition(resolvedContainerId, processId); if (processDesc == null) { throw new ProcessDefinitionNotFoundException("Process definition " + resolvedContainerId + " : " + processId + " not found");