We are hoping to implement triggers (to catch the rotters who change data
using ED!!!), so are following this with interest.
Our interpretation of that advice was to have a single subroutine called by
all triggers. This single subroutine would all the trigger data, including
reference to the file, to another subroutine which then decided which
trigger action subroutine(s) should be called, probably based on file name.
The trick will be determining the data to be passed from that single
triggers subroutine, and if there are things which can only be done within
the trigger subroutine (so an action code would need to be returned).
Suggestions/comment welcome!
Cheers, Kate
Kate Stanton
Walstan Systems Ltd
4 Kelmarna Ave, Herne Bay, Auckland 1011, New Zealand
Ph: +64 9 360 5310 Fax: +64 9 376 0750 Mobile: +64 21 499 486
Email: [EMAIL PROTECTED]
----- Original Message -----
From: "Bill Haskett" <[EMAIL PROTECTED]>
To: <[email protected]>
Sent: Saturday, October 11, 2008 2:50 AM
Subject: RE: [U2] Universe Triggers
Stuart:
Are you saying one should create a single trigger program like...
MASTER.TRIGGER.U
001 SUBROUTINE MASTER.TRIGGER.U (ExecStat, DictFlag, atFILENAME, atID,
atRECORD)
002 COMMON \trFILES\ TABLE.FV
003 IF FILEINFO(TABLE.FV, 0) = 0 THEN ; ** UD version
004 OPEN '', 'TABLE' TO TABLE.FV ELSE
005 ExecStat = 0 ; ** don't update file
006 RETURN
007 END
008 END
009 READ TriggerRec FROM TABLE.FV, 'TRIGGER.CONF' ELSE RETURN
010 TriggerFiles = TriggerRec<1>
011 TriggerUpdates = TriggerRec<2>
012 TriggerDeletes = TriggerRec<3>
013 LOCATE(atFILENAME, TriggerFiles, 1; Pos) THEN
014 TriggerToRun = TriggerUpdates<1,Pos>
015 CALL @TriggerToRun
016 END
...that essentially reads a table...
TRIGGER.CONF
001 APVENDOR]ARCUSTOMER
002 U2.TRIGGER.SUB.U]U2.TRIGGER.SUB.U
003 U2.TRIGGER.SUB.D]U2.TRIGGER.SUB.D
...for the file and globally cataloged subroutine to run. Then one
should...
CREATE.TRIGGER APVENDOR MASTER.TRIGGER.U UPDATE
CREATE.TRIGGER ARCUSTOMER MASTER.TRIGGER.U UPDATE
CREATE.TRIGGER APVENDOR MASTER.TRIGGER.D DELETE
CREATE.TRIGGER ARCUSTOMER MASTER.TRIGGER.D DELETE
Thanks,
Bill
<snip>
-------
u2-users mailing list
[email protected]
To unsubscribe please visit http://listserver.u2ug.org/