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:
namePattern = DE( "NAME_PATTERN" ).getValue( );
STRING_LIST( "namePatternList" ).add(namePattern );
DATA_ITEM( "NameDI" ).setPatterns( STRING_LIST( "namePatternList" ).getValue( ) );
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.