Instead of using Word fields, you can enter data item tokens inline with other text in your document and the Process Engine will find those strings and replace them with values. For example, you can include <%Solution.DataItems.Employee.FirstName%> in your document and the Process Engine will find and replace that text with the value of the Solution.DataItems.Employee.FirstName data item.
To find and replace data item tokens in a Word document with data item values, expression results, and Word field list, complete the following steps:
- Check out and open the process you want to edit.
- In the Toolbox pane, click Microsoft Office. A list of activities is displayed.
- Double-click or drag the Write Word Document activity into the process.
- Link the activity appropriately with other activities in the process.
- Right-click the Write Word Document activity. A shortcut menu is displayed.
- Select View Properties. The Write Word Document window is displayed.
- Click the Input File or Template Location tab. The corresponding screen is displayed.
- In the Input File Location field, select the appropriate input field editor and set the field to a value that is a location where the Word document is stored.
Note: |
If your system resource contains a data item in the connection string property, click Configuration values and enter a valid connection string for design-time, configuration purposes. |
- In the Authentication section, select Run as BPM Server or Specify credentials.
Note: |
If you select Run as BPM Server, access will be granted or rejected based on the BPM Server credentials. If you select Specify credentials, complete the Username, Password, and Include domain fields using the appropriate input field editors. The Include domain check box is optional. |
- Click the Data Mappings tab. The corresponding screen is displayed.
- Select the Find Values and Replace with Data Item Values check box.
- In the Data Item Name field, click the Data Item editor and select the relevant data item.
Note: |
Calculation data items are read-only. You cannot edit this type of data item. |
- In the Replacement property field, select the appropriate input field editor and set the field to a value that you want to replace the data item token with.
- Click the Output Destination tab. The corresponding screen is displayed.
- In the Output File Name field, select the appropriate input field editor and enter the name you want the file to have.
Note: |
You do not have to specify a file extension. The file extension from the input file will be used. |
- From the If the file already exists section, select Overwrite the file or Increment the file name.
Note: |
Select Overwrite the file to replace the existing file. Select Increment the file name to append a _1, for example, to the file name the first time the process runs and sees that a file already exists. The number will increment each time the process runs and finds a file with the same name. |
- In the Output File Location field, select the appropriate input field editor and set the field to a value that is a file location where you want to store the Word file.
- In the Authentication section, select Run as BPM Server or Specify credentials.
Note: |
If you select Run as BPM Server, access will be granted or rejected based on the BPM Server credentials. If you select Specify credentials, complete the Username, Password, and Include domain fields using the appropriate input field editors. The Include domain check box is optional. |
- Click OK. You configured the activity to find and replace data item tokens in a Word document with data item values, expression results, and Word field list.