OCLOperators OnCreate
No edit summary
No edit summary
 
(8 intermediate revisions by 3 users not shown)
Line 1: Line 1:
OnCreate is called aften a new object has been created.
OnCreate is often called after a new object has been created.


It's very much like a .Net constructor for OCL.
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.
You can use <code>self.base.OnCreate</code> to call the superclass's OnCreate as you would in another language.


==== Example ====
==== Example ====
In the method body for OnCreate set this ocl:
In the method body for OnCreate, set this OCL:
  CreateTime:=DateTime.Now;  
  CreateTime:=DateTime.Now;  
  self.Guid.newGuid()  
  self.Guid.newGuid()  
See more: [[Acting on object changes]]
See more: [[Acting on object changes]]
See also: [[OCLOperators OnUpdate|OnUpdate]], [[OCLOperators OnDelete|OnDelete]], [[OnStateChange]]
[[Category:OCL General Operators]]
{{Edited|July|12|2024}}

Latest revision as of 07:17, 15 May 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 more than 8 months ago on 05/15/2024. What links here