Skip to content

Events ​

Various functionalities of the ADOxx platform trigger events, e.g. loading a model, create an instance, edit an attribute value etc. These events can be processed by event handlers, which are AdoScripts that executed when certain events occurs. This allows to listen to events that result from the interaction with of the modelling toolkit and handle / trigger operations based on them. Depending on the event, a certain set of parameters/variables are predefined to be used during the implementation of the actual handler. The implementation is done in the Library Attribute "Add Ons" of the dynamic library.

An example for an event handler:

leo
ON_EVENT "AppInitialized" {
  # Do something when the application is initialized ...
}

The events are categorized after their place of activity:

  • Application
  • Core
  • Drawing
  • ImportExport
  • Modeling
  • Simulation

Application Events ​

AppExit (Application)

This event is triggered before the application is going to shut down. This Event Handler has no parameters.

AppInitialized (Application)

This event is triggered after the initialization of the application is finished. This Event Handler has no parameters.

ChangeComponent (Application)

This event is triggered after the user changed the active ADOxx component. The parameter old contains the number of the old component and new the number of the new component.

Core Events ​

AfterCreateRecordRow (Core)

This event is triggered after a record row has been created.

Parameters:
modelid:integer ID of the changed model. instid : integer ID of the changed instance (owner of the record). attrid : integer ID of the RECORD attribute. pos : integer Position of the new row (1 = first). rowid : integer ID of the new record row.

AfterDeleteRecordRow (Core)

This event is triggered after a record row has been deleted.

Parameters:
modelid:integer ID of the changed model. **instid : integer **ID of the changed instance (owner of the record). attrid : integer ID of the RECORD attribute. pos : integer Position of the new row (1 = first).

BeforeCreateModel (Core)

This event is triggered before a model is created. The parameter threadid (type: INTEGER) provides the ID of the model thread, modelname (type: STRING) the model name, version (type: STRING) the version number and origin (type: STRING) the origin of the new model ("new" - "saveas-new"). Exit Values The Event Handler returns one of these values: 0 - no abortion,-1 - abortion without error, -2 - abortion with error, >0 - abort with core error code.

BeforeCreateRelationInstance (Core)

This event is triggered before a relation (connector) is created. The parameter frominstid (type: INTEGER) provides the ID of the "from" instance, toinstid (type: INTEGER) the ID of the "to" instance, relationclassid (type: INTEGER) The ID of the relation class and componentid (type: INTEGER) the ID of the affected components (library, model ...). Exit Values The Event Handler returns one of these values: 0 - no abortion,-1 - abortion without error, -2 - abortion with error, >0 - abort with core error code.

BeforeDeleteAPVersions (Core)

This event is triggered before attribute profiles are deleted. The parameter apversioids (type: STRING) is a container that stores all the IDs of the attribute profiles waiting for deletion. Exit Values The Event Handler returns one of these values: 0 - no abortion,-1 - abortion without error, -2 - abortion with error, >0 - abort with core error code.

BeforeDeleteInstance (Core)

This event is used before an "instance" (object, record row or attribute profile) is deleted. The parameter instid provides the ID of the deleted instance, classid the class of the instance and modelid the ID of the affected model. Exit Values The Event Handler returns one of these values: 0 - no abortion,-1 - abortion without error, -2 - abortion with error, >0 - abort with core error code.

BeforeDeleteModel (Core)

This event is triggered before a model is deleted. The parameter modelid provides the ID of the affected model. Exit Values The Event Handler returns one of these values: 0 - no abortion,-1 - abortion without error, -2 - abortion with error, >0 - abort with core error code.

BeforeDiscardInstance (Core)

This event is triggered before an instance (object, table cell or attribute profile) is discarded. The parameter instid provides the ID of the instance, classid the class, which belongs to the instance and modelid the ID of the affected model. Rarely used are the parameters realinstanceid (the core-internal ID of the instance) and realclassid (the core-internal ID of the class). Exit Values The Event Handler returns one of these values: 0 - no abortion,-1 - abortion without error, -2 - abortion with error, >0 - abort with core error code.

BeforeDiscardModel (Core)

This event is triggered before a model is discarded. The parameter modelid contains the ID of the affected model.

BeforeSaveModel (Core)

This event is triggered before a model is saved. The parameter modelid contains the ID of the affected model. The origin of the call is stored in the parameter origin . The possible forms are "new" ("Model" - "New"), "saveas-new" ("Model" - "Save as" Part 1), "save" ("Model" - "Save") and "saveas-save" ("Model" - "Save as" Part 2). Exit Values The Event Handler returns one of these values: 0 - no abortion,-1 - abortion without error, -2 - abortion with error, >0 - abort with core error code.

