Why do pyStatusWork and pyStatusWorkOld have same value in pyWorkPage?
Why do pyStatusWork and pyStatusWorkOld (Property to store the old value of the Work status) have same value in pyWorkPage? Should not the later hold the previous work status value? However, both of them hold current work status value.
The StatusElapsedCalculation Declare Trigger rule, this copies the value of pyStatusWork property to pyStatusWorkOld property.
Below is the reason for this behavior:
Copy Value to (optional)
Optional. Identify a property of the same mode and type as the property in the Property field on this row. This property can retain the current value of the changed property. Copying occurs only if the trigger activity runs, and after the trigger activity completes.
Copying makes the previous property value available to the second and subsequent executions of this rule.
The property copy is done after processing the trigger activity. This is to allow the next invocation of the trigger to have a reference to the old property value. The copy property is therefore only useful during trigger execution, not after the trigger execution.
To save the previous status value of pyStatusWork, create a new declare trigger which copies the value of pyStatusWork into a new property. That property will hold the previous value of pyStatusWork.
As recommended, I created a new declare trigger, and new property to copy value of pyStatusWork and an activity. However, the value of new property is equal to the value of pyStatuswork just like in case of pyStatusWork.