Assemble Documents to Disk

The Assemble Documents to Disk method assembles a document from a HotDocs template and writes the results to disk. Typically, this method is used for test purposes. In most cases, the Assemble Documents to Stream method is recommended for use in production.

In this Topic Hide

Prerequisites

Return Type

Using Assemble Documents to Disk

SmartObject Tester

K2 Process

Prerequisites

Before you can use Assemble Documents to Disk, you must first:

  1. Register the Service Type
  2. Register a Service Instance

Return Type

Assemble Documents to Disk returns a string containing a file path to the folder containing the assembled documents.

Using Assemble Documents to Disk

SmartObject Tester

To assemble documents to disk using the SmartObject Tester:

  1. Open the SmartObjects Services Tester (typically located at C:\Program Files (x86)\K2 blackpearl\Bin).
  2. Navigate to the SmartObject Explorer node and expand All SmartObjects.
  3. Right-click on the appropriate HotDocs SmartObject and select Execute SmartObject.
  4. Select Assemble Documents to Disk from the Method to Execute drop-down menu.
  5. In the answer fields, enter appropriate answer data.
  6. Press Execute to write the file to the location specified by the SmartObject's Document Output Folder Path property.

K2 Process

To assemble documents to disk in a K2 Process:

  1. Open K2 Studio.
  2. Create a new project or open an existing project.
  3. In the Solution Explorer, expand the project and create or open a process.
  4. Navigate to the Event Wizards menu.
  5. Drag and drop SmartObject Event onto appropriate location on the canvas.
  6. In the SmartObject Wizard, click Next.
  7. Enter an Event Name.
  8. Click the Context Browser button next to the SmartObject Method field.
  9. Navigate to SmartObject Server(s) > SmartObject Server.
  10. Navigate to the HotDocs SmartObject created in the K2 SmartObject Tester.
  11. Expand the Packages node.
  12. In the Packages node, expand a Template node. This is a HotDocs Template you wish to use in the process.
  13. Expand the Single Method node.
  14. Select the Assemble Documents to Disk option.
  15. Click Add.
  16. In the SmartObject Event Wizard, click Next.
  17. 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.
  18. 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.
  19. Click Next.
  20. Optional: in Return Mapping, drag and drop data fields 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.
  21. Click Next.
  22. Click Finish. The new mapping appears in the process. You can now link the SmartObject to other stages in the process.