Kony Quantum is now HCL Volt MX. See Revised Terminology. Current Quantum users, see the important note about API naming.
Release:
VMXFoundry.OfflineObjects.startSync
The VMXFoundry.OfflineObjects.startSync API performs sync on all the object services published in the Volt MX Foundry application.
Note:
If sync is performed in an upload cache enabled scenario, cached requests that are timed out in the previous upload session are uploaded before the latest changes.
The client does not handle partial records and expects the server to send the entire record. Full record with all the columns are expected in both upload and download responses. If the backend does not return the full record, use post processor to copy the missing columns from the request as demonstrated here.
Volt MX Iris (JavaScript)
Note:
Supported for Windows from V8 SP4 Fix Pack 6 onwards.
Supported for Mobile Web and Desktop Web channels from V8 SP4 Fix Pack 12 onwards.
Signature
Input Parameters
Parameter
Type
Description
Required
options
JSON
The user can provide options to customize sync behavior. For example, syncMode and objectServicesOptions. For information on supported options, refer to Sync Options.
Yes
successCallback
Function
The function is invoked on successful sync with response as an argument. Based on the supplied sync options, the response object includes sync status code, sync stats and so on.
Yes
failureCallback
Function
The function is invoked on an error with the cause of failure as an argument upon sync failure.
Yes
progressCallback
Function
The function is invoked on different sync phases along with specific data such as the number of downloaded records and so on. Note: This parameter is only supported for Android, iOS, and Windows channels.
No
Sync Options
Option
Type
Description
Required
syncMode
String
Option to perform object services sync in sequence or parallel. The values could be{“parallel”, “sequential”} Note: Default sync mode is parallel, if not provided in options.
No
objectServicesOptions
JSON
The user can provide options to customize sync behavior. For example, Filters, downloadBatchSize and so on. For more details, refer Sync Options for supported options and Offline Objects Getting Started guide.
No
Success Callback Response
Success Object Keys
Type
Description
successResponse
JSON
It contains object service name as keys and object service sync success response as values.
Failure Callback Error
Failure Object Keys
Type
Description
successResponse
JSON
It contains object service name as keys and object service sync success response as values.
failureResponse
JSON
It contains object service name as keys and object service sync failure response as values.
Return Type
void
Example
Android (Java)
Signature
Parameters
Parameter
Type
Description
Required
options
HashMap<String, Object>
The user can provide options to customize sync behavior. For example, syncMode and objectServicesOptions. For supported options, refer Sync Options.
Yes
syncCallback
VMXCallback
The application implements onSuccess and onFailure methods of VMXCallback interface.
Yes
voltmxSyncProgressCallback
VMXProgressCallback
Application implements onProgress method of VMXProgressCallback interface if progress callback is supplied.
Yes
Sync Options
Option
Type
Description
Required
syncMode
String
Option to perform object services sync in sequence or parallel. The values could be{“parallel”, “sequential”} Note: Default sync mode is parallel, if not provided in options.
No
objectServicesOptions
HashMap<String, Object>
The user can provide options to customize sync behavior. For example, Filters, downloadBatchSize and so on. For more details, refer Sync Options for supported options and Offline Objects Getting Started guide.
No
Success Callback Response
Success Object Keys
Type
Description
successResponse
HashMap<String, Object>
It contains object service name as keys and object service sync success response as values.
Failure Callback Error
Failure Object Keys
Type
Description
userInfo
HashMap<String, Object>
It contains HashMaps with keys successResponse and failureResponse. successResponse contains HashMap of object service name as keys and object service sync success response as values. failureResponse contains HashMap of object service name as keys and object service sync failure response as values.
Return Type
void
Example
iOS (Objective C)
Signature
Parameters
Parameter
Type
Description
Required
options
NSDictionary<NSString*, id>*
The user can provide options to customize sync behavior. For example, syncMode and objectServicesOptions. Refer Sync Options for supported options.
Yes
onSuccess
VMXSuccessCompletionHandler
The function is invoked on successful sync.
Yes
onFailure
VMXFailureCompletionHandler
The function is invoked on sync failure.
Yes
onProgress
VMXProgressCompletionHandler
The function is invoked on sync progress events.
Yes
Sync Options
Option
Type
Description
Required
syncMode
String
Option to perform object services sync in sequence or parallel. The values could be{“parallel”, “sequential”} Note: Default sync mode is parallel, if not provided in options.
No
objectServicesOptions
NSDictionary<NSString*, id>
The user can provide options to customize sync behavior. For example, Filters, downloadBatchSize, and so on. For more details, refer Sync Options for supported options and Offline Objects Getting Started guide.
Yes
Sync Callback Response
Success Object Keys
Type
Description
successResponse
NSDictionary<NSString*, id>*
It contains object service names as keys and object service sync success response as values.
Failure Callback Error
Failure Object Keys
Type
Description
userInfo
NSDictionary <NSString*, id>*
It contains NSDictionaries with keys successResponse and failureResponse keys. successResponse contains NSDictionary of object service name as keys and object service sync success response as values. failureResponse contains NSDictionary of object service name as keys and object service sync failure response as values.