CDT Diff Utilities

Overview

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

Key Features & Functionality

  • 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.
Anonymous