Get Answer XML
This method generates HotDocs Answer XML from
the data entered into the displayed answer fields. HotDocs uses the answer
XML to create a document when assembling a HotDocs
Template.
In this Topic ShowHide
Prerequisites
Before you can use Get Answer XML, you must first:
- Register the Service Type
- Register a Service
Instance
Return Type
Get Answer XML returns an XML string.
Using Get Answer XML
SmartObject Tester
To generate Answer XML using the SmartObject Tester:
- Open the SmartObjects
Services Tester (typically located at C:\Program
Files (x86)\K2 blackpearl\Bin).
- Navigate to the SmartObject
Explorer node and expand All
SmartObjects.
- Right-click on the appropriate HotDocs SmartObject and select
Execute SmartObject.
- Select Method to Execute >
Get Answer XML.
- In the answer fields, enter appropriate answer data.
- Press Execute. Answer
XML appears in the Results section.
Using Get Answer XML in a K2 Process
To use Get Answer XML to Stream in a K2 Process:
- Open K2 Studio.
- Create a new project or open an existing project.
- In the Solution Explorer, expand the project and create or
open a process.
- Navigate to the Event Wizards
menu.
- Drag and drop SmartObject Event
onto appropriate location on the canvas.
- In the SmartObject Wizard, click Next
add an Event Name.
- Click the Context Browser
button next to the SmartObject Method field.
- Navigate to SmartObject Server(s)
> SmartObject Server.
- Navigate to the HotDocs
SmartObject created in the K2 SmartObject Tester.
- Expand the Packages
node.
- In the Packages node, expand a Template node. This
is a HotDocs Template you wish to use in the process.
- Expand the Single Method node.
- Select the Get Answer XML
option.
- Click Add.
- In the SmartObject Event Wizard, click Next.
- Click the right arrow on the right-hand side of the window to display
the context browser. Open the Process/Activity
Data tab and expand Data Fields.
- In Input Mapping, drag
and drop data fields from the Context Browser
into the Value column for the appropriate Input field. This maps data
from the process to fields used in the SmartObject.
- Click Next.
- In Return Mapping, drag
and drop a string data field from the Context Browser
into the Value column for the appropriate Return field. This maps
the data returned from the SmartObject to business data within the
process. This data can then be used to assemble a document, by passing
the data to another SmartObject that uses Assemble
Documents to Stream or Assemble
Documents to Disk.
- Click Next.
- Click Finish.
The new mapping appears in the process. You can now link the SmartObject
to other stages in the process.