Modules:AWO Integration with Bartender using Webservices
Contents |
Integration with Bartender using Webservices
This document describes the integration in Advanced Warehouse Operations with BarTender printing services, using WebServices.
The BarTender software enables organizations to improve safety, security, efficiency and compliance by creating and automating the printing and control of labels, barcodes, RFID tags, plastic cards and more. The Openbravo Bartender module, enables the user to integrate The Advanced Warehouse Operations module with the Bartender print server using Web Service.
Installation of Openbravo/Bartender module
The Openbravo/Bartender module can be directly installed from the Central Repository using the Openbravo's Module Management window as usual. Take into account that these modules are distributed under a commercial license that requires acquiring an activation key before the installation.
It requires the openbravo.warehouse.advancedwarehouse module installed. The relevant configuration in Openbravo is described below.
Configuration in Bartender
To configure the Bartender service with the 2016 version to work with Openbravo, we will have to create two things:
- Bartender Template
- Bartender Integration Service
Bartender Template
The template created with the Bartender Designer, will have the different field objects (text fields, barcodes, etc) with named data sources that will be linked with the parameters arrived from the Web Service petition.
Bartender Integration Service
The service created with the Bartender Integration Builder, will have a configuration that will receive the petitions of the client, make the configured actions, and return the response. Each integration will have one bartender template associated, that will have the same parameters (data sources on the template, and variables on the integration service) to link them correctly and print the template with the correct data of the petition.
First, to configure the service, we have to create a new Bartender Integration builder with the web service method:
Once we have selected the Web Service integration, we must configure some parameters:
- Service Window: contains the service name and the port, that will generate the URL of the petitions for this service.
- Input Data Window: contains the format of the data that will receipt from the client request. Select the JSON Variables.
- Response Window: contains the format to send the response, in this case applciation/json, and the Action Summary response:
- Variable Window: contains all the variables of the service and the custom variables of each integration. This variables will have a default value, but can be overwritten according to the configured Actions like Print Document that will see in the next point. If the value is not overwritten for the configured variables on the Actions, will have the default value assigned on it.
- Actions: Print Document Window: contains the document template that will print when they receive the request.
Once loaded the template, we can import this document settings that will load the Named data sources created on the template, the default printer configured, and other settings.
The Named Data Sources have to be replaced for the variables created on the Variable Window, that will have for default value the value assigned when created it, but will be replaced for the Web Service petition data if there is a tag on the JSON received with the same name.
Example received JSON: {productCode: “1234”, printer: “HP-1”}, will replace the printer variable assigned on the Print Settings, and the “productCode” that will be replaced on the template with the value “1234”.
Finally, when the configuration is done, we have to start the service going to the Test tab. (on the footer of the window)
- On the Bartender Server we have to have properly configured the firewall with the ports of the Bartender service not blocked and check if the antivirus doesn’t block it too. (A definition with the firewall enabled for public or guest networks and disabled for private networks can work)
Configuration in Openbravo
After the installation of the Bartender Module (and their dependence modules), we will explain the functionally and the default parameters of the Web Service Request that it sends to the Bartender Server. This module adds on the Printing Service table, a new register for the Bartender Service.
First, we have to navigate to the Print ID Template window, where we will have the new Printing Service from the Bartender module installed before. Here we create the Templates according to the BarTender setup and link them to the URL of the BarTender server.
Once we have defined our bartender process with the URL of the web service (created on the bartender integration builder), we have to define which Internal Routings should print an ID (label) and which Bartender template should be called. Optionally, a printer can be configured to override the printer-selection logic in Bartender. To activate the printing in the Internal Routing, set the flag Print-ID. That will show the Bartender Printer field, and the Bartender Template field.
When we generate Tasks from the differents transaction types (Picking, Put-away, Receipt…), each task where the print-flag is set, will automatically issue a print-request on confirming the task. Furthermore, any task -regardless the print-flag- can be printed with the Print-button on the Task-window in the backend.
Printing Grouped Tasks
For printing Grouped Tasks it is necessary to follow the same configuration steps as for printing an Individual Task. It requires configuring
- Bartender Template
- Bartender Integration Service
- Openbravo Configuration
Bartender Template
The template created with the Bartender Designer, will have the different field objects (text fields, barcodes, etc) but in this case it is necessary to configure a Database. The data source will be provided as a csv file through the Web Service petition, but it is necessary to map it in the Designer as a Database table with it's columns.
To do so, click on the DataBase icon of the ToolBar and create a new one that is based on a Text (Csv) file. Then it is necessary to provide a csv file that contains the structure of the data that is going to be sent (a file with the headers and one data record is enough) Afterwards make sure to check the option that states The first row is a header containing field names
With the Database configured, it is also necessary to properly configure the Page Template. By doing so it will be possible to define data that is going to be printed once per page and data that is going to be printer for each record (that can be used to print different document lines, for example) This can be done by clicking on the Template Configuration Icon. It is important to check the Enable Page Template checkbox in the Page configuration Tab. By doing so it will be possible to manage two different templates, one for the full page and another one for each record.
Finally, it is necessary to map each field with it's corresponding database column (which in this case is a column from the csv file)
Bartender Integration
The next step is to define the Integration with the Integration Builder. In this case it is important to define two different actions, 'Transform Text To Record Set' and 'Print Document' The first one will map the csv file to a Record Set, the second one will print this record set. For this case the 'Database Overrides' must be enabled and configured.
Openbravo Configuration
The definition is similar as for printing an individual Task. A Print-ID must be defined and the Routing must be configured accordingly.