Event use cases

This document summarizes the events that should be used on a class or a representation to solve an issue. It is a compilation of other documents.

WHEN AN INSTANCE IS READ
Need to coverEvent to be usedScript level
Compute properties of a class instance that are :
  • Not stored in the tables associated with the class.
  • Necessary to handle different methods or operations for the instance.
AFTER_READ eventMain class
Compute properties of a class instance that are :
  • Not stored in the tables associated with the class.
  • Displayed in the query.
AQUERY_TRANS_AFTER eventMain class
Compute additional properties of a class instance needed only for display purposes or for help purposes during a manual input.AFTER_READ eventRepresentation
Compute additional properties of a class instance needed only for indexing purposes.ASEARCH_TRANS_AFTER eventClass
WHEN AN INSTANCE (OR A COLLECTION LINE) IS CREATED
Need to coverEvent to be usedScript level
Assign a default value that depends on the circumstances (current user, date, global parameter values) rather than on another property.INIT event for the propertyClass of the property
Assign a default value (that can be changed during the input) with the result of a computation based on other properties (with a re-computation if the original properties change).PROPAGATE event on every property whose update triggers a re-computationClass of the properties
Assign a default value that will only be set if no value was entered for creation of an instance.AINSERT_CONTROL_BEFORE event (if the property is not filled)Class of the property
Perform a control that does only depend on the value of the field to be controlled.CONTROL event on the propertyClass of the property
Perform a global control based on a combination of properties, assuming that all the controls done on the individual properties (individual controls, mandatory fields controls), type based controls are already done.AINSERT_CONTROL_AFTER eventClass of the property that has the highest level
Update additional tables not described in the class when an instance has been successfully created in database.AINSERT_AFTER event (if you generate an error, the database transaction will be aborted)Class
WHEN AN INSTANCE (OR A COLLECTION LINE) IS MODIFIED
Need to coverEvent to be usedScript level
Perform a control that depends on the value of the field to be controlled.CONTROL event on the propertyClass of the property
Prevent the modification of a property if some conditions that don't depend on other properties are met.CONTROL on property: compare snapshot value and current valueClass of the property
Perform a global control based on a combination of properties, assuming that all the controls done on the individual properties (individual controls, mandatory fields controls), type based controls are already done.AUPDATE_CONTROL_BEFORE eventClass of the property that has the highest level
Prevent the insertion of a line in a collection if some conditions are met.ADDLINE_BEFORE on the collection COLL: perform the check (this is the header, ALINE is the position to be inserted)Class that includes the collection
Prevent the deletion of a line in a collection if some conditions are met.ADELLINE_BEFORE on the collection COLL: perform the check (this is the header, ALINE is the position of the line to be deleted)Class that includes the collection
Reassign a default value (that can be changed during the input) with the result of a computation based on other properties (with a re-computation if the original properties change).PROPAGATE event on every property whose update triggers a re-computationClass of the properties
Update additional tables not described in the class when an instance has been successfully updated in database.AUPDATE_AFTER event (if you generate an error, the database transaction will be aborted)Class
WHEN AN INSTANCE (OR A COLLECTION LINE) IS DELETED
Need to coverEvent to be usedScript level
Perform additional controls before referential integrity controls have been done.ADELETE_CONTROL_BEFORE eventCorresponding class
Perform additional actions after deletion has been successfully done.ADELETE_AFTER eventCorresponding class