Offline data transform API
The offline data transform API consists of a JavaScript method that allow you to run a data transform in offline-enabled applications by using a Run script action or a custom JavaScript function. To package such a data transform rule for offline use, you must add the data transform definition to the pyDataTransformWhitelistForOffline rule.
The following JavaScript method is available for the
pega.offline
object:
Method | Description | ||||||||
---|---|---|---|---|---|---|---|---|---|
runDataTransform( datatransformName, className, pageName, callback
)
|
Runs a data transform with the specified name. The data transform rule can be run
in the specified page context.
The method has the following parameters:
|
Example
The following sample JavaScript code allows you to run a data transform called
SampleDT
, which belongs to the
MY-SAMPLE-WORK-DATATRANSFORMS
class, in the primary page context, from a custom JavaScript function:
var offlineDTCallback = {
success: function() {
console.log("Data transform ran successfully");
}
fail: function() {
console.log("Failed to run Data transform");
}
};
pega.offline.runDataTranform( "SampleDT",
"MY-SAMPLE-WORK-DATATRANSFORMS",
null,
offlineDTCallback);