#Time in DCR Process Models

Start an activity when a child reaches a certain age

Working with Syddjurs Municipality we’ve seen examples where certain activities must start when a child reaches the age of 16 or 18.

This model outlines how a delay is set so a robotic event is executed when the child reach the age of 16.

We assume that the system somehow sets the childs birthday when the process start.

We then have a delay calculated as

(Birthday – now) + P16Y

Once the child turns 16 the robot event is executed including the sub-process where the Do something activity is pending.

When you simulate you can enter “Child birthday” to January 1st, 2004. When the engine calculate the above expression it will reach a duration so the delay will be January 1st, 2020. Unfortunately we use C# Timestamp which assumes a year is always 4 years leading to a minor error.