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 (!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");
}