Plug-in (Function & Smart Service)Free

CDT Diff Utilities

by Appian Corporation

Description

This plugin contains two functions to track changes in CDT instances for audit requirements.

Features

The cdtdifference() function takes two instances of the same CDT and returns an array of differences in the form: [attributeName, previousValue=, currentValue=]. The primary use case for this function is to take two rows from a database, read them into the same CDT type, pass them to the function and return the differences so as to support an audit requirement of what changed between versions of the data.

The cdtcomparison() function takes two instances of the same CDT and returns an array of ALL of the elements from the two CDTs with their previous and current values, along with a Boolean flag indicating if the values are different, in the form: [attributeName, isDifferent, previousValue=, currentValue=]. The primary use case is similar to that of the cdtdifference() function, but allows for a full side-by-side comparison of the data as opposed to just the differences.

Release notes

Fixed expression evaluation error with v1.2

Version history (2)

1.2.0

Update to use type transformer v1.4

1.1.0

of the same CDT and returns an array of differences in the form:

[attributeName, previousValue=, currentValue=]

If no differences are found, the returned array will be empty.

In this first version, only CDTs that contain primitive element types are supported i.e. no nested CDTs are allowed. In addition, multiples/arrays of elements are also not supported.

The primary use case for this function is to take two rows from a database, read them into the same CDT type, pass them to the function and return the differences so as to support an Audit requirement of what changed between versions of the data. An application would have to write a new data record each time a change was made for this function to be useful. In addition, a full enabled Audit application would have to write the who and when into the data model as well.

  1. The cdtcomparison() function takes two instances of the same CDT and returns an array of ALL of the elements from the two CDTs with their previous and current values, along with a Boolean flag indicating if the values are different, in the form:

[attributeName, isDifferent, previousValue=, currentValue=]

The array will always contain ALL of the elements of the CDTs passed to it.

The primary use case is as in the cdtdifference() function but allows for a full side-by-side comparison of the CDTs as opposed to just the differences. fn!cdtdifference()

Inputs: previousCustomDataType (Any Type): The previous version of an instance of a CDT currentCustomDataType (Any Type): The current version of an instance of a CDT

Outputs: An array of difference CDTs in the form:

[attributeName, previousValue=, currentValue=]

fn!cdtcomparion()

Inputs: previousCustomDataType (Any Type): The previous version of an instance of a CDT currentCustomDataType (Any Type): The current version of an instance of a CDT

Outputs: An array of difference CDTs in the form:

[attributeName, isDifferent, previousValue=, currentValue=