Merging two word documents via the K2 application is an interesting feature. Indeed, the integration of a service that merges two word documents by generating another document is very interesting 🙂☝.
We present you a solution among one of the solutions developed in other articles on the same subject.
I- Download et Installation of the broker
Download the DLL by clicking here. Then unzip the archive:
Place the DLL file in the ServiceBroker folder of K2 installation directory (by default C:\Program Files (x86)\K2 blackpearl\ServiceBroker).
- Open the SmartObject Service Tester tool, by double-clicking on SmartObject Service Tester.exe located in the K2 bin directory of K2 (by default C:\Program Files (x86)\K2 blackpearl\Bin\SmartObject Service Tester.exe).
- On the window that opens click on the Register ServiceType. In the window that opens, select the name of the service to install, which corresponds to the name of the.dll file, in our case FFField.MergeTwoWordDocToOne.FFService.
Once the service has been selected, all you have to do is fill in the fields:
- System Name : you can leave it as it is or change it (as long as there are no special characters or spaces).
- Display Name : le nom qui apparaîtra dans les outils de conception (caractères spéciaux autorisés).
- Description : a description of our broker service, this part is not mandatory, but important to remind us of the role of our service.
- Guid : to be left as is during the original installation.
As shown in the figure below:
Then click Add. A new service type with the name specified in the Display Name (CopyToSmartObject in our case), was created appears in the ServiceObject Explorer.
Then go to ServiceObject Explorer: On this Service Type: right-click > Register ServiceInstance
In the window that opens, specify:
- Service Types which is the name of the service instance
- Authentication mode: the broker’s execution account (the account that will therefore interact with the data source). The choice will depend on how you want to connect to the data source and the associated permissions. In our case we will choose: Impersonate.
- Then click on Next.
- Fill in the System Name and Display Name in the pop-up that appears (same constraints as before, it is this time the name of the instance of the broker ). Then press Add.
Note: When updating a broker service, It is then necessary to restart the K2 blackpearl service to do the manipulation.
II- Creation of the SmartObject and execution of the broker service
Follow these steps to create and execute the broker
After executing the document C:\Users\Administrator\Desktop\broker\template.docx and the document C:\Users\Administrator\Desktop\broker\template.docx be merged into a document C:\Users\Administrator\Desktop\broker\Destination.docx