Contact us to schedule a demo or ask a question to learn how AdvantageCS can help you.



As of revision 2008R2, Advantage calls a process notification procedure at the end of every process request and can be set up to send a variety of notifications, as you choose. Process_Notification.cap should be put in your advantage\local\custom_cli folder and then modified based on the types of notification desired.

When modifying the capsule, place the notification command before the RETURN TRUE line in the boolean Notify procedure. Remember, any capsules must be declared before using them.

// Called when a process ends
DEFINE BOOLEAN NOTIFY( // Status. FALSE on failure
CHARACTER 8 REQ_NAME, // Request name
DATE START_DATE, // date when the process started
CHARACTER 8 START_TIME, // time when the process started
CHARACTER 1 TYPE, // Type of the process (P or J)
CHARACTER 1 STATUS, // Status (D, E, etc.)
CHARACTER 8 JSM_NAME, // Report name
INTEGER USE_TIME) // Number of minutes that the request was active
// Place custom notification here.
RETURN TRUE
END-DEFINE

Possible Notifications:

  •  Did the process end in error or warning? If so, send an email to the sysadmin:
    CAPSULE EMAIL EMAIL
    IF STATUS = 'E' THEN
    EXEC EMAIL.SEND('admin@yourcompany.com', 'Admin', REQ_NAME & ' has errored', REQ_NAME & ' has errored out - Please investigate.')
    ELSE-IF STATUS ='W' THEN
    EXEC EMAIL.SEND('admin@yourcompany.com', 'Admin', REQ_NAME & ' has ended in warning', REQ_NAME & ' has had an abnormal ending.')
    END-IF
  •  Did the process run longer than normal? If so, send an email to the sysadmin:
    CAPSULE EMAIL EMAIL
    IF USE_TIME > 300 THEN
    EXEC EMAIL.SEND('admin@yourcompany.com', 'Admin', REQ_NAME & ' - Long runtime', REQ_NAME & ' ran for ' & USE_TIME & ' minutes.')
    END-IF
  • When the process completes, run a custom .BAT file:
    IF REQ_NAME = 'ARP310' THEN
    MOVE "%CLIUTLLOC%/INVOICES.BAT " & REQ_NAME to SYSTEM_COMMAND SYSTEM SYSTEM_COMMAND '' LOG 104
    END-IF
  • When the process completes, run a SQL statement.
    IF REQ_NAME = 'PRO310' THEN
    MOVE "%CLIUTLLOC%/PICK_TICKET.BAT " & REQ_NAME to SYSTEM_COMMAND SYSTEM SYSTEM_COMMAND '' LOG 104
    END-IF
  • Send an email to the CIRC manager when the CIR410 finishes.
    IF REQ_NAME = 'CIR410' THEN
    EXEC EMAIL.SEND('cirmgr@yourcompany.com', 'Circ Mgr', 'CIR410', 'CIR410 has completed.')
    END-IF
  • Send an email when a specific job stream finishes (where CDSEND is last process in job stream).
    IF JSM_NAME = 'ARPNITE' AND REQ_NAME = 'CDSEND' THEN
    EXEC EMAIL.SEND('admin@yourcompany.com', 'Admin', JSM_NAME & ' completed', JSM_NAME & ' has completed.')
    END-IF


Filed under: The Molly Minute