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 PERSISTENT. // procedure to include custom triggers
  END METHOD.
END CLASS.

...

Code Block
titleloadCustomTriggers.p
collapsetrue
{Custom/Triggers/myCreateTrigger.i}	//here, we just include the desired triggers



Info
titleTrigger
Each trigger can be a separate procedure (.p) - the directory of these triggers needs to be in the PROPATH


Trigger implementation

Inside the trigger itself:

...