ChangeRelationInstanceFromEndpoint (Core)

This event is triggered when the from instance of a relation was changed. The parameter componentid contains the ID of the affected component (Model, Library...), relationinstanceid the ID of the relation, oldfrominstanceid the ID of the original from-instance and newfrominstanceid the ID of the new from-instance of the relation.

ChangeRelationInstanceToEndpoint (Core)

This event is triggered when the to instance of a relation was changed. The parameter componentid contains the ID of the affected component (Model, Library...), relationinstanceid the ID of the relation, oldtoinstanceid the ID of the original to-instance and newtoinstanceid the ID of the new to-instance of the relation.

CreateApplicationModel (Core)

This event is triggered after an application model was created. The parameter appmodelid (appmodid) contains the ID of the new application model, appmodelname (appmodname) the name of the new application model and onthread a bool flag whether the application model was defined on threads (only for the Human Resource Management Component) or versions (default).

CreateAPThread (Core)

This event is triggered after an AttrProf thread was created. The parameter apdirid contains the ID of the AttrProf directory in which the thread was created, apthreadid the ID of the new thread and apthreadname the name of the thread.

CreateAPVersion (Core)

This event is triggered after an AttrProf version was created. The parameter apthreadid contains the ID of the AttrProf thread to which the version was attached, apversionstr the version string of the newly created AttrProf version and apversionid the ID of the new AttrProf version.

CreateInstance (Core)

This event is triggered after an instance was created. The parameter modelid contains the ID of the affected model, classid the ID of the class of the new object, realclassid the core-internal ID of the class, instid the ID of the new instance and realinstanceid the core-internal ID of the instance.

CreateMGroup (Core)

This event is triggered after a model group was created. The parameter mgroupid contains the ID of the new model group, supermgroupid the ID of the new group's parent and mgroupname the name of the new group.

CreateModel (Core)

This event is triggered after a model was created (also at the model import), but before the model window is visible. The parameter modelid contains the ID of the new model.

CreateModelRef (Core)

This event is triggered after a model (thread) was added to a model group. The parameter mgroupid contains the ID of the model group in question, threadid the ID of the model thread and modelrefid the ID of the reference going from the model group to the model thread.

CreateRelationInstance (Core)

This event is triggered after a new relation was created. The parameter componentid contains the ID of the affected component, relationinstanceid the ID of the affected relation, relationclassid the ID of the new relation's class, frominstanceid the ID of the from-instance of the relation and toinstanceid the ID of the to-instance of the new relation.

DeleteApplicationModel (Core)

This event is triggered after an application model was deleted. The parameter appmodelid (appmodid)contains the ID of the deleted application model.

DeleteAPVersion (Core)

This event is triggered after an attribute profile version was deleted. The parameter apversionid contains the ID of the deleted attribute profile, apclassid the class ID of the deleted attribute profile and name the name of the deleted attribute profile.

DeleteInstance (Core)

This event is triggered after an "instance" (modelling object, record row, attribute profile) was deleted. The parameter instid contains the ID of the deleted instance, classid the class ID of the deleted instance, name the name of the instance and modelid the ID of the deleted instance's model.

DeleteMGroup (Core)

This event is triggered after a model group was deleted. The parameter mgroupid contains the ID of the deleted model group.

DeleteModel (Core)

This event is triggered after a model was deleted. The parameter modelid contains the ID of the deleted model.

DeleteModelRef (Core)

This event is triggered after a model (thread) was removed from a model group. The parameter mgroupid contains the ID of the model group, threadid the ID of the model thread and modelrefid the ID of the reference going from the model group to the model thread.

DeleteModelThread (Core)

This event is triggered after a model thread was deleted. The parameter threadid contains the ID of the deleted model thread.

DeleteRelationInstance (Core)

This event is triggered after a relation was deleted. The parameter componentid contains the ID of the concerned component (model, library,...) relationinstanceid the ID of the relation in question, relationclassid the ID of the deleted relation's class, frominstanceid the ID of the from-instance of the relation and toinstanceid the ID of the to-instance of the deleted relation.

DiscardInstance (Core)

This event is triggered after an "instance" (modelling object, record row, attribute profile) was discarded. The parameter instid contains the ID of the discarded instance classid the ID of the discarded instance's class, name the name of the discarded instance, modelid the ID of the discarded instance's model, realinstanceid the core-internal ID of the instance and realclassid the core-internal ID of the instance's class.

DiscardModel (Core)

This event is triggered after a model was discarded. The parameter modelid contains the ID of the affected model.

DiscardRelationInstance (Core)

