ofbiz-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From darrell73s <darrellof...@gmail.com>
Subject Re: Offline EntitySync Functionality
Date Fri, 06 Feb 2015 23:18:13 GMT
Thanks Jacques, 

I had found that wiki article previously, which mainly documents the
pull/push processes, and found the concepts helpful while going through the
EntitySync source.

However, as you've indicated, what I'm looking at is the offline sync.
Please let me know if the following would be better suited for the "dev"
mailing list.

Assuming the scenario of an offline sync between the A (source) and B
(target) nodes, here is how I believe it would occur between the two nodes
(using the as-is WebTools flow in my example). Please feel free to correct
my understanding, or if this scenario has already been hashed out, to point
me in the right direction.

1) On Node A, user clicks "Run Offline Sync" which runs the
'runOfflineEntitySync' service. This service changes status on the
EntitySync record, creates an EntitySyncHistory record, and produces an xml
export of the data to be sync'd.

2) User on Node B inputs the xml file under "Load Offline Data" which
ultimately runs 'loadOfflineSyncData' service. This service loads the
exported data into the database by calling 'storeEntitySyncData'. There is a
TODO in the code to "create a response document to send back to the initial
sync machine".

3) Once there has been confirmation that the data was loaded into B, user
presses "Accept Offline Sync" or "Reject Offline Sync" on Node A, which runs
the 'updateOfflineEntitySync' service.

Questions/Thoughts based on the above:

* 'runOfflineEntitySync' service appears to be fully implemented

* 'loadOfflineSyncData' service appears to be almost fully implemented:
    - Service could be updated to produce the 'response document' mentioned
in the TODO in cases where you may want to automate the third step in the
process. 
    - This service makes a call to 'storeEntitySyncData' which produces a
series of stats related to records created/updated/deleted. Nothing is done
with these stats such as putting them into EntitySyncHistory because no
EntitySyncHistory is created by 'loadOfflineSyncData'. 

* 'updateOfflineEntitySync' service is NOT implemented 
	
1) In 'loadOfflineSyncData', would it make sense to call
EntitySyncContext.runOfflineStartRunning() which would mark the status of
the EntitySync record as ESR_RUNNING, as well as create the initial
EntitySyncHistory record? Then, we could populate the stats returned by
'storeEntitySyncData' such that there is record of the offline load
occurring on node B (target node), and its results into the
EntitySyncHistory record we've just created, perhaps by running
EntitySyncContext.saveResultsReportedFromDataStore()? 

At this point in the process, we could also export a 'response document'
with the results of the sync.

2) If 'updateOfflineEntitySync' were to be implemented, does it make sense
for this service to: set the status of the EntitySync and corresponding
EntitySyncHistory record based on whether: "Accept Offline Sync"/"Reject
Offline Sync" button is pressed or optionally based on the response as sent
in a 'response document'?

Thanks,
Darrell



--
View this message in context: http://ofbiz.135035.n4.nabble.com/Offline-EntitySync-Functionality-tp4662586p4662652.html
Sent from the OFBiz - User mailing list archive at Nabble.com.

Mime
View raw message