Mask Execution Order
DataVeil considers all dependencies within a masking Project and automatically determines the correct execution order of all masks.
This includes columns that are in foreign key relationships and those in user-defined dependencies.
It also includes situations where a mask uses the masked value of another mask. For example, if column Person.FirstName is masked with a Person Given Name mask, and another column Contact.EmailAddress is masked with a User SQL Value mask that references the masked value of Person.FirstName then DataVeil shall ensure that Person.FirstName masking is performed before the masking of Contact.EmailAddress is performed.
Masking One Column with Multiple Conditional Masks
It is common to define a single mask for a column; however, you can also specify multiple masks for a column as shown in the example below.
Each mask is performed in sequence. If a row satisfies a mask's Where condition then it is masked and the row is then removed from consideration by other masks.
In other words, a row is only masked once. This is done by the first mask whose Where condition is satisfied.
What this example shows is that the first mask will perform the Randomize mask on column 'Comment' for all rows where the UserLevel is less than 10.
The next mask will perform the Redact mask on all rows where the UserLevel is less than 100. However, the previous mask had already selected all rows whose UserLevel was less than 10 so this mask will effectively mask only those rows whose UserLevel is at least 10 and less than 100.
Finally, the last mask defines that all remaining unmasked rows in column 'Comment' are to be shuffled. This effectively means all rows whose UserLevel is 100 or greater.
If you have a need to use the same sequence of masks for more than one column, then consider using the Sequence Mask. It allows for easy re-use of the same sequence in many columns.
An unconditional mask is one that does not define the Where Option.
It is recommended that you always include an unconditional mask as either the only mask for a column or as the last mask for a column.
This will guarantee that all rows will be masked. If you do not specify an unconditional mask and some rows are not masked then DataVeil shall report a runtime warning.
Note: It makes no sense to have any masks defined after an unconditional mask because an unconditional mask will leave no unmasked rows for the following masks to select (see example above.)
If you intentionally want to mask only some rows and preserve the remaining rows then you can specify the Preserve mask as the final and unconditional mask. This tells DataVeil that the unmasked rows are intentional and therefore DataVeil shall not report a warning if there are any unmasked rows for that column.
For example, if you want to Randomize the column 'cola20' only on rows where Status = 'SECURE' and you are certain that you want to preserve all other rows and therefore do not want DataVeil to report a runtime "unmasked rows" warning then you could define the mask sequence as shown below: