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.
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.
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
The following steps outline the high-level solution overview for using the Out-of-the-Box document generation functionality.
Create a document template and wrap input values with ###
a. Example: ###firstName###
Upload the document template to Appian
b. Run spell check to avoid errors
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
The following steps outline the high-level solution overview for using the ADT document generation functionality.
Create a document template and using freemarker language
Upload the document template to Appian.
a. Run spell check to avoid errors
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()
Within the DOCX from Dynamic Template node
a. Map the required inputs
b. Map any other relevant inputs
Illegal characters (<, >, and &) must be escaped before generating template