Projects:External integration infrastructure/Specs
Contents |
Functional Requirements
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.
Technical Specs
Entity Mapping
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.