Table of Contents

Template

template is an intermediate step that creates a data resource from a template.

The template:

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:
  • template-email: define if an html template is an email template. It defaults to false, if true, the css rules will be in-lined for html template. If you use bootstrap, the bootstrap email css stylesheet is used instead.
  • engine - the templating engine (default to native)
  • step-granularity: defines the granularity of the execution
    • record: the template will be processed for each record (default)
    • resource: the template will be processed on all records (only available for a json template)
  • table-variables: template variables that defines tabular data. A map of:
    • name: a variable name
    • selectors: a data selector
    • parameters: a map of SQL parameters applied to the selected data query resources
      • name: the parameter name
      • value: the parameter value (you can reference value of the input data using the $ sign)
  • output-logical-name: a pattern that defines the logical name of:
    • the resources (for a template output)
    • or of the columns (for a extended-records)
  • output:
    • templates: the templates output
    • extended-records: the source records with extra columns that stores the templates output

Engine

The engine is the process that is responsible to transform a template in a document.

Tabulify supports the following value as engine:

Type

type is the media type of the template. The type default to the type of the template.

Template Match

If the operation has:

Syntax

This operation is a intermediate pipeline operation

  • Template Selectors
-   name: "Json"
    op: "template"
    args:
        template-selectors:
            - pattern@connection
            - pattern2@connection2
  • Inline Json Template
-   name: "Json"
    op: "template"
    args:
        template-inline:
            type: json
            content: |
                {
                    "${group}": {
                        "${item_code}": {
                            "price": "${price}",
                            "description": "${description}"
                        }
                }