Skip to content

OLD.

Info

New in Atfinity 17.

Description

OLD. reads the value a field had in the previous state of its instance, which is the state the last approved case left behind. What a running case changes belongs to that case until it is approved, so in a lifecycle case OLD. is what the client had on file when the case started.

If the instance has no previous state, or the field was never filled in it, OLD. returns unknown. In a creation process that is true of every field, since the instance comes into existence with the case.

OLD. needs at least one field, so OLD.p on its own is not valid. The path may cross relationships, structures and list indexes, and only the last field is read from the previous state. Everything before it is resolved on the current data, so OLD.p.addresses[0].city gives the previous city of whichever occurrence is first today, and OLD.p.spouse.last_name the previous last name of whoever is the spouse now.

To compare a field against its own previous value, has_changed says the same thing without writing the path twice.

Example

p is Person
OLD.p.risk_rating = low
and p.risk_rating = high

Only a client who was low risk before this review and is high risk after it matches, which is the escalation worth a second pair of eyes. has_changed cannot express it, since it says that something changed but not what it changed from.

For a client with no rating on file the first line is unknown, so the rule stays pending unless the second line settles it as false. Put OLD.p.risk_rating is known and in front to make it resolve.

Outside rules

OLD. and the two provenance operators are also available in documents:

  • in ADX templates, where OLD.p on its own is allowed and a field with no previous value prints nothing
  • in the reference of a document box, where the whole path is read from the previous state rather than only the last field. OLD. cannot be combined with case data such as CASE.state there