For our project at De Goede Woning we have been developing a data synchronization process between CiviCRM and their main transaction system in Oracle (comparable with an ERP). Some data for a contact (first name, middle name, last name, gender and birth date), phones, emails and addresses will be common between the two, so a change, create or delete in CiviCRM will have to be synchronized with the main transaction system and vice versa.
From the main transaction system to CiviCRM we use customized API's with the REST interface. From CiviCRM to the main transaction system is a little more involved as they do not have anything like API's or REST. So here is what we do:
- we have created a custom data set to hold the CiviCRM id's and the main transaction system keyes
- we have developed a CiviCM pre hook that saves the data for contacts, email, address and phone prior to update
- a CiviCRM postProcess hook compares the new values with the saved data. If there is new data but no old, we have a create situation. If we have old data but no new we have a delete, and if there are other differences we have an update.
- if we have a create, delete or update we set an action field in the custom data set, and add the contact to a specific synchronization group
- once every 10 minutes a job on the main transaction systems uses a customized API with REST to retrieve all members of the specific synchronization group, uses a customized get API with REST to get the data from CiviCRM, processes the data and then uses another API to remove the contact from the group.
Lots of more details ofcourse, but roughly this is the story. Today was our first user test, and we have discovered a couple of issues but the main conclusion was: it works! So I will enjoy a well deserved glass of wine tonight..........and start solving the issues tomorrow :-)
Erik
Comments
Sounds like you have earnt yourself a warm beer and a marmite sandwich
Oh no, not again!!!!! Show some mercy....
Where is your courage ?
Dutch courage isn't up to its reputation... :)
X+
After testing today, the synchronization has been approved for acceptance testing!