Projects:External Integration Infrastructure/Specs
The aim of this project is to provide a base infrastructure that should make easy the development of connector with external systems.
These external systems could be other ERP (i.e. SAP), or e-commercle platforms (i.e. Magento), among other things.
The base infrastructure being developed should provide the following components:
- A way to define mappings between Openbravo entities and those of the external system
- Provide means to apply those mappings convert data from the Openbravo data to one that can be understood by the external systems, and viceversa
- Use EDL to synchronize data, to benefit from its benefits, such as asynchronous processing, batching, traceability, etc
The base infrastructure will provide components that should be implemented by particular connector implementations (SAP, Magento, etc), where those modules will define:
- The communication between Openbravo and the external system
- The transformations of the data between Openbravo and the external system
And on top of the specific connector module, the mapping modules (standard and customizations) will define the functional mappings between the Openbravo entities and those of the external system.
The functional requirement of this project is to provide an infrastructure that will help to import/export data with an external system. The infrastructure should:
- Provide a mechanism to map the Openbravo entities with the entities of the external system.
- Be extensible, i.e., third party modules will be able to extend the default behavior of those modules using this infrastructure.
- Have the ability to identify the data pending to be synchronized.
- Have an error management mechanism.
The entity mapping is one of the main features to be provided by the external integration infrastructure.
It should be possible to define a mapping between the Openbravo business entities and the entities of the external system. This mapping will be possible thanks to a new class called Synchronizable Business Object.
A Synchronizable Business Object is a POJO that will be used to keep in memory the data required to import/export Openbravo business data into the external system.
In this sense, the content of a Synchronizable Business Object object will be coupled with the format that defines the structure of the data in the external system.
It will be possible to define entity mappings regardless of whether they are going to be used for importing or exporting data.
Indeed, both import and export flow will be separated. This means that the classes intended to export Synchronizable Business Objects will implement the methods defined within an interface that will define the methods required for exportation. The same applies for the import flow.
Finally, an entity mapping must be extensible, allowing to be customized by those modules extending the module where the mapping is defined.
Overall Export Process
The main idea is to have a process that will discover the Business Objects pending to be synchronized with the external system.
This process will retrieve the IDs of those Business Objects and it will create EDL Requests that will handle the exportation using data batches. It has been decided to create the EDL requests just with the IDs information to try to have good performance in terms of memory consumption.
By making use of the EDL infrastructure we are taking advantage of the features that this module provides like error control, data batching, etc.
On each item (ID) processing performed by the EDL requests, a new Synchronizable Business Object will be created based on the mappings defined for each entity. Besides, each EDL process used to export data will be in charge of transforming the Synchronizable Business Objects into the data format accepted by the external system.
As a final step, once the data has been transformed, it will be sent to the external system.
Synchronized Data Control Mechanism
The approach that will be used in order to find the data pending to be synchronize is similar to the one currently being used in WebPOS. The idea is to have an incremental refresh,i.e., it will find the records which were changed from the last time the synchronization process was fired.