Audit conditions examples

This document describes usage examples of conditions written in either of the following properties. Using conditional audit is part of Fine tuning K2B Audit. Conditions syntax can is described in Audit conditions syntax rules.

Example 1 Audit sensitive products

An application works with Products and needs to audit only those identified as "sensitive". Sensitive products have the ProductIsSensitive attribute set to true. Conditions written in the corresponding property are:

  • Audit Insert Condition: ProductIsSensitive;
  • Audit Update Condition: old(ProductIsSensitive) or ProductIsSensitive;
    The condition is true if the product was or become a sensitive one.
  • Audit Delete Condition: ProductIsSensitive;

Example 2: Audit product price changes only

The idea is to keep track of (audit) changes to product prices. Only one condition is needed for this.

  • Audit update condition: old(ProductPrice) <> new(ProductPrice);