SyncLayerResult.EditResults

816
2
Jump to solution
05-17-2017 05:53 AM
JoeHershman
MVP Regular Contributor

I am assuming the remark for this method should be:

If there's NO error the return value is NULL.

As opposed to the current remark:

If there's an error the return value is NULL.

The followup question being, if there are sync errors will the job return a JobStatus.Failed or do you still need to check this on JobStatus.Succeeded

Michael Branscomb

Will Crick

Thanks,
-Joe
0 Kudos
1 Solution

Accepted Solutions
AnttiKajanus1
Occasional Contributor III

Hi Joe,

I assume that that you are referencing this SyncLayerResult.EditResults Property 

Text that is highlighted is misleading and wrong so please ignore it. The remark is actually related how our communication is done between C++ and C# and slipped through to the public API documentation. We will fix that for the next release.

From my understanding the actually the behavior is following:

1) if the SyncGeodatabaseJob completes (ie. no error occurred in the authentication, network connection, etc..) the SyncGeodatabaseJob.Status is set to completed and SyncGeodatabaseJob.Error is null.

2) if the SyncGeodatabaseJob fails (ie. no network connection) the SyncGeodatabaseJob.Status is set to failed and SyncGeodatabaseJob.Error has an error.

3) if the job completes and if there weren't any edit errors then SyncGeodatabaseJob returns a SyncLayerResultList which doesn't contain any items

In the picture above you can see that the results doesn't contain any items so all is good. 

4) if the job completes and if there were edit errors then SyncLayerResultList contains one or more SyncLayerResult items. These items contains at least one FeatureEditResult so there shouldn't be a case where SyncLayerResult.EditResults list is either empty or null. You could still check if this to be sure (we shouldn't have any SyncLayerResults if they don't have any FeatureEditResults in the first place). It should be actually very hard to get into the situation where you would find any FeatureEditResults or SyncLayerResults  populated so if you find that you are getting these, please let us know.

Hopefully this cleared some confusion how this works.

View solution in original post

2 Replies
AnttiKajanus1
Occasional Contributor III

Hi Joe,

I assume that that you are referencing this SyncLayerResult.EditResults Property 

Text that is highlighted is misleading and wrong so please ignore it. The remark is actually related how our communication is done between C++ and C# and slipped through to the public API documentation. We will fix that for the next release.

From my understanding the actually the behavior is following:

1) if the SyncGeodatabaseJob completes (ie. no error occurred in the authentication, network connection, etc..) the SyncGeodatabaseJob.Status is set to completed and SyncGeodatabaseJob.Error is null.

2) if the SyncGeodatabaseJob fails (ie. no network connection) the SyncGeodatabaseJob.Status is set to failed and SyncGeodatabaseJob.Error has an error.

3) if the job completes and if there weren't any edit errors then SyncGeodatabaseJob returns a SyncLayerResultList which doesn't contain any items

In the picture above you can see that the results doesn't contain any items so all is good. 

4) if the job completes and if there were edit errors then SyncLayerResultList contains one or more SyncLayerResult items. These items contains at least one FeatureEditResult so there shouldn't be a case where SyncLayerResult.EditResults list is either empty or null. You could still check if this to be sure (we shouldn't have any SyncLayerResults if they don't have any FeatureEditResults in the first place). It should be actually very hard to get into the situation where you would find any FeatureEditResults or SyncLayerResults  populated so if you find that you are getting these, please let us know.

Hopefully this cleared some confusion how this works.

JoeHershman
MVP Regular Contributor

Thank you for the detailed response, this is very helpful

Thanks,
-Joe
0 Kudos