Generic Data Synchronization

The product supports a generic data synchronization method by which each change to an eligible entity triggers a synchronization flow that communicates details about the entity to one or more external systems.

The following points describe the functionality at a high level:
  • The integration of a specific entity (maintenance object) and an external system is enabled and configured using a Data Synchronization Control (F1-DataSyncControl) extendable lookup record.

  • Rules supporting the integration reside in a synchronization script referenced on the control record.

  • When an entity is added, changed or deleted, a sync request may be initiated for each integration according to business rules defined by the corresponding synchronization script.

  • Sync requests are processed by the next monitor batch process.

  • When the sync request is processed, data is synchronized to the external system according to business rules defined by the corresponding synchronization script.

This functionality is supported by logic supplied in the base business object Generic Data Sync Request (F1-GenericDataSync). This business object does not need to be extended to support specific integration rules as these rules reside in the synchronization script associated with each integration’s data synchronization control record.

The following sections describe key aspects of this data synchronization approach.

Data Synchronization Control

The Data Synchronization Control (F1-DataSyncControl) extendable lookup defines the configuration needed to support an ongoing data synchronization of an entity to an external system. The configuration defines the entity's maintenance object, the external system it is synchronized with and references a synchronization script that manages the specific synchronization rules for this integration. An integration is considered enabled when its corresponding control record is in active status.

The data synchronization script is called in the following modes:

  • When the entity is added, changed or deleted, the script is called in Check mode to determine whether a sync request should be created for the changed entity and a specific external system.

  • When the sync request is processed, the script is called in Process mode to prepare and send the outbound message to the external system. Alternatively the script may request to discard the request or indicate that it should be processed later. The latter may be used when there is a need to wait until certain conditions are met before sending the message to the external system.

Note that the configuration for a maintenance object and a specific external system may be overridden by another configuration defined with a higher sequence number. 

Confirming that a Sync is Needed

The base product provides a change data capture (MO Audit) algorithm F1ONGDATASYN that may be used by maintenance objects that need to be synchronized by this method. The algorithm consults the synchronization script associated with each active integration control record configured for the entity as to whether the external system needs to be notified for this change. Once confirmed, the algorithm creates a Sync Request record for the changed record, capturing its MO code and the primary key, along with the corresponding external system.

Note that the decision as to whether to create a sync request or not is controlled by the integration specific synchronization script while the creation of the sync request is the responsibility of the audit algorithm. As such, the same sync request BO is used for all integrations, with no provision for capturing integration specific details.

It is recommended to design the synchronization script to only approve the creation of a synchronization request when it is needed. This prevents unnecessary creation of sync requests that would otherwise be discarded when eventually processed.

Managing the Synchronization Process

Once a sync request is captured, there are several steps performed prior to any information being sent to the external system.

Note: This section only highlights key steps. Please refer to the business object configuration, its lifecycle and algorithms for a thorough picture of the full functionality..
  • When a Sync Request record is created, its initial state (Pending) is configured to be processed by a batch monitor. That way, the changes that triggered the request are fully committed before being communicated to an external system.

  • When the sync request record is processed, a monitor algorithm calls the synchronization script associated with the corresponding integration’s control record to manage the synchronization process. The synchronization script may indicate either of the following:

    • The request is not yet ready to be processed, i.e. it should remain in its current status and get processed again by the next batch run.

    • The request should be canceled. This indication results in the transition of the record to the Canceled status.

    • The request was successfully processed. The synchronization script has prepared the outbound message and routed the information to the external system appropriately. This indication results in the transition of the record to the Sent status.

  • If an error occurs while processing the request, a To Do Entry is raised to capture the error details and the record is set to the Error status. Retry processing of the sync request continues with each batch process until the request is either sent or canceled.

Communicating to the External System

Typically the communication with an external system is finalized when the message is successfully sent and successfully processed by the external system. Depending on the specific integration, the message may not be processed right away by the external system but rather queued and processed later. In this situation, the sync request may need to be further acknowledged as successfully processed (set to the Acknowledged status) upon an explicit response mechanism from the external system. The product supplies the web service F1-UpdateAndTransitionSyncRequest that may be used to process such acknowledgements.