
Using EMS
Using Programmatic Interfaces
7–14
107365 Tandem Computers Incorporated
Figure 7-3. Generating an EMS Event (Page 2 of 3)
== Build the event and initialize the EMS buffer
[#SET evt_error [#EMSINIT evt_buf [ZEMS^VAL^EXTERNAL^SSID]
[evt_num] ZEMS^TKN^TEXT [#charcount evt_text]
[evt_text]]
]
[#IF [evt_error] |THEN|
#OUTPUT *ERROR* EMSINIT error [evt_error]
#RETURN
]
== If emphasis is TRUE, set the CRITICAL flag
[#IF [emphasis] |THEN|
#SET evt_error [#SSPUT evt_buf ZEMS^TKN^EMPHASIS &
[ZSPI^VAL^TRUE]]
[#IF [evt_error] |THEN|
#OUTPUT *ERROR* SSPUT error [evt_error] on &
Emphasis token
#RETURN
] == End IF
] == End IF
== If action is TRUE, set the ACTION-NEEDED flag
[#IF [action] |THEN|
#SET evt_error [#SSPUT evt_buf ZEMS^TKN^ACTION^NEEDED &
[ZSPI^VAL^TRUE]]
[#IF [evt_error] |THEN|
#OUTPUT *ERROR* SSPUT error [evt_error] on &
Action-Needed token
] == End IF
== SET the action-ID token to a unique value
#SET evt_error [#SSPUT evt_buf ZEMS^TKN^ACTION^ID
[action_id]]
[#IF [evt_error] |THEN|
#OUTPUT *ERROR* SSPUT error [evt_error] on Action-ID
#RETURN
|ELSE| #SET action_id [#COMPUTE act 1]
]
]
== Send the event buffer to the Collector
#APPENDV req_prompt evt_buf
#UNFRAME
] == End of build_evt