|The mappings are usually evaluated when a change happens. It may be tempting to try to use current time of the evaluation as a reference time. E.g. specifying something like "10 days after the account status was evaluated to be |
Time Constraint Expressions
The timestamp to be used for the time constraint can be determined by an expression. E.g. scripting expressions can be used to set the time constraint in a very flexible manner:
<mapping> <timeFrom> <expression> <script> <code> def createTimestamp = focus?.metadata?.createTimestamp def timestamp = basic.addDuration(createTimestamp, "P3M") return basic.roundDownToMidnight(timestamp) </code> </script> </expression> </timeFrom> ... </mapping>
The expression above returns a timestamp that is based on object creation timestamp, delayed by three months and rounded down to the midnight.
If referenceTime specification is used together with expression, the reference time value will be passed to the expression in
referenceTime variable. If both expression and offset are used, the offset is applied to the timestamp produced by the expression. If the expression returns null then the time constraint will be considered unsatisfied. Which is a similar behavior as if reference time was not set.
Condition is a special kind of expression in the mapping that influences whether the mapping will be applied or not. If a condition evaluates to
true value the mapping will be applied. If it evaluates to
false then the system will pretend that the mapping does not exist at all. The condition can be used to set conditional property values, conditionally assign roles, define mapping constraints and so on.