To use the HotDocs Service Broker in a K2 process you first need to register the ServiceType to make the HotDocs Service Broker available to you in the ServiceObject Explorer folder. To connect to the HotDocs Template Hub you then need to register a new Service Instance of the HotDocs Service Broker ServiceType. Now you can create a new SmartObject using the Service Instance, from here you have access to the template packages on your HotDocs Template Hub and you can choose to create a new SmartObject from one of these template packages.
You can now test execute your new SmartObject by selecting the method you want to execute (Assemble Documents to Disk, Assemble Documents to Stream, or Get Answer XML), the output format and (optionally) if you have any repeated answers in the HotDocs template you are using. Once you are satisfied with your new SmartObject you can add it to a K2 business process where you can use it assemble documents or produce answer data.
In this Topic Hide
To register and start using a HotDocs Service Broker:
The methods available to the HotDocs Smart Object are:
In HotDocs, REPEAT answers are defined variables that can have multiple answers. For example, imagine you are creating a list of employee names. Instead of creating a new variable for each employee name you wish to enter, it is better to create a single variable which can have multiple names added to it. You can do this in HotDocs by creating a REPEAT instruction.
If you are using a template that contains a REPEAT instruction then you must follow additional steps to use this functionality in a Smart Object:
You can only use one repeat level in the SmartObject. In other HotDocs programs, a repeat answer can usually be nested, meaning you can create sub-lists within your initial repeat list (for example, in a list of children you can also include sub-lists of grandchildren). This is not possible in the SmartObject.
In a K2 project that has a Smart Form, you may wish to add a button that launches document assembly using the HotDocs Service Broker. To do this:
When the user clicks the button, the HotDocs Smart Object maps the data in the process and passes it to HotDocs for assembly. HotDocs then returns your assembled document in the form of a base64 encoded string. The assembled document will be saved into the K2 field that is mapped to the output content stream on the HotDocs Smart Object. As the output from the HotDocs Smart Object is mapped to a K2 field, the document is saved in the process. Once the document is saved in the process, you can use K2 Events and Controls to allow the user to download the document or have the document sent to other services.