Free cookie consent management tool by TermsFeed

Configuring Delimiters for Document Generation Smart Services

The delimiters used to customize the keys used to identify process data in text and HTML templates (in the Text, PDF, and HTML document smart service activities) can be modified in a custom configuration file.

See also: Configuring Custom Properties.

The template-merge-config.xml and is located in the <APPIAN_HOME>/deployment/web.war/WEB-INF/conf/components/merge directory. This page explains the various elements that can be configured in a custom version of the template-merge-config.xml configuration file.

In the Text Doc From Template and HTML Doc From Template Smart Services you are required to specify a template file that will be used to create a new document of the desired type. Moreover, in the Send E-Mail Smart SErvice, you may want to specify an HTML template for your email. In each case, the template file specified is searched for substitution keys which are enclosed by certain delimiters and replaced by values specified by the user. Now, the start and end delimiters of the substitution keys are configured in the template-merge-config\*.xml file. The following is a snippet from this XML configuration file:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
<?xml version="1.0" encoding="UTF-8"?>
<templateMergerConfigs>
	<templateMergers>
		<templateMerger name="text-html" type="com.appiancorp.asi.components.merge.impl.TextMerger">
			<properties>
				<!-- changing the delimiter values may cause existing processes to no longer function properly -->
				<property name="startDelimiter" value="###" />
				<!-- changing the delimiter values may cause existing processes to no longer function properly -->
				<property name="endDelimiter" value="###" />
			</properties>
		</templateMerger>
		<templateMerger name="pdf" type="com.appiancorp.asi.components.merge.impl.PdfMerger" />
	</templateMergers>
	<configs>
		<config name="smartnode" default="text-html">
			<mappings>
				<mapping extension="txt" mergerName="text-html" />
				<mapping extension="html" mergerName="text-html" />
				<mapping extension="htm" mergerName="text-html" />
				<mapping extension="pdf" mergerName="pdf" />
			</mappings>
		</config>
	</configs>
</templateMergerConfigs>

The following table describes each of the tags used in the above XML configuration file:

Name Description
templateMergerConfigs General tag enclosing the configurations of template mergers and mappings.
templateMergers General tag enclosing the configuration of template mergers.
templateMerger Configuration for a single template merger. The "name" attribute gives it a name to be referred to in the mappings,while the "type" attribute denotes the class that implements the merge algorithm.
properties General tag enclosing properties for the template merger being defined.
property A single property. Consists of a name and a value. Valid properties vary with the type of merger.
configs General tag enclosing the mapping of template mergers.
config General tag enclosing a single set of mappings. The "name" attribute gives a name to this set of mappings. The "default" attribute specifies the default merger for this configuration.
mappings General tag enclosing all the mappings of a single merger.
mapping A single mapping for a merger. It maps an extension to the name of a merger. The "extension" attribute is meant to be a file extension. The "mergerName" specifies the name of the merger as defined in the corresponding <templateMerger> tag.

Only one set of delimiters may be defined at a given time. The default start and end delimiters are "###" and "###" respectively. In case you wish to change the delimiters defined by default, you will need to modify the corresponding property in the above file. A restart of the application server for the changes to take effect. Once the application server is restarted, all template files are scanned for substitution keys enclosed by the delimiters defined in the template-merge-config-custom.xml.

Feedback