Delta Engine Script

Current version: 2.1

This JSON object can be included in your AssemblyLines and then accessed via script code, for example in a Script component.

Linked here is the JavaScript code and a handy PDF made by Eduardo Patrocinio. This PDF is a continuation of his work using TDI for DLA creation, but there is a bit of guidance on the deltaEngine asset in there as well.

Thanks to Eduardo Patrocinio and Sumana Bhat for helping me with this asset!!

Here is the documentation (clipped from the code itself):

// How To Use:
// -----------
// To use, simply have your AL load this Script as a Global Prolog. 
// then create a Script component in your AL at a suitable spot
// where you drive the contents of work (or some other Entry)
// through delta computation:
//
//      var deltaEntry = deltaEngine.computeDelta(work, "cdm:Signature");
//
// The computeDelta() method supports several optional parameters as well:
//
//      deltaEngine.computeDelta(entry, keyAttribute, autoCommit, resetSnapshots, deltaTableName)  
//
// So, if you also wanted to erase all snapshots in the table called "MY_DELTA", 
// and have to manually commit snapshots by calling deltaEngine.commit():
//
//      var deltaEntry = deltaEngine.computeDelta(work, "cdm:Signature", false, true, "MY_DELTA");
// 
// As a JSON object, this library only occupies a single variable in your
// script context, which is nice when you use the Debugger's Watch List feature.
//
// The parameters to computeDelta are:
//     entry       - The Entry object (e.g. work) that you want to compute
//                         changes for based on its snapshot from the previous run.
//                         Mandatory. 
//     keyAttribute   - Name of the Attribute in the entry that 
//                         uniquely identifies this record (e.g. uid).
//                         Note that if no individual Attribute value is 
//                         unique in your input data, then you should create 
//                         one that is by combining several.
//                         Mandatory. This must be the name of an Attribute in the
//                         entry passed as the first parameter.
//     autoCommit     - If true then each new snapshot is committed immediately
//                         after it has been returned by the computeDelta() call.
//                         A value of false means that you will script this call
//
//                             deltaEngine.commit(); 
//
//                         when you are ready to acknowledge that a change
//                         has been successfully handled (e.g. another SC).
//                         Optional. Autocommit is true by default.
//     resetSnapshots - if true will cause snapshot db to be re-created during 
//                        the first computeDelta() call.
//                         Optional. You us a value of true for this argument if you
//                         want to delete all snapshots and create a new delta
//                         baseline. The Snapshot table is automatically created
//                         the first time you call computeDelta(), regardless of
//                         the value sent for this parameter.
//     deltaTableName - Unique name for this snapshot db table for this AL.
//                         Optional. A default value based on AL and Component names
// 

-- EddieHartman - 11 Jun 2009

Topic revision: r1 - 11 Jun 2009, EddieHartman - This page was cached on 05 Aug 2023 - 03:40.

This site is powered by FoswikiCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TDI Users? Send feedback