Class AbstractFormRenderer

    • Constructor Detail

      • AbstractFormRenderer

        public AbstractFormRenderer​(String serverPath,
                                    String resources)
    • Method Detail

      • processFormLayout

        protected void processFormLayout​(FormInstance topLevelForm,
                                         FormInstance form,
                                         Map<String,​Object> inputs,
                                         Map<String,​Object> outputs,
                                         String layoutTemplate,
                                         StringBuilder jsonTemplate,
                                         boolean wrapJson,
                                         List<String> scriptDataList)
        Renders the entire form (including any subforms if found as nested forms)
        Parameters:
        topLevelForm - - the top level form to be rendered, if needed it should include all nested forms inside or lookup mechanism
        form - - form being currently processed - could be top level (on first iteration) or nested (on subsequent iterations)
        inputs - - data inputs or empty list
        outputs - - data outputs or empty list
        layoutTemplate - - layout template to be applied when processing form content
        jsonTemplate - - JSON template on how to retrieve data from rendered form - it's constantly updated by each form being processed
        wrapJson - - indicates if complex type information should be wrapped with type - usually it's set to true only multi subforms change it to false
        scriptDataList - - list of JS functions and code to be placed into the rendered html - at the end of the page
      • loadTemplates

        protected abstract void loadTemplates()
      • loadTemplate

        protected void loadTemplate​(String templateId,
                                    InputStream stream)
      • loadTemplate

        protected void loadTemplate​(freemarker.cache.StringTemplateLoader loader,
                                    String templateId,
                                    InputStream stream)
      • renderTemplate

        protected String renderTemplate​(freemarker.template.Configuration cfg,
                                        String templateName,
                                        Map<String,​Object> parameters)
      • getJSFieldType

        protected String getJSFieldType​(String type)
      • wrapEndFieldType

        protected String wrapEndFieldType​(String type)
      • appendRoleAssignment

        protected void appendRoleAssignment​(org.jbpm.casemgmt.api.model.CaseDefinition caseDefinition,
                                            StringBuilder jsonTemplate)
      • buildFunctionWithBody

        protected String buildFunctionWithBody​(String name,
                                               String body)
      • buildScriptData

        protected String buildScriptData​(List<String> scriptDataList)
      • getExtractionValue

        protected String getExtractionValue​(String jsType)
      • getValidationPatternByType

        protected String getValidationPatternByType​(String type)
      • getServerEndpointPath

        protected String getServerEndpointPath()
      • getEndpointSuffix

        protected String getEndpointSuffix()
        Additional (and optional) suffix to be added to an endpoint (used when starting process or case or interacting with user task)
      • getDocumentPath

        protected String getDocumentPath()