guides:programming:programmers_reference_manual:promoted_events_and_the_repository

Promoted Events and the Repository

One of the most powerful programming features of OpenInsight is the "Promoted Event" model, allowing you to write "global" event handling code that can be triggered for a variety of situations, such as for all objects of a certain type, or for all objects in an application. This helps to centralize your code-base and restrict unnecessary duplication, thereby making development faster and more robust.

However, promoted events have also been one of the most opaque parts of the system and their use is somewhat awkward and error-prone because they rely on the dark art of naming conventions and manual record copying between tables. In an effort to rectify this we have integrated them into the OpenInsight Repository so they can be tracked properly and you can see at a glance exactly what is in your system.

Promoted events fall into on of 5 generic categories:

CategoryExample SYSREPOSEVENTS key
1) EVENT/CLASS/TYPE specificSYSPROG*ACTIVATED.WINDOW.OIWIN
2) EVENT/TYPE specificSYSPROG*ACTIVATED..OIWIN*
3) TYPE specificSYSPROG*..OIWIN*
4) EVENT/CLASS specificSYSPROG*ACTIVATED.WINDOW*
5) EVENT specificSYSPROG*ACTIVATED

So to enable their integration we have added three new entity types:

  • PROMOTEDEVENT (source code)
  • PROMOTEDEVENTDBG (debugger symbol table)
  • PROMOTEDEVENTEXE (object code)

Each of these type has a Repository key structure that derives from the actual promoted event key itself:

SYSREPOSEVENTS keyRepository key
SYSPROG*ACTIVATED.WINDOW.OIWIN*SYSPROG*PROMOTEDEVENT*ACTIVATED*WINDOW.OIWIN
SYSPROG*ACTIVATED..OIWIN*SYSPROG*PROMOTEDEVENT*ACTIVATED*_.OIWIN
SYSPROG*..OIWIN*SYSPROG*PROMOTEDEVENT*_*.OIWIN
SYSPROG*ACTIVATED.WINDOW*SYSPROG*PROMOTEDEVENT*ACTIVATED*WINDOW
SYSPROG*ACTIVATED*SYSPROG*PROMOTEDEVENT*ACTIVATED*_

Some of you may look twice at the use of the "_" character for the CLASSID and ENTID Repository key parts: This is actually used as a placeholder to denote a null part in the promoted event key itself - their use is necessary because the Repository reacts poorly to a null CLASSID or ENTID.

We have also added a new stored procedure called SYNCH_REPOR_PROMOTED_EVENTS which can scan your SYSREPOSEVENTS and SYSPREOSEVENTEXES tables to create any missing entities so it is easy to bring your existing promoted events into the Repository.

  • guides/programming/programmers_reference_manual/promoted_events_and_the_repository.txt
  • Last modified: 2023/10/25 10:50
  • by 127.0.0.1