While the EPC comes with default templates, users have the ability to create custom templates. This allows for the creation of purpose-driven and company specific documents that contain only the information necessary. Creating templates come with a few rules however.

Syntax

The template can be createdin Microsoft Word, or any other software that can save a docx. For complete documentation on syntax, see the docxtemplater documentation

Tags are wrapped around brackets { }

Ex. {name} – this will insert the name of an object in the template

Characters not delimited by brackets will be printed as they appear in the template.

Ex. Hi! My name is {name}

The line above will result in: Hi! My name is Kevin

Conditions & Loops

Conditions & Loops start with a slash and end with a #. For example, {#responsible} starts a condition/loop and {/responsible} ends it.

Conditions can be used to display information if the condition is true. Loops are used to display information in a loop; for example, if we want to display the name of each task in a process, we would use a loop.

As an example, consider we want to list all tasks in a process, and determine if the Sales Manager is responsible for each task or not. Each loop, condition and tag will be broken down in the example.

{#templaterProcesses}{#nodes}{name}{#roles}{#target}{#name}{#responsible}YES{/responsible}{/name}{/target}{/roles}{/nodes}{/templaterProcesses}

For more information on tags, refer to the previous sections.

  • Loop: {#templaterProcesses}{/templaterProcesses} is needed to display the information. templaterProcesses is the object that contains all of the information required to generate an SOP. We must therefore include this at the beginning to loop through the object (think of a for each loop)
  • Loop: {#nodes}{/nodes} contains all of the flow objects for a process. To display the name of each task, we need to loop through all of the flow objects and display the name (think of a for each loop)
  • Name tag: {name} will display the name of the flow object (task). Notice that it is nested inside the {#node}{/node} loop. Therefore, for each flow object, display the name.
  • Loop: {#roles}{/roles} contains the information on roles and responsibilities. Notice that this loop is nested inside {#nodes}{/nodes}. For each flow object, display the information relevant to the attached role.
  • Condition: {#responsible}YES{/responsible} is a condition – not a loop. See the previous sections; if a tag is marked as a boolean, then they can be used to create conditions. In this case, if the sales manager is responsible for the task, YES will be displayed. If not, nothing will be shown.

Tips

  • If you find yourself pressed for space in the word document due to all of the lengthy tags, reduce the font size of anything that will not be printed out. For example, given, {#roles}{name}{/roles} the font size of {#roles} and {/roles} can be set to be smaller – even 0.5
  • You do not need to open and close a loop at every line. Mutliple tags can be inserted in a single loop of the templaterProcesses object. See the code block below for an example
{#templaterProcesses}
{#process}
Process Name: {name}
Creation Date: creationDate
{#roles}{#target}Responsible: {name}{/target}{/roles}
{/process}
{#nodes}Task Name: {name}{/nodes}
{/templaterProcesses}

This code block will generate the following output:

Process Name: 1.0 Shipping
Creation Date: 2018-08-12
Responsible: Warehouse Manager
Space
Task Name: 1.1 Find items in order
Task Name: 1.2 Load into shipping crate
Task Name: 1.3 Send shipping crate 
  • New lines are kept inside of the loop. Given
{#nodes}
    {name}
{/nodes}

The following output will be generated:

Space
Task Name: 1.1 Find items in order 
Space
Space
Task Name: 1.2 Load into shipping crate
Space
Space
Task Name: 1.3 Send shipping crate 
Space

To avoid this, place the looping tags on a single line

Feedback

Was this helpful?

Yes No
You indicated this topic was not helpful to you ...
Could you please leave a comment telling us why? Thank you!
Thanks for your feedback.

Post your comment on this topic.

Please do not use this for support questions.
Visit the Support Portal

Post Comment