Dynamic Data Items


Dynamic data items is an advanced feature that gives you the ability to manipulate the execution of composite rule actions from the rule logic scripts.

Composite rule actions typically identify certain pieces of data within a single data field. Such pieces of data, called data items, are commonly defined by one or more regular expressions describing their internal format, or by a list of values. The composite definition then establishes the logical order and dependencies between such data items and specifies the rules for parsing the "composite field". Composite rule actions use these definitions to parse the fields and map some of the identified data items onto data elements. If these data elements are matched by other Data Privacy rules defined in the project, these rules are then automatically invoked on the data items, disguising those within the containing field.

This approach is very powerful when the data items can be defined in a universal way, not dependent on the particular data record or any other context. Examples of such universal data items are patterns for telephone numbers or lists of values for standard US states abbreviations. This may be insufficient, however, when the valid lists of values or patterns have to be defined based on other fields or results of execution of other rule actions.

The dynamic data item feature provides several simple functions that enable you to adjust the pre-defined lists of patterns or values from the rule logic for each record to allow composite rule action processing to customize the identification of the data items. These functions include:

  • getPatterns - returns the STRING_LIST object that contains the current regular expression patterns used by the data item.
  • setPatterns - replaces the list of regular expression patterns used by the data item.
  • getValues - returns the STRING_LIST object that contains the current values used by the data item.
  • setValues - replaces the list of values used by the data item.

The following example illustrates the possible usage:

// Read the name patterns from the NAME_PATTERN Data Element into a STRING variable namePattern
namePattern = DE( "NAME_PATTERN" ).getValue( );
// Initialize the (empty) string list variable namePatternList by adding to it the namePattern value.
STRING_LIST( "namePatternList" ).add(namePattern );
// Modify the Data Item NameDI by changing its list of patterns to the value of namePatternsList.
DATA_ITEM( "NameDI" ).setPatterns( STRING_LIST( "namePatternList" ).getValue( ) );
// Execute the Composite Rule Action
RULE_ACTION( "FullName Composite RA" ).execute( );

In this example, the rule action execution will use the newly-provided pattern rather than the patterns contained within the data item definition.

Important

  • Any changes to the data Item definition will apply only for the duration of processing of the current record. When the next record is being processed, the data item’s patterns and values are reverted to their original values.
  • Any changes to the lists of patterns or values do not modify the identification order or logic for the composite rule action or any other properties of the data item. For example, if the data item definition specifies that the Values available option is turned off, any updates to the list of values would be ignored by the execution.
  • There is no significant performance impact from setting the list of patterns repeatedly to the same values or repeatedly assigning values from a small set. The compiled patterns are cached by Data Privacy and reused in order to minimize the performance impact from such adjustments.

 

Tip: For faster searching, add an asterisk to the end of your partial query. Example: cert*