Projects - POS - ERP Integration - OpenbravoWiki
Projects - POS - ERP Integration - OpenbravoWiki
Projects:POS/ERP Integration
Languages: English | Français | Italiano | 日本語 | zh cn | Translate this article...
Projects:POS
Important This integration architecture needs Openbravo ERP 2.50, 3.0 or later and Openbravo POS 2.30.2 or later. If you want to integrate Openbravo ERP 2.40 Projects:POS/Deploy
and Openbravo POS 2.20 go to the document Openbravo_POS_Direct_Integration. Projects:POS/Administrator
Guide
Projects:POS/ERP
Contents
Integration
1 Summary
2 Integration overview
Index
2.1 The Synchronize POS process
2.2 The Synchronize Orders process
3 Openbravo ERP configuration
3.1 Introduction. Openbravo ERP modularity system
3.2 Install Openbravo POS Synchronization Webservice
3.3 Check the module installation
3.4 Edit the external point of sales
4 Openbravo POS Web Service
4.1 Usage
4.2 Request parameters
4.3 Available Business Objects
4.3.1 Restrictions
5 Openbravo POS configuration
5.1 Introduction. Pentaho Data Integration (PDI or Kettle)
5.2 Install Pentaho Data Integration
5.3 Get the transformation and job files
5.4 Execute Pentaho Data Integration
5.5 Configure Pentaho Data Integration
6 Execute the integration actions
6.1 Main synchronization
6.1.1 Products and Customers synchronization process
6.2 Synchronize Orders
6.3 Process Orders remotely
6.4 Upload and process orders
7 Configure service to execute the integration actions
7.1 Launch the server
7.2 Authenticate in the server
wiki.openbravo.com/wiki/Projects:POS/ERP_Integration 1/22
6/24/23, 11:25 AM Projects:POS/ERP Integration - OpenbravoWiki
7.3 Schedule a job in the server
7.4 Execute a job in the server
7.5 Check jobs executions
8 FAQ
8.1 Derby database is locked
Summary
In an organization, more than one software application often exists to support a particular aspect of operational requirements. The result is an heterogeneous set of software applications requiring data sharing and
integration. An ERP system like Openbravo ERP tries to solve this problem by offering one solution for every operational requirement. Openbravo ERP maintains one shared database for all data, integrated
processes among different departments, a consistent interface for every user, and homogeneous reports/score cards that display operational data of the whole organization.
However there are specific corners of an organization that an ERP system cannot solve. For example, POS systems like Openbravo POS where special user types and hardware devices support are required.
The POS system user is a salesperson who uses an ERP in a different manner. The interface has to be very easy to use and provide only the specific information the salesperson needs. This salesperson needs to
operate the POS as fast as possible, as their job is to sell, not to operate the POS. For example they do not want to deal with a mouse and a keyboard, rather they prefer a touch screen. In addition, the POS system
needs to support a lot of POS hardware available for a real solution: receipt printers, barcode scanners, customer displays, cash drawers, scales, card readers etc.
Openbravo POS is a point of sale application designed for touch screens. It can be downloaded from Openbravo POS Downloads.
Integration overview
The focus of this integration is to create a system where Openbravo ERP is the central repository of the data: Products, customers, taxes, orders... And Openbravo POS has the ability to operate with the master
data downloaded from Openbravo ERP and to upload orders created by the sales activity of Openbravo POS.
This integration has been developed with REST Webservices.
The Openbravo ERP REST webservice operates on Business Objects in Openbravo ERP. A Business Object (in Openbravo ERP) can be a simple entity (a table) such as a currency which just has basic primitive fields.
Or can be as complex as a structure of entities, for example an order header with its order lines.
Retrieve a single business object or a list of business objects using a standard HTTP GET request.
Querying, filtering, paging and sorting lists of business objects, again through standard HTTP requests.
Update an existing business object or multiple business objects with XML and HTTP POST or PUT operations.
Create new business objects with a POST/PUT operation.
Export and import data: XML files which contain a mix of different types of business objects and a mix of new and existing business object.
Delete operation using either an URL pointing to a specific business object which needs to be removed or an XML document which contains business objects (as a full XML or as a partial XML) which need to
be removed.
The Openbravo ERP REST web services use the same access/authorizations as the standard Openbravo ERP application. Before calling a web service the caller must log in. The login functionality is provided by the
Openbravo ERP REST framework. All REST actions are then executed in the context of a client/organization and current role of the user.
This integration module does NOT upload new customers or new products used on an invoice from the POS into the ERP. An error will occur during the sync process.
wiki.openbravo.com/wiki/Projects:POS/ERP_Integration 2/22
6/24/23, 11:25 AM Projects:POS/ERP Integration - OpenbravoWiki
An Extension Module is a piece of additional functionality that can be optionally and independently deployed on top of Openbravo ERP.
The experience of the user deploying modules is similar to the one of Firefox plugins: you are able to browse a catalog of modules, install (and uninstall), deploy and upgrade them directly from within the
Openbravo ERP Administration UI.
A developer of an Extension Module can package and deliver a module independently from the rest of the Openbravo ERP content, meaning that is possible to package modules with a delivery mechanism that only
includes files and metadata that they are responsible for.
More information regarding modularity can be found in the Modularity project article.
The functionality of the REST Webservices is very useful for standard integration scenarios and in our case allow us to get desired Business Objects from Openbravo ERP and update an existing Business Object.
The idea is to install a module (independent from the rest of Openbravo ERP) which is the responsible to deploy a REST Webservice in charge of the synchronization.
wiki.openbravo.com/wiki/Projects:POS/ERP_Integration 3/22
6/24/23, 11:25 AM Projects:POS/ERP Integration - OpenbravoWiki
Central repository
In the next window more details about the module are available. To show them click on view details... link. To continue process press Continue button.
Next step is to accept license (is mandatory to continue the process). Select I accept all license agreements radio button and press the Continue button.
Then, you are redirected to Installed Modules tab. There you can see all the installed modules and their current status. After installing a module the application must be rebuild to complete the installation.
So click on the rebuild now link with yellow background or in Changes pending, rebuild now link near the POS Synchronization WebService module.
In the next window press Yes button to confirm that you want to rebuild the application.
wiki.openbravo.com/wiki/Projects:POS/ERP_Integration 4/22
6/24/23, 11:25 AM Projects:POS/ERP Integration - OpenbravoWiki
The rebuild will start automatically showing in the window all the log. This process can take some minutes depending on your computer, please be patient.
Finally, when the process finish it will notify the result obtained. Select Reload the Openbravo application now radio button and press the Continue button. Wait and the application will be restarted.
wiki.openbravo.com/wiki/Projects:POS/ERP_Integration 5/22
6/24/23, 11:25 AM Projects:POS/ERP Integration - OpenbravoWiki
To check if the module is installed correctly, point your browser to:
http://localhost:8080/openbravo/ws/org.openbravo.pos.sync.ws
http://localhost:8080/openbravo/org.openbravo.service.connector/xml/org.openbravo.pos.sync.ws
Note that this example assumes that Openbravo ERP runs locally on port 8080, it maybe necessary to replace the localhost:8080 part with your own server name/port.
Before calling the web service the caller must log in, so a login dialog will appear. Enter a login and password of a operative Openbravo ERP user.
The result should a welcome page with a brief description of the web service usage.
If you get <error><message>No registration for name org.openbravo.pos.sync.ws</message></error> error message, try restarting Tomcat.
To edit the external point of sale you have to change the role to the Openbravo ERP entity administrator of the entity you are working with, and open the menu option Sales management > Setup > External Point
of Sales.
In this window you define your point of sales and include/exclude products and product categories associated with your point of sale.
You can select the products set to synchronize by category or by product. To select the product by category choose Only those defined in the Included Product Categories selector and add the category records
wanted. To select the products list by product, choose Only those defined in the the Included Products selector and add the product records wanted.
wiki.openbravo.com/wiki/Projects:POS/ERP_Integration 6/22
6/24/23, 11:25 AM Projects:POS/ERP Integration - OpenbravoWiki
wiki.openbravo.com/wiki/Projects:POS/ERP_Integration 7/22
6/24/23, 11:25 AM Projects:POS/ERP Integration - OpenbravoWiki
http://localhost:8080/openbravo/ws/org.openbravo.pos.sync.ws
http://localhost:8080/openbravo/org.openbravo.service.connector/xml/org.openbravo.pos.sync.ws
If you point the browser to this URL a welcome page will appear showing general information about the usage of the Web Service.
Usage
http://localhost:8080/openbravo/ws/org.openbravo.pos.sync.ws/Product?erp.id=FF8080812AFBCB14012AFBD3E373001F&erp.org=4F68EB1C1B734E79B27DE9D2DF56089F&erp.pos=POS-1
http://localhost:8080/openbravo/org.openbravo.service.connector/xml/org.openbravo.pos.sync.ws/Product?erp.id=FF8080812AFBCB14012AFBD3E373001F&erp.org=4F68EB1C1B734E79B27DE9D2DF56089F&erp.pos=POS-1
Request parameters
erp.id: The Openbravo ERP internal client identifier of the external point of sale.
erp.org: The Openbravo ERP internal organization identifier of the external point of sale.
erp.pos: The search key of the external point of sale defined in Openbravo ERP used to identify the Openbravo POS system inside Openbravo ERP.
erp.user: The Openbravo ERP user used to invoke the integration functionality.
erp.password: The password of the Openbravo ERP user.
wiki.openbravo.com/wiki/Projects:POS/ERP_Integration 8/22
6/24/23, 11:25 AM Projects:POS/ERP Integration - OpenbravoWiki
Restrictions
Products
Product type must be Item
Product UOM must be Unit
The product must belong to the recent (higher validfrom date) Price List Version inside the Price List chosen in the External Point of Sale.
Inventory
In External Point of Sale a Warehouse is selected. The same product could be stored in two Storage Bins inside the same Warehouse.
When the stock of a product is synchronized, the sum of the stock available in the Storage Bins of the selected Warehouse is done.
Example:
Main Warehouse
|
|--- First Storage Bin
| |
| |--- Hat = 50 Units
|
|--- Second Storage Bin
|
|--- Hat = 150 Units
wiki.openbravo.com/wiki/Projects:POS/ERP_Integration 9/22
6/24/23, 11:25 AM Projects:POS/ERP Integration - OpenbravoWiki
Spoon: is by far the most used component of the Pentaho Data Integration suite. It is a graphical tool build on the Eclipse platform, that allows for the visual configuration of ETL jobs and transformation.
Carte: is a simple web server that allows you to remotely access the Pentaho Data Integration repository, and execute, monitor, start and stop jobs and transformations that run on the server.
Pan: allows you execute transformations designed by Spoon, thus allowing your ETL jobs to be run from the command line.
Kitchen: is a program that can execute jobs designed by Spoon, allowing them to be scheduled and run in batch mode.
Pentaho Data Integration is a very flexible and friendly tool which provides a very intuitive graphic tool (Spoon) to modify and create our transformations. For the end user is very easy to use and it don't required
any special programming skills. Furthermore, there is an active community behind the project, that means forum support, complete documentation and so on.
The current architecture reduces the effort required to modify an existing functionality and minimizes the impact to implement a new functionality. With the old synchronization each time when some new data
needs to be synchronized a developer must add a suitable piece of code on both sides, so either in POS and in ERP. The functionality of the REST Webservices is very useful because they allow to retrieve
information from all Business Objects of Openbravo ERP just doing an HTTP request. So, if more data is required, the modifications will just affect the Pentaho Data Integration environment.
Other applications can integrate with Openbravo POS through Pentaho Data Integration in a simple way: creating a new transformation or job. They don't need to modify Openbravo POS code, Pentaho Data
Integration provides enough mechanism to achieve a successful synchronization between external application and Openbravo POS.
Pentaho Data Integration provides the possibility to schedule transformations or jobs to run in a remote server or force the synchronization after outstanding event happens in Openbravo POS side, for example,
when cash is closed. This point is important, because is not needed a specific user interaction each time you need to make the integration run, just prepare the schedule in a suitable time and run once.
All JDBC drivers provided in Pentaho Data Integration are located into data-integration/libext/JDBC.
Is mandatory to use in Pentaho Data Integration a JDBC driver version compatible with the version of the JDBC driver used in Openbravo POS.
Suggestion:export the JDBC driver of the database used in Openbravo POS to data-integration/libext/JDBC folder of PDI (Kettle) and replace it.
Notice: If you use HTTPS to connect to Openbravo. Use version 4.1.2 of Pentaho Data Integration or greater because there is a reported error related to HTTPS in previous versions and fixed in 4.1.2:
http://jira.pentaho.com/browse/PDI-4010
The particular case of Pentaho Data Integration 4.1.0 and Openbravo POS 2.30.2 the JDBC drivers provided by Pentaho Data Integration are:
derby.jar (10.2.2.0)
postgresql-8.2-506.jdbc3.jar
mysql-connector-java-3.1.14-bin
hsqldb.jar (1.8.0)
ojdbc14.jar (10.2.0.2.0)
The Derby JDBC driver provided in Pentaho Data Integration data-integration/libext/JDBC/derby.jar is the version 10.2.2.0 and is not compatible with the Derby JDBC driver version (10.4.2.0) used in Openbravo
POS.
So is needed to replace the the derby.jar (10.2.2.0) located in data-integration/libext/JDBC/derby.jar with the newest derby.jar.
You can check the version of the .jar unpacking it and looking in the /META-INF/MANIFEST.MF file.
wiki.openbravo.com/wiki/Projects:POS/ERP_Integration 10/22
6/24/23, 11:25 AM Projects:POS/ERP Integration - OpenbravoWiki
Bundle-Version: 10.4.2000000.689064
cd data-integration
chmod +x spoon.sh
sh spoon.sh
As soon as Spoon starts, a dialog window appears asking for the repository connection data. For our purposes, we choose to just use the PDI without specifying a repository. Press the No repository button. Is
possible to disable this window for the next time unchecking Present this dialog at startup checkbox.
The next thing you'll see is a Spoon tips window. Disable unchecking Show tips at startup? checkbox.
Then, the Main page screen of Spoon will appear.
wiki.openbravo.com/wiki/Projects:POS/ERP_Integration 11/22
6/24/23, 11:25 AM Projects:POS/ERP Integration - OpenbravoWiki
Spoon main screen
The top portion of the screen contains the menu options that allow you to perform a whole host of customisations and operations of the application. The left hand side panel of the screen contains two different
views:
View: describe all the elements (steps, hops, jobs, database connection...) used.
Design: the operations that can be used on an everyday basis within the Pentaho Data Integration.
In the main area transformations or jobs are opened in tabs. Each file has a menu which allows to execute useful operations like: run, debug, explore database...
If you are interested investigating this tool deeply take a look at the complete User Guide if you want more details about it.
Pan is a command line script that can execute transformations designed by Spoon in XML or in a database repository. Usually transformations are scheduled in batch mode to be run automatically at regular
intervals.
To run a transformation from a file using Windows execute.
cd data-integration
chmod +x pan.sh
cd data-integration
chmod +x kitchen.sh
wiki.openbravo.com/wiki/Projects:POS/ERP_Integration 12/22
6/24/23, 11:25 AM Projects:POS/ERP Integration - OpenbravoWiki
$HOME/.kettle/kettle.properties
We need to edit this file to configure our database and Openbravo ERP connections parameters adding:
# Database Connection
db.URL = jdbc:derby:/home/openbravo/openbravopos-database;create=true
db.driver = org.apache.derby.jdbc.EmbeddedDriver
db.user =
db.password =
# Openbravo ERP
erp.URL = http://localhost/openbravo/org.openbravo.service.connector/xml/org.openbravo.pos.sync.ws
erp.id = FF8080812AFBCB14012AFBD3E373001F
erp.org = 4F68EB1C1B734E79B27DE9D2DF56089F
erp.pos = POS-1
erp.user = Openbravo
erp.password = openbravo
db.URL: Is the connection string that uses JDBC to localize the JDBC the driver and the database.
db.driver: Is the Java class name that implements the JDBC driver. This name is also defined by the database engine vendor.
db.user: The name of the authorized database user.
db.password: The password of the database user. The password must be written in plain text, not encoded as it appears in the Openbravopos.properties configuration file
They are the same configuration values used in Openbravo.properties file stored in the $HOME directory.
erp.URL: The base URL location where the Openbravo ERP Webservice endpoint is installed. The webservice is installed in the folder ws/org.openbravo.pos.sync.ws of your local context. In the example
provided above, http://localhost/openbravo is the base URL of the Openbravo ERP and http://localhost/openbravo/org.openbravo.service.connector/xml/org.openbravo.pos.sync.ws the location of the
webservice.
erp.user: The Openbravo ERP user used to invoke the integration functionality.
erp.password: The password of the Openbravo ERP user. The password must be written in plain text.
erp.id: The Openbravo ERP internal client identifier of the external point of sale.
erp.org: The Openbravo ERP internal organization identifier of the external point of sale.
erp.pos: The search key of the external point of sale defined in Openbravo ERP used to identify the Openbravo POS system inside Openbravo ERP.
Remember that the Openbravo REST web services use the same access/authorizations as the standard Openbravo application. All REST actions are then executed in the context of a client/organization and current
role of the user.
Save the file and restart Spoon to make changes work.
After setting all parameters is possible to check if Spoon can access and read them and if the database connection is properly configured.
To check the variables open in Spoon one of the transformations. In the top menu go to Edit > Edit the kettle.properties file (Ctrl+ALT+P) and the variables and their values should appear in the dialog. If the
Variables doesnt showup, ensure that you have included KETTLE_HOME in your environment variables, point it to the directory that has the .kettle folder.
eg. KETTLE_HOME = C:\Documents and Settings\<username>
wiki.openbravo.com/wiki/Projects:POS/ERP_Integration 13/22
6/24/23, 11:25 AM Projects:POS/ERP Integration - OpenbravoWiki
To check the database connection, first open in Spoon one of the transformations. Then in the top menu go to Edit > Explore DB and select openbravoposDB database to explore. If the connection is configured
properly a database explorer will appear showing database tables.
Main synchronization
Open ALL SYNCHRONIZATION.kjb job in Spoon and run it by clicking on the run button from the main menu, toolbar or by pressing F9.
A window will appear, just click on Launch button.
The synchronization process will start automatically, you can see a brief status description of each transformation or job in Job metrics tab.
For a detailed log about the process go to Logging tab.
wiki.openbravo.com/wiki/Projects:POS/ERP_Integration 14/22
6/24/23, 11:25 AM Projects:POS/ERP Integration - OpenbravoWiki
Step 2: Run the synchronization process. The product will appear in openbravo POS with the values defined in openbravo ERP.
wiki.openbravo.com/wiki/Projects:POS/ERP_Integration 15/22
6/24/23, 11:25 AM Projects:POS/ERP Integration - OpenbravoWiki
Search key: productA
Name: Product A
Product ID: 64CB40D637B54ABEA3016CEA61C4B460 (Auto-generated)
With this tasks openbravo POS is able to manage changes in the search key of products avoiding synchronization problems.
Synchronize Orders
Open ORDERS.ktr transformation in Spoon and run it by clicking on the run button from the main menu, toolbar or by pressing F9.
A window will appear, just click on Launch button.
After orders have been synchronized, to process the orders imported you have to change the role to the Openbravo ERP entity administrator of the entity you are working with, go to the menu option Master Data
Management > Import Data > Import Orders and execute the process Import Orders. When the process ends a dialog with the result of the process is shown to the user. Also this process can be done running
processUploadedOrders.ktr (see bellow).
wiki.openbravo.com/wiki/Projects:POS/ERP_Integration 16/22
6/24/23, 11:25 AM Projects:POS/ERP Integration - OpenbravoWiki
After orders have been uploaded and then processed, you can open in the ERP Master Data Management > Import Data > Import Orders . There are the processed orders.
The IP address or host name to run on. If you have a machine with multiple network cards you can choose here which interface to run on.
The HTTP port to listen to (defaults to port 80).
To launch Carte in Linux or other Unix-like operating systems, you will need to make the shell scripts executable by using the chmod command:
cd data-integration
chmod +x carte.sh
myLogin:myPassword
From version 3.1 on you can also put this password file in $HOME/.kettle/ or $KETTLE_HOME/.kettle/
It is possible to obfuscate the password in the kettle.pwd file. There is a tool called Encr in the distribution that allows you to generate passwords that are obfuscated.
To obfuscate the password in Windows execute:
wiki.openbravo.com/wiki/Projects:POS/ERP_Integration 18/22
6/24/23, 11:25 AM Projects:POS/ERP Integration - OpenbravoWiki
To obfuscate the password in Linux and other Unix-like operating systems execute:
The string "OBF:1vv31vn61xtv1zlo1unf1y0s1ri71y0y1uoj1zlu1xtn1vnw1vu7" can then be copied into the kettle.pwd file instead of the clear-text password.
myLogin: OBF:1vv31vn61xtv1zlo1unf1y0s1ri71y0y1uoj1zlu1xtn1vnw1vu7
It is possible to make Carte use a Java Authentication and Authorization Service (JAAS). To do this, define an environment variable called "loginmodulename" as well as the "java.security.auth.login.config" property.
Carte will pick these up to use these authentication settings.
wiki.openbravo.com/wiki/Projects:POS/ERP_Integration 19/22
6/24/23, 11:25 AM Projects:POS/ERP Integration - OpenbravoWiki
Service tab
Proxy tab
Proxy server hostname: sets the hostname for the Proxy server you are connecting through.
The proxy server port: sets the port number used in communication with the proxy.
Ignore proxy for hosts: Specify the server(s) for which the proxy should not be active. This option supports specifying multiple servers using regular expressions. You can also add multiple servers and
expressions separated by the ' | ' character.
Configure scheduling
double click on START step of the job
Scheduling a job
wiki.openbravo.com/wiki/Projects:POS/ERP_Integration 20/22
6/24/23, 11:25 AM Projects:POS/ERP Integration - OpenbravoWiki
Open the job you want to execute remotely in Spoon and run it by clicking on the run button from the main menu, toolbar or by pressing F9.
Execute remotely
Select Execute remotely radio button and in the list bellow the desired Remote host. Press Launch button to start.
You can access to each tranformation or job to manage them and see more details.
wiki.openbravo.com/wiki/Projects:POS/ERP_Integration 21/22
6/24/23, 11:25 AM Projects:POS/ERP Integration - OpenbravoWiki
FAQ
com.openbravo.basic.BasicException:
Cannot connect to database. Database not available.
org.apache.derby.impl.jdbc.EmbedSQLException:
Failed to start database '$HOME/openbravopos-database'
wiki.openbravo.com/wiki/Projects:POS/ERP_Integration 22/22