Generate Text/Html
This handler (com.rierino.handler.TemplateEventHandler) provides ability to produce text outputs using templates and input payload.
Handler Parameters
This cacheable.
code.state
Name of the state manager with template definitions
template_code
handler_code
code.field
Json path for the data element of code record for template
template
code
helper
Class name for the template helper to use
com.rierino.handler.util.helper.HandlebarsTemplateHelper
-
This handler requires the following dependency added to deployment contents:
implementation (group:'com.rierino.processors', name: 'handlebars', version:"${rierinoVersion}")
Actions
ApplyTemplate
Produces text (e.g. plain, html) from given input data and template id. Event metadata fields applicable for this action are as follows:
inputElement
Json path for the input in request event payload
customer
-
outputElement
Json path for the output in response event payload
html
-
With event metadata parameters as:
templateId
Id of the template to use from code.state
landing_page
-
templateIdPath
Json path of the template in event payload
parameters.template
-
resultPath
Json path to add produced text on output element
output
result
ApplyTemplateList
Produces text from a given array of input data and template ids. Event metadata fields applicable for this action are as follows:
inputElement
Json path for the input in request event payload
list
-
outputElement
Json path for the output in response event payload
html
-
With event metadata parameters as:
structure
Structure of output to produce (, , )
map
-
delimiter
Delimiter for concatenating results if structure is "text"
\n
-
inputPath
Json path to get list of requests from
list
input
resultPath
Json path to add produced text on output element
output
result
Helpers
HandlebarsTemplateHelper
This helper (com.rierino.handler.util.helper.HandlebarsTemplateHelper) uses Handlebars library for processing given template.
FreemarkerTemplateHelper
This helper (com.rierino.handler.util.helper.FreemarkerTemplateHelper) uses Freemarker library for processing given template.
Last updated