Skip to content

Data Synchronization Development

Data synchronization is a mechanism used to synchronize business data between a central installation (hub) and a satellite installation. Read more about the concept IFS Data Synchronization.

Note: This functionality is only available with optional component FNDRPL (IFS Data Synchronization).

An entity can be enabled for synchronization by using relevant Code Generation Properties. Generated code will result in database triggers and PLSQL packages that would facilitate exchange of XML messages between IFS installations using IFS connect framework for synchronization.

Data Synchronization can be layered, meaning that they can be extended.

Contents

  • modeling
  • Working with Plsql Files
  • Generated Code
  • Deployment
  • Special Cases
  • Developer Studio References

modeling

Enable Data Synchronization

Enable data synchronization by using code generation property DbDataSync. By doing this the entity is synchronized to all the sites and both the synchronizing directions by default.

entityname DemoPart;  
component DEMO;  

codegenproperties {  
DbDataSync "true";  
}  

attributes {  
keyPartNoTEXT(50) KMI--;  
privateDescription TEXT(50) A-I--;  
}

Site Specific Data Synchronization

Site specific data synchronization will be enabled by code generation property DbDataSyncSite. Property value for this will be a column name which represents the functional value for site.
Example: If the site value is stored in attribute named "OrderSite" then the property value should be database column name "ORDER_SITE".

Note: Entity should be enabled for data synchronization by using code generation property DbDataSyncin order to use code generation property DbDataSyncSite

entityname DemoOrderLine;  
component DEMO;  

codegenproperties {  
DbDataSync"true";  
DbDataSyncSite"ORDER_SITE";  
}  

attributes {  
parentkeyOrderIdNUMBERPMI--;  
keyLineNo NUMBER KMI--;  
privateOrderSiteTEXT(30)AMI--;  
private PartNoTEXT(30)AMI--;  
privateSupplier TEXT(30) AMI--;  
}

Synchronizing Direction

Data synchronization direction can be handled by using code generation property DbDataSyncDirection. property values are "hub" and "sat".

hub  - Synchronization direction is from HUB environment to SATELLITE environments.
sat  -  Synchronization direction is from SATELLITE environments to HUB environment.

Note: Entity should be enabled for data synchronization by using code generation property DbDataSyncin order to use code generation property DbDataSyncDirection

entityname DemoOrderBasic;  
component DEMO;  

codegenproperties {  
DbDataSync"true";  
DbDataSyncDirection"hub";  
}  

attributes {  
keySupplier NUMBER KMI--;  
privateDescription TEXT(50) A-I--;  
}

Broadcasting

Broadcasting can be enabled for an entity by using code generation property DbDataSyncBroadcasting. This will make the entity broadcast data. This means if some data alteration is done on one SATELLITE installation, that change will synchronized first at HUB then that particular change is broadcasted to all other SATELLITE Installations.

Note: Entity should be enabled for data synchronization by using code generation property DbDataSyncin order to use code generation propertyDbDataSyncBroadcasting

For example, in below entity, if part price changed at one particular satellite, then the price change for the part will synchronized first at hub and then the price change is broadcasted to all other satellites.

entityname PartPrice;  
component DEMO;  

codegenproperties {  
DbDataSync"true";  
DbDataSyncBroadcasting"true";  
}  

attributes {  
parentkeyPartNo TEXT(50) PMI--;  
publicPrice NUMBER A-I--;  
}

Working with Plsql Files

There are two Plsql files when working with Data Synchronization, One for sending logic and other for receiving logic These files can be used to override default  behavior of the data synchronization.

Core plsql files

Generated when entity is synchronized in core level. Used to write extra business logic when special need in synchronization identified.

Currently data synchronization framework specific LUs and base LUs such as quick reports are synchronized using extra logic in core level.
     -    LuNameRSP.plsql    - contain extra logic for sending the synchronization message
     -    LuNameRRP.plsql    - contain extra logic for receiving the synchronization message

        - Add new methods
        - Override base methods
        - Overtake base methods (overtakes must be avoided as much as possible)

Customization plsql files

Generated when entity is synchronized in customization level. Used to write extra business logic when special need in synchronization identified.

-    LuNameRSP-Cust.plsql     - contain extra logic for sending the synchronization message
     -    LuNameRRP-Cust.plsql     - contain extra logic for receiving the synchronization message

        - Add new methods
        - Override base methods
        - Overtake base methods (try to avoid overtakes as much as possible)

Generated Methods

When an entity is enabled for synchronization, several methods are generated for sending and receiving the synchronization messages.

Sending methods

- Replicate

Creates and buffers the XML message for new or modified record. - Replicate_Remove
Creates and buffers the XML message for removed record. - Replicate_Lob
Creates a database record to send Large Object value (CLOB/BLOB).
this method has two overloads. One is for sending BLOB values and Other for CLOB.
When there is two or more large object columns available in one particular table, this method is called once for each column.

Receiving Methods

- NewModify

This method is called to insert or update a data record which is synchronized from sending installation.
method is using standard insert and update operations. However only base validations for references were checked before insert or update. No logic from core layer or above is taken for validations.
Reference validations were checked to ensure data integrity - Remove
This method is called to remove an record which is synchronized from sending installation.
method checks cascade delete option to ensure data integrity.

Generated Code

When an Entity is enabled for data synchronization, a separate set of codes generated to support synchronization functionality of that entity.

Following shows a list of generated files when synchronizing an Entity with logical unit name 'LuName'.

  • LuNameREPL_TRG.ins

    • Containing triggers used to generate XML messages related to data alteration of an LU table
              - Lu_Name_NRT - triggers when a insert or update is done on a record for LU table
              - Lu_Name_RRT - triggers when a remove is done on a record for LU table
              - Lu_Name_LRT - This trigger generated only when an LU has an attribute of data type CLOB or BLOB.
                                         triggers when any change is done to CLOB or BLOB column
  • LuNameRSP.api/apy

    • Containing package for sending logic
              - LU_NAME_RSP
  • LuNameRRP.api/apy

    • Containing package for receiving logic
              - LU_NAME_RRP

Deployment

Data Synchronization specific code can be generated and deployed using RMB 'Generate and Deploy Replication Code' in IFS Developer Studio. - >

Developer can view generated data synchronization specific files by using RMB 'Go to Source > Replication >' - >