Often times an entity is more than just an object used for data access, for this purpose you can use the action element to specify custom behaviors for an entity. Additionally actions can be associated with certain events of an entity and triggered by those
events. Using the “async” keyword for actions attached to entity events causes that action to be triggered asynchronously. Using the “on” keyword allows the declaration of the method to be on a different class from the entity itself as well.
For the default business object framework a custom action translates into a custom method on the specified entity. The developer must implement the method manually with the appropriate parameters. The purpose of this feature is partly to allow an architect
to specify all of the behaviors of an entity during design time and then to allow a developer to know what behaviors are required of the entity. It is also partly to easily trigger the execution of certain methods based on the events of the entity.
action Log when inserted;
action Notify on Example.EmailNotifier when updated async;
||Fires before data is loaded during a retrieve.
||Fires after data is loaded during a retrieve.
||Fires before a fetch occurs.
||Fires after a fetch has occurred.
||Fires before an entity is persisted. This event will fire regardless of whether or not an insert, update or delete occurs.
||Fires after an entity is persisted. This event will fire regardless of whether or not an insert, update or delete occurred during persistence.
||Fires before an entity is inserted during persistence.
||Fires after an entity is inserted during persistence.
||Fires before an entity is updated during persistence.
||Fires after an entity is persisted during persistence.
||Fires before an entity is deleted during persistence.
||Fires after an entity is deleted during persistence.
||Fires when an entity is being validated against the specified validation rules.
||Fires after an entity is validated against the specified validation rules.
||Fires before a field is accessed.
||Fires after a field has been accessed.
||Fires after the state of an entity has changed. If the values of any fields are changed or if the entity is inserted, updated or deleted during persistence.
||Fires if an error occurs during persistence or a fetch.