It's all about the answers!

Ask a question

Server SynchronizeIncomiongAndWait operation on ExternalProxy blocks and times out.


Paul Romanus (3355) | asked May 24 '14, 8:22 p.m.
Hi,

I'm using the Interop framework to bidirectionally sync RTC workitems to CA ServiceDesk. Users want the to see the CA ticket number come back immediately so instead of waiting for the delay of a sync to run we use a processAdvisor server side plugin to create the CA ticket ( which returns the ticket number immediately) and then create and setup necessary interop objects (externalState, externalProxy) as below.

My problem is that the external and lastSyncedState are not recorded in the syncRule/ExternalProxy when I save the sync rule with:
externalProxy = interopService().saveProxyWithTargetItem((IExternalProxy) externalProxy.getWorkingCopy(), newStateWorkItem);

The external and lastSynced state only appear to be written to the syncRule/ExternalProxy upon the first Incoming/?outGoing? sync .. if there's a way to do this without running a sync please advise ?!

As, unless all of item/'external/last synched state' states are recorded, users can submit intermediate changes to the RTC workitem, which causes a sync conflict upon the first sync.
This forces a user to open the sync rule, resolve the conflict and run and incoming sync.. all of which is unacceptable.

However when I try to run interopService.synchronizeOutgoingAndWait(oldStateWorkItem, xstate, syncRule);
to record the item/external/last synched states on the sync rule immediately... DOOM, the method doesn't return and the client hangs then timesout. .. N.B when I use the equivalent method from client side libraries (externally), this doesn't occur.

So I presently have to use asynchronous: interopService.synchronizeOutgoing which submits the request to the sync queue, and hope the user doesn't enter any data to the workitem until the background task processes the request ( usually around 20secs in our environment).

...                        
IExternalProxy externalProxy = InteropFactory.INSTANCE.createExternalProxy();                        externalProxy.setSyncRule(syncRule);                       
externalProxy = interopService().saveProxyWithUri(externalProxy, (String) newStateWorkItem.getValue(GSDIncidentIdentifierIAttributeID));                       
Map<String,String> externalStateAttributeHashMap =  new HashMap<String,String>();                        buildExternalStateMap(monitor, newStateWorkItem, propMap, externalStateAttributeHashMap);            IExternalState xstate = InteropFactory.INSTANCE.createExternalState();                        xstate.setState(externalStateAttributeHashMap);                       
xstate = interopService().saveExternalState(xstate);                       
externalProxy = interopService().saveProxyWithTargetItem((IExternalProxy) externalProxy.getWorkingCopy(), newStateWorkItem);
// interopService.synchronizeOutgoingAndWait(oldStateWorkItem, xstate, syncRule);                      interopService().synchronizeIncoming(externalProxy, null, /*syncedItemStateHandle*/null, /*syncRuleHandle*/syncRule);

...

Thanks, Paul









One answer



permanent link
sam detweiler (12.4k6171200) | answered May 25 '14, 7:32 a.m.
As far as I know, only successful synch records the state. all the interop calls signal to start a synch.

when I did my synchronizer to SFDC, I used the External Repository Manager, it doesn't run synchronously.
you could still use the participant to create the CA ticket, update the workitem and let the synchronizer
do all the other work.

the synchronizer combines changes



Comments
Paul Romanus commented Jun 28 '14, 4:01 p.m.

Thanks for commenting Sam, in the end I implemented the optional mergeProperty Interop Framework interface method, it's called on conflict of a property, and always chose to accept RTC's outgoing state.

Your answer


Register or to post your answer.