Skip to content

Template

Johannes Heucher edited this page Oct 12, 2022 · 3 revisions

Figure 1: Template

To create documents with a mixture of text and configuration parameters, the Xyna Process Modeller provides Templates. Templates are Modeling Blocks that can be dragged into a Workflow. These may be filled with arbitrary text. Additionally Data Types can be dragged into the Template text area to serve as wildcards for specific values during runtime. The Data Type usage can be extended by calculations and function calls via Formula Modeling.

Templates define the content of a Template-based text document. Consecutive Templates are automatically concatenated to a single document during runtime. All Templates between the Begin Document and the End Document object are assigned to the same document. In nested Begin Document/End Document context a Template will always be assigned to the closest Begin Document.

Templates can also be used in Subworkflows, as long as the calling Workflow contains a Begin Document.

Add a Template to a Workflow

To insert a Template into a Workflow, drag the Template symbol out of the icon bar. Now start writing plain text. Drag parameters from above this Template into the text. At runtime, their values will be inserted at that position.

Each parameter inside of the text has to have a simple type, e.g. String or Integer. If there is a parameter with a complex Data Type, choose one of its Member Variables having a simple type by using the techniques of Formula Modeling. Via Formula Modeling the term can be enhanced by additional calculations and function calls.

Figure 2: Creating a JSON message

Example

Templates can be used for a lot of use cases, e.g. building XMLs, HTML pages, JSON requests/responses, or any sort of configuration data. Figure 2 displays an example for creating a JSON message.

See Also

Clone this wiki locally