Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
titleCustom Database Trigger Example
collapsetrue
USING Progress.Lang.*.

BLOCK-LEVEL ON ERROR UNDO, THROW.

CLASS Custom.CustomDatabaseTriggerLoadService
  INHERITS Akioma.Swat.Server.Startup.DatabaseTriggerLoadService:	//inherits the existing SWAT implementation

  METHOD PUBLIC OVERRIDE VOID LoadTriggers():
    SUPER:LoadTriggers().	//calls super in case triggers are loaded from SWAT
    
    RUN loadCustomTriggers.p. // procedure to include custom triggers
  END METHOD.
END CLASS.


Override the existing IDatabaseTriggerLoadService service

In order to make use of this new class, we will need to override the default trigger load service in the services.xml file by including the following:

Code Block
titleOverride Trigger Load Service
collapsetrue
<ttServiceLoaderRow>
    <Order>0</Order>
    <ServiceTypeName>Akioma.Swat.Server.Startup.IDatabaseTriggerLoadService</ServiceTypeName>
    <ServiceClassName>Custom.CustomDatabaseTriggerLoadService</ServiceClassName>
</ttServiceLoaderRow>