-
Notifications
You must be signed in to change notification settings - Fork 4
Class constructors
Each object class in ACMA can have a class constructor which defines:
- Undelete parameters (for an object class marked as undeletable)
- Attribute constructors for the class
- Exit events
When a class is marked as undeletable, the undelete parameters are used to search for an existing, deleted object in the database whenever a new object is exported from MIM. If the search parameters return a result, the existing object is undeleted, otherwise a new object is created.
- Attribute conflicts: If the newly exported object from MIM contains attributes that conflict with those that are stored on the deleted object, the new attributes will overwrite any existing attributes.
- Query structure: The undelete parameters use the standard Database query structure.
- Uniqueness requirement: It is important to ensure that the attributes used in undelete searches are unique. If an undelete query returns more than one result, then an exception is thrown, and the export operation fails.
- Use unique identifiers like employee numbers or account names
- Test undelete queries thoroughly to ensure they return single results
- Consider the impact of attribute overwrites on existing data
A class constructor has a series of Attribute constructors that are used to build new values for attributes of that object class. These constructors execute in sequential order and can depend on values created by previous constructors.
- Constructors execute from top to bottom as displayed in the ACMA editor
- Later constructors can use values created by earlier constructors
- Each constructor executes only once per export operation
Exit events are a powerful feature that allows you to trigger actions external to the object being exported. ACMA provides three types of exit events:
- Internal exit events: Send events to other objects in the ACMA database
- Command exit events: Execute external processes with object attributes as parameters
- Extension exit events: Execute custom C# code when events are raised
Exit events are evaluated and executed after all attribute constructors have completed for an object, allowing them to work with the final state of the exported object.