OCLOperators OnCreate
(Adding message template to the top of the page)
(Replacing message template with parser tag)
 
Line 1: Line 1:
{{message|Write the content here to display this box}}
<message>Write the content here to display this box</message>
OnCreate is often called after a new object has been created.
OnCreate is often called after a new object has been created.



Latest revision as of 07:48, 17 June 2024

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

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

This page was edited 94 days ago on 06/17/2024. What links here