Comparison of Document Generation Approaches

Introduction

When generating documents in Appian, you’ll first want to decide which method to use, either Out-of-the-Box (OOB) functionality or the Advanced Document Templating (ADT) Smart Service. Factors you’ll want to consider when deciding which approach to take are the complexity of the document, how many inputs the document will have, and dynamism of inputs.

Out-of-the-Box Functionality - MS Word 2007 Doc From Template

Appian OOB functionality, using the MS Word 2007 Doc From Template node, is a good option for generating documents with:

  • 10 or less inputs

  • Static sections/tables

  • Static content (unlikely to change format)

Good use cases for the OOB node include documents that have hard-coded, static values as inputs, as well as documents that do not need to handle for dynamism.

The benefit of using the OOB node is that it is less complex than the ADT node for documents that fit the criteria of the bullet points listed above. It also does not require any extra plugin to deploy to a new environment as it is apart of Appian’s base product.

Advanced Document Templating Smart Service

The ADT Smart Service, using the Advanced Document Templating Smart Service node, is a good option for generating documents with:

  • More than 10 inputs

  • Dynamic sections/tables

  • Dynamic content (the format of the document could undergo iterations of changes)

Good use cases for the ADT node include documents that need to dynamically display rows in a grid, sections of a word document, or images. Additionally, if you have more than 5 different documents that you’ll be generating in one process, you will want to use the ADT node because it allows for dynamic generation of multiple documents with one node.

Benefits of using the ADT node include:

  • A single XML rule handles all template changes, which allows for easy testing, troubleshooting, and updating of template

  • Capability to handle dynamic content

  • Can reuse the node for multiple documents, no need for multiple ADT nodes per process model

Comparison of OOB and ADT Methods

  OOB Word Template Generation ADT Smart Service
Allows for Dynamism? No Yes
Management Template & Node Template & XML
Error Message Handling Occurs when opening the document in Tempo Output parameter of node in Process Model
Performance Memory-efficient Long strings of XML can take up memory
Inputs ###input### Uses Freemarker language
Number of Nodes One node per template One node per multiple templates

OOB Solution Overview

The following steps outline the high-level solution overview for using the Out-of-the-Box document generation functionality.

  1. Create a document template and wrap input values with ###

    a. Example: ###firstName###

  2. Upload the document template to Appian

    b. Run spell check to avoid errors

  3. Within the MS Word 2007 Doc From Template node

    a. Select the template and map identified inputs to the correct process variables

    b. If a new template version has been uploaded, select "Rescan Template" link to ensure the latest variables are available for mapping

    Variables previously mapped in this node may need to be remapped if significant changes were made to the document.

ADT Solution Overview

The following steps outline the high-level solution overview for using the ADT document generation functionality.

  1. Create a document template and using freemarker language

  2. Upload the document template to Appian.

    a. Run spell check to avoid errors

  3. Create an XML expression rule containing all inputs to document template

    a. Create nested rules if you have dynamic content

    b. You cannot use the toxml() function when creating this XML because the plugin accepts a specific XML format not compatible with toxml()

  4. Within the DOCX from Dynamic Template node

    a. Map the required inputs

    Required inputs are the Docx template, the XML data model and Create New Document (boolean).

    b. Map any other relevant inputs

Other Technical Considerations

  • Illegal characters (<, >, and &) must be escaped before generating template

    • Suggestion is to create a rule that you wrap around either each input in the OOB node or each input of XML for ADT node that replaces these characters with legal characters