🚀 Welcome to MDriven Learn –  MDriven is now on Discord!  Don’t miss the latest Release Notes.
OCLOperators changePoints
This page was created by Hans.karlsen on 2022-10-26. Last edited by Wikiadmin on 2026-07-29.

You can use changePoints in OCL to retrieve the recorded historical versions of one object over a timestamp range; it is for models where versioning is enabled on the class.

What changePoints returns

When versioning is enabled, MDriven records a change point each time a versioned object is modified. The changePoints operator retrieves the stored versions for an object whose change points fall within the requested timestamp range.

Use this operator when you need to inspect how one object changed over time. For example, you can retrieve the recorded versions of a Customer and evaluate each returned version in an OCL expression.

Syntax

self.changePoints(startTime, stopTime)
Argument Meaning
startTime Integer timestamp in UTC ticks at which the search begins.
stopTime Integer timestamp at which the search stops. Use -1 to search until the end of recorded history.

Use changePoints

  1. Enable versioning on the class whose object history you need. changePoints is intended for versioned classes.
  2. Identify the object whose history you want to retrieve.
  3. Choose the starting timestamp in UTC ticks.
  4. Choose the ending timestamp, or use -1 to include the object's remaining recorded history.
  5. Call changePoints on that object.

Examples

Retrieve the complete recorded history

The following expression retrieves every recorded version of the first Customer, from timestamp 0 to the latest recorded change point:

Customer.allInstances->first.changePoints(0, -1)

Retrieve history within a selected range

Replace the timestamps with the UTC-tick range you need:

self.changePoints(startTime, stopTime)

For example, use -1 as stopTime when the starting point is known but you want all change points recorded after that point.

Work with timestamps

The versions returned by changePoints have timestamps. Use objectTimeStamp when you need to access the timestamp of the current object version. This is also relevant when working with other versioning operators that expect a timestamp.

Notes

  • changePoints returns recorded versions, not an unversioned object's current state.
  • A class must have versioning enabled before MDriven can record the changes that this operator retrieves.
  • -1 has a specific meaning only for stopTime: search until the end of recorded history.

See also