...
Code Block |
---|
title | Custom Database Trigger Example |
---|
collapse | true |
---|
|
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 |
---|
title | Override Trigger Load Service |
---|
collapse | true |
---|
|
<ttServiceLoaderRow>
<Order>0</Order>
<ServiceTypeName>Akioma.Swat.Server.Startup.IDatabaseTriggerLoadService</ServiceTypeName>
<ServiceClassName>Custom.CustomDatabaseTriggerLoadService</ServiceClassName>
</ttServiceLoaderRow> |