This event is triggered after a relation instance was discarded. The parameter relninstid contains the ID of the discarded relation instance and componentid the ID of the concerned component (model, library,...) .

EndUpdateAttrProfs (Core)

This event is triggered after the AttrProf list was updated. This Event Handler has no parameters.

EndUpdateModels (Core)

This event is triggered after the model list was refreshed successfully. This Event Handler has no parameters.

MoveMGroup (Core)

This event is triggered after a model group has been moved from its original parent model group into another model group. The parameter mgroupid contains the ID of the moved model group, oldsupermgroupid the ID of the group's old parent and newsupermgroupid the ID of the new parent.

MoveModelRef (Core)

This event is triggered after a model (thread) has been moved from one model group to another model group. The parameter modelrefid contains the ID of the moved model reference and newmgroupid the ID of the new model group.

OpenModel (Core)

This event is triggered after a model has been loaded but_before_ the model window is created. The parameter modelid contains the ID of this model.

RenameApplicationModel (Core)

This event is triggered after an application model was renamed. The parameter appmodelid contains the ID of the renamed application model, oldname the application model's old name and newname the new name.

RenameAttrProf (Core)

This event is triggered after an attribute profile was renamed. The parameter apthreadid contains the ID of the attribute profile thread, oldname the attribute profile thread's old name and newname the new name.

RenameInstance (Core)

This event is triggered after an "instance" (modelling object, record row, attribute profile) was renamed. The parameter instid contains the ID of the renamed instance, oldname the instance's old name and newname the new name.

RenameMGroup (Core)

This event is triggered after a model group was renamed. The parameter mgroupid contains the ID of the renamed model group and mgroupname the new name.

RenameModelThread (Core)

This event is triggered after a model (thread) was renamed. The parameter modelthreadid contains the ID of the renamed model thread, oldname the model's old name, newname the new name and external a boolean value: 0 - the model thread was renamed by the active user, 1 - the model thread's name changed when refreshing the model list (the model was renamed by a different user).

SaveLibrary (Core)

This event is triggered after a library was saved. The parameter libid contains the ID of the affected libary. Note: This event also happens when an attribute profile was changed!

SaveModel (Core)

This event is triggered after a model was saved. The parameter modelid contains the ID of the renamed model thread and origin the origin of the save action-call: "new" ("Model" - "New"), "saveas-new" ("Model" - "Save as" Part 1), "save" ("Model" - "Save"), "saveas-save" ("Model" - "Save as" Part 2).

Attention

Be careful with changes in this event handler if AutoSave is enabled - many changes could cause a recursion!

SetAttributeValue (Core)

This event is triggered when an attribute value has been changed. The parameter instid (integer) contains the ID of the affected instance, attrid (integer) the ID of the modified attribute, modelid (integer) the ID of the model containing the modified instance, attrtypeid (integer) the attribute type code: 0=INTEGER, 1=DOUBLE, 2=STRING, 3=DISTRIBUTION, 4=TIME, 5=ENUMERATION, 6=ENUMERATIONLIST, 7=CORE_LONGSTRING, 8=PROGRAMCALL, 9=INTERREF, 10=EXPRESSION, 11=RECORD, 12=ATTRPROFREF, 13=DATE, 14=DATETIME and oldval (string) the original (core-internal) value as string.

SetModelVersion (Core)

This event is triggered after the version number of a model has been changed. The parameter modelversionid contains the ID of the renamed model, oldver the old version number and newver the new version number. Note: This event is only triggered in time-based versioned application libraries.

StartUpdateAttrProfs (Core)

This event is triggered before the AttrProf list is updated. This Event Handler has no parameters.

StartUpdateModels (Core)

This event is triggered before the model list is refreshed. This Event Handler has no parameters.

Drawing ​

AfterAutoConnect (Drawing)

This event is triggered by the model editor after auto-connectors have been created or deleted.

AfterBuildGrModel (Drawing)

This event is triggered after a graphical model has been (re)built.

AfterUpdateGrObjects (Drawing)

???

BeforeBuildGrModel (Drawing)

This event is triggered before a graphical model is being (re)built.

Import/Export Events ​

EndADLImport (Import/Export)

This event is triggered after the ADL import is finished. The parameter successful contains a bool flag: 1 - import completed successfully, 0 - error occurred.

StartADLImport (Import/Export)

This event is triggered before the ADL import starts. This Event Handler has no parameters.

Modeling Events ​

ActivateModelWindow (Modeling)

This event is triggered after a model window has been activated. The parameter modelid (integer) contains the model ID of the activated model window. Note: If switching between windows, the first event is always_DeactivateModelWindow_, then followed by ActivateModelWindow.

