Triggers are way to run logic when a file changes. This is handy when you want to do things like auditting or updating another service when the data changes.
You have the option of creating a trigger than runs before or after the data is written and you can watch for inserts, updates or deletes. It's a powerful feature but it also has some drawbacks.
The major drawback is that the trigger routine is cataloged into the global catalog and so all trigger programs are available everywhere.
The other drawback is that if you make a change to a trigger subroutine, you then need to drop the trigger and add it back.
The solution to both these problems is to write a single trigger subroutine that then calls a dispatcher routine inside each account. This way you have a stable trigger that you need need to update meaning that you don't need to drop and re-add triggers anytime you want to update the logic.
Each account will have it's own dispatcher that you can then update as you please.
The flow is thus:
FILE.TRIGGER -> FILE.TRIGGER.DISPATCHER -> TRIGGER.SUBROUTINE
The FILE.TRIGGER is a 1 line program that calls the FILE.TRIGGER.DISPATCHER. The trigger parameters are passed to the dispatcher.
Only the FILE.TRIGGER is ICATALOGed into the global catalog and once it's done, the goal is to never update this program. This way you won't need to drop and re-add the trigger.
The FILE.TRIGGER.DISPATCHER can then call different routines, for example you may want to do an audit and also an update to another service. You could write them in the dispatcher routine or you can write 2 seperate programs that get called from the dispatcher.