🚀 Welcome to MDriven Learn –  MDriven is now on Discord!  Don’t miss the latest Release Notes.
OCLOperators OnCreate
This page was created by Peter on 2019-11-18. Last edited by 62.169.16.147 on 2026-09-12.

OnCreate is often called after a new object has been created.

It's very much like a .Net constructor for OCL.

You can use self.base.OnCreate to call the superclass's OnCreate as you would in another language.

Example[edit source]

In the method body for OnCreate, set this OCL:

CreateTime:=DateTime.Now; 
self.Guid.newGuid() 

See more: Acting on object changes

See also: OnUpdate, OnDelete, OnStateChange