Creating an answer mapping has the following prerequisites:
The user creating the mapping must have Template Administrator rights for Workspace
HotDocs Developer application
Relational database software (e.g. MS SQL Server, Oracle, Access).
Before following the instructions below you should create your answer mapping database. Example steps for setting up a database using MS SQL Server can be seen here.
There are two ways to integrate Answer Mapping with a HotDocs interview: Answer Source and Event-driven integration.
Displays a link on a template dialog. On clicking the link, the user sees a pop-up window from which they select answers. This is similar to the Answer Source in HotDocs desktop interviews.
In this URL:
Please continue to Part 2: Create an Answer Mapping XML File.
When using an Event-driven integration, Workspace configures specific queries to run when certain events occur during the interview. These events can occur when the interview starts, on navigating to a dialog, on navigating away from a dialog, or when the interview ends.
The template developer can also assign multiple commands per dialog / interview by setting the control variable using repeat indices, i.e.
SET Workspace_Mapping[0] TO "dialogname=* &mappingname=* &datasource=* &command=* &EventMask=*"
SET Workspace_Mapping[1] TO "dialogname=* &mappingname=* &datasource=* &command=* &EventMask=*"
SET Workspace_Mapping[2] TO "dialogname=* &mappingname=* &datasource=* &command=* &EventMask=*"
Now, you must create a new Answer Mapping XML file using the Answer Mapping XML. This file specifies:
You can use this table to replace the red placeholders in the example XML below (using an SQL database):
Placeholder | Replace with | Example |
NAME | The name of your database | employee_db |
USER | The user name you use to access your database software on the server | sa |
PASSWORD | The password you use to access your database software on the server | w0rkspac3 |
MACHINE | The name of your server machine followed by a backslash and your database program | MACHINENAME\SQLEXPRESS |
COMMAND | The command name you used in your template | EmployeeSelect |
TABLE | The name of your table in your database | Employee Details |
COLUMN | Start with the name of the first column in your table and continue until all columns have been listed | Employee Number |
VARIABLE | The name of the variable in your template that you want to map this column to | employee_number_n |
TYPE | The type of variable you are mapping to | 2 |
PROMPT | The column heading your want to display in the interview | Employee Number |
<?xml version="1.0" encoding="utf-8" ?>
<MappingData>
<DataSource ID="1" Name="NAME" Type="SQL">
<ConnectionString>provider=SQLNCLI10;user id=USER;password=PASSWORD;data source=MACHINE;initial catalog=NAME</ConnectionString>
<Command ID="1" Name="COMMAND" Type="AnswerSource">
<Query Type="Table">TABLE</Query>
<Filter></Filter>
<Mapping>
<Item FieldName="COLUMN" AnsName="VARIABLE" AnsType="TYPE" PrimaryKey="false" Display="true" Prompt="PROMPT"></Item>
<Item FieldName="COLUMN" AnsName="VARIABLE" AnsType="TYPE" PrimaryKey="false" Display="true" Prompt="PROMPT"></Item>
<!--repeat for all columns in your table-->
</Mapping>
</Command>
</DataSource>
</MappingData>
Once you have completed the XML file, you must save it by calling the Mapping Name you used in part 1.