Text Merge Extensions

Last Updated: 12/09/2015 Introduced in Verision: 2.0

Decisions includes a number of built-in text merge fields like “Capitalize,” “Lower,” and “Insert Current Date.” These merge fields can be used to dynamically manipulate strings or insert data from other sources into a Text Merge.

Text merge extensions allow you to write custom text merge logic to accomplish any type of merge you would like. This example will show how to create a merge that returns the length of a string.
 
To begin, create a class library and add a reference to DecisionsFramework.dll.
 
Add the following using statements
Have your class inherit from and implement  AbstractStringFieldExtension.
 
When you implement this class you will see that it includes two override methods:  string GetMergeText and string Name.
 
The string returned by GetMergeText will be the string displayed at run time of your Text Merge. The string returned by Name will be the name of the merge displayed at design time.
 
Below is an example implementation of string Name which will return the name of “Get String Length”
This name of “Get String Length” will show up in the designer as shown below.
 getStringLength
 
 
Below is an example implementation of the string GetMergeText method which will return the length of the string.
Using this new Get String Length merge, the string’s length will be returned as shown below.
result
 

Additional Resources