protected String render( String formName, String deploymentId ) { String formContent = formManagerService.getFormByKey( deploymentId, formName); if ( !StringUtils.isEmpty( formContent ) ) { return generateRenderingContextString( formContent, formManagerService.getAllFormsByDeployment( deploymentId ) ); } return null; }
@Override public String render(String name, Task task, ProcessDefinition process, Map<String, Object> renderContext) { if (task == null) return null; String lookupName = getTaskFormName( task ); if ( lookupName == null || lookupName.isEmpty() || !lookupName.endsWith( formExtension )) return null; String templateString = formManagerService.getFormByKey(task.getTaskData().getDeploymentId(), lookupName); if (templateString != null && !templateString.isEmpty()) return renderTaskForm(task, new ByteArrayInputStream( templateString.getBytes() ), renderContext); return null; }
@Override public String render(String name, ProcessDefinition process, Map<String, Object> renderContext) { String templateString = formManagerService.getFormByKey(process.getDeploymentId(), process.getId() + getFormSuffix()); if (templateString == null || templateString.isEmpty()) return null; return renderProcessForm(process, new ByteArrayInputStream(templateString.getBytes()), renderContext); }
if (defaultSubForm != null) { String subFormContent = formManagerService.getFormByKey(deploymentId, defaultSubForm);
@Override public Form getFormByPath( String ctxUID, String formPath ) { FormRenderContext renderContext = formRenderContextManager.getRootContext( ctxUID ); if ( renderContext != null ) { try { Object form = formManagerService.getFormByKey( renderContext.getDeploymentId(), formPath ); if (form == null) form = renderContext.getContextForms().get( formPath ); if ( form != null ) { if ( form instanceof Form ) { return (Form) form; } else if ( form instanceof String ) { Form result = formSerializationManager.loadFormFromXML( (String) form ); renderContext.getContextForms().put( formPath, result ); return result; } } } catch ( Exception e ) { log.warn( "Error getting form {} from context {}: {}", formPath, ctxUID, e ); } } return null; }
String templateString = formManagerService.getFormByKey(task.getTaskData().getDeploymentId(), lookupName);
if (defaultSubForm != null) { String subFormContent = formManagerService.getFormByKey(deploymentId, defaultSubForm); if (defaultSubForm != null) { String subFormContent = formManagerService.getFormByKey(deploymentId, defaultSubForm); if (subFormContent != null) {
String templateString = formManagerService.getFormByKey(process.getDeploymentId(), process.getId()); if (templateString == null) { templateString = formManagerService.getFormByKey(process.getDeploymentId(), process.getId() + getFormSuffix());
public String getCaseRenderedForm(String renderer, String containerId, String caseDefinitionId) { if (caseRuntimeDataService == null) { throw new RuntimeException("Case capability in jBPM UI are not enabled"); } String resolvedContainerId = registry.getContainerId(containerId, ContainerLocatorProvider.get().getLocator()); CaseDefinition caseDefinition = caseRuntimeDataService.getCase(resolvedContainerId, caseDefinitionId); if (caseDefinition == null) { throw new CaseDefinitionNotFoundException("Case definition " + resolvedContainerId + " : " + caseDefinitionId + " not found"); } String formStructure = formManagerService.getFormByKey(resolvedContainerId, caseDefinitionId + SUPPORTED_FORM_SUFFIX); FormInstance form = formReader.readFromString(formStructure); if (form != null) { form.setNestedFormsLookup(formId -> { Map<String, String> forms = indexedForms.get(resolvedContainerId); String formStructureNested = forms.get(formId); return formReader.readFromString(formStructureNested); }); } FormRenderer formRenderer = renderers.get(renderer); if (formRenderer == null) { throw new IllegalArgumentException("Form renderer with name " + renderer + " not found"); } String output = formRenderer.renderCase(resolvedContainerId, caseDefinition, form); return output; }
String formStructure = formManagerService.getFormByKey(resolvedContainerId, processId + SUPPORTED_FORM_SUFFIX);
String formStructure = formManagerService.getFormByKey(resolvedContainerId, name);