Data Operation - Template
Table of Contents
Template
template is an intermediate operation that creates a data resource from a template.
The template:
- and creates a data resource as output.
Related How-to's
Arguments
The template operations accept the following arguments.
- template-selectors - a list of data selectors that selects templates data resources.
- template-inline - a inline template with the following properties:
- logical-name: the logicalName (used to match the template to a source data resource)
- type: the mime type of the template
- content: the template text
- engine - the templating engine (default to native)
- granularity: defines the granularity of the execution (Default to resource)
Engine
The engine is the process that is responsible to transform a template in a document.
Tabulify supports the following value as engine:
- native (default) - the built-in tabulify engine
- thymeleaf - the the thymeleaf engine (natural template)
- pebble - the pebble engine (ninja syntax)
Type
type is the media type of the template. The type default to the type of the template.
Template Match
If the operation has:
- only one template defined, the template will be applied to all source data resource.
- several templates defined, the template will be the template that has the same logicalName than the source data resource
Syntax
This operation is a intermediate flow operation
- Template Selectors
- name: "Json"
op: "template"
args:
template-selectors:
- [email protected]
- [email protected]
- Inline Json Template
- name: "Json"
op: "template"
args:
template-inline:
type: json
content: |
{
"${group}": {
"${item_code}": {
"price": "${price}",
"description": "${description}"
}
}