AfterCreateModelingConnector (Modeling)

This event is triggered after a new connector is inserted into a model in the modelling editor. The parameter modelid contains the model ID of the modified model, objid the ID of the newly inserted instance, classid the ID of this instance's class, fromobjid the ID of the from-object of the new connector, toobjid the ID of the new connector's target object and origin one of these numeric values: 0 - the connector was modelled by the user, 1 - the connector was pasted (copy-paste or cut-paste), 2 - the connector was re-established via "undo".

AfterCreateModelingNode (Modeling)

This event is triggered after a new instance is inserted into a model in the modelling editor. The parameter modelid contains the model ID of the modified model, objid the ID of the newly inserted instance, classid the ID of this instance's class and origin one of these numeric values: 0 - the object was modelled by the user, 1 - the object was pasted (copy-paste or cut-paste), 2 - the object was re-established via "undo".

AfterCreateModelWindow (Modeling)

This event is triggered after a new model window was created in the modelling editor. The parameter modelid contains the model ID of the model in question.

AfterDiscardModelWindow (Modeling)

This event is triggered after a model window was closed in the modelling editor. The parameter modelid contains the model ID of the model in question.

AfterEditAttributeValue (Modeling)

This event is triggered after an attribute value was edited in a notebook, the tabular view, or a quick-edit field on the drawing area. The parameter instid contains the model ID of the modified instance, attrid the ID of the changed attribute, modelid the ID of the model containing the modified instance and attrtypeid the attribute type code: 0=INTEGER, 1=DOUBLE, 2=STRING, 3=DISTRIBUTION, 4=TIME, 5=ENUMERATION, 6=ENUMERATIONLIST, 7=CORE_LONGSTRING, 8=PROGRAMCALL, 9=INTERREF, 10=EXPRESSION, 11=RECORD, 12=ATTRPROFREF, 13=DATE, 14=DATETIME. Note: This event is similar to SetAttributeValue. The difference is, that attribute value changes which are not initiated by the user, e.g. via import, trigger a SetAttributeValue event, but not an AfterEditAttributeValue event. If both applies, AfterEditAttributeValue event is always triggered later than the corresponding SetAttributeValue event..

AfterExtSetVariant (Modeling)

This event is triggered after a variant has been activated via the modeling component. Via the modeling component means that together with the variant activation a related layout algorithm may have been executed. The parameter modelid contains the model ID of the changed model, newvariant the name of the new variant, oldvariant name of the old variant layalgname the language independent name of the executed layout algorithm and layalguiname the language independent name of the executed layout algorithm. Note: If the variant has been activated without automatically execute a layout algorithm (e.g. because the variant does already contain some object positions), the variables layalgname and layalguiname are set to empty strings.

AfterScrollDrawingArea (Modeling)

This event is triggered after the drawing area has been scrolled. The parameter modelid (integer)Model ID of the scrolled drawing area.

BeforeCreateModelWindow (Modeling)

This event is triggered before a new model window is created in the modelling editor. The parameter modelid contains the ID of the model in question.

BeforeDiscardModelWindow (Modeling)

This event is triggered before a model window of the modelling editor is closed. The parameter modelid contains the ID of the model in question.

BeforeExtSetVariant (Modeling)

This event is triggered before a variant is being activated via the modeling component.

DeactivateModelWindow (Modeling)

This event is triggered after a model window has been deactivated. The parameter modelid (integer) contains the ID of the deactivated model. Note: If switching between windows, the first event is always_DeactivateModelWindow_, then followed by ActivateModelWindow.

MOCTimer (Modeling)

This event is triggered periodically each 55ms while the application is in idle state.

PrintModel (Modeling)

This event is triggered before printing a model. The parameter modelid contains the ID of the model in question.

UpdateActions (Modeling)

This event happens, when a menu is updated, e.g. while opening/activating/closing a model window or while saving. The parameter modelid contains the ID of the active model window. Note: If there is no active window, then modelid has a value of -1.

Simulation Events ​

ShowSim1PathResult (Simulation)

This event is triggered after the button "Path Results" was hit in the path analysis result window. The parameter simpath contains an ID string with all objects and connectors in the current path (IDs from the same model are always grouped), pathprob the probability of the current path, pathcycletime the cycle time of the current path in seconds and simruns the number of simulation runs. The variable return should be set by the event handler. If it is set to 0 (default) the standard simulation result window will be displayed (and the path will be marked in the model window). If it is set to 1 the standard behaviour will not be executed.

SimulationEnded (Simulation)

This event is triggered when the path analysis has ended.