The CALL.ALARM object is a ready-for-use notification that writes particular data to a message text by using a script.
When you create a new Notification object, you can choose between two different types: STANDARD and ALARM.
Both types are notifications and differ from each in that the ALARM-type notification already includes a ready-for-use AE Script that reads data and outputs it in the message text. The user who executes this object is automatically specified as the receiver. Type "Alert" and "High" priority are always specified in ALARM notifications.
A complete AE Script ensures that the CALL.ALARM object can be executed immediately after it has been created because the receiver is automatically the user who has started the Notification object. Dynamic values, such as the name of the causing task, its RunID, etc. are retrieved and output in the message text. The script outputs the message text in the required language.
Examples:
Retrieving the user who has started the object plus the corresponding departmentDepartment name to which the Automation Engine user belongs..
:ADD_ATT can be used to add this user as a receiver. Therefore, you can also process CALL.ALARM objects even without specifying a receiver.
!Get Operator
:set &userid# = SYS_USER_NAME
:set &dep# = SYS_USER_DEP
:ADD_ATT OPERATOR, '&userid#/&dep#'
!
Retrieving the name, RunID, status and return code of the task that triggered the Notification object. Additional information is available here: Notification - Execution.
!Get Script
:read &UC_CAUSE_NAME,,
:read &UC_CAUSE_NR,,
:read &UC_CAUSE_STATE,,
:read &UC_CAUSE_RETCODE,,
!
:set &nl# = UC_CRLF
!
Retrieving the name, RunID and object type of the superordinate task that has activated the Notification object. Additionally, the AE system name, client number, time and date of activation, and the language are queried. The script element GET_MSG_TEXT() supplies the status text of the task that caused the notification to start.
:set &parentname# = SYS_ACT_PARENT_NAME('ACT')
:set &parentnr# = SYS_ACT_PARENT_NR('ACT')
:set &parenttyp# = SYS_ACT_PARENT_TYP('ACT')
:set &system# = GET_UC_SYSTEM_NAME
:set &client# = SYS_ACT_CLIENT
:set &date# = SYS_DATE_PHYSICAL()
:set &time# = SYS_TIME_PHYSICAL("HH:MM:SS")
:set &lang# = SYS_USER_LANGUAGE
:set &statustext# = get_msg_txt(&UC_CAUSE_STATE,'')
!
After a language check, the retrieved information is written to the message text in German, English or French using the script element :PUT_ATT or :PUT_ATT_APPEND.
:if &lang# = 'E'
!: put_att SUBJECT = "Alarm:'&UC_CAUSE_NAME' RunID:'&UC_CAUSE_NR' Client:'&client#'
: set &date# = conv_date(&date#,"MM/DD/YYYY")
: PUT_ATT CALL_TEXT = "An error occurred! &nl# &nl#"
: put_att_append CALL_TEXT = "AE system: &system# &nl#"
: put_att_append CALL_TEXT = "Client: &client# &nl#"
: put_att_append CALL_TEXT = "Object: &UC_CAUSE_NAME &nl#"
: put_att_append CALL_TEXT = "Run#: &UC_CAUSE_NR &nl#"
: put_att_append CALL_TEXT = "State Text: &statustext# (&UC_CAUSE_STATE) &nl#"
: put_att_append CALL_TEXT = "Retcode: &UC_CAUSE_RETCODE &nl#"
: put_att_append CALL_TEXT = "Date/Time: &date# &time# &nl# &nl#"
: put_att_append CALL_TEXT = "Parent of this object (if available): &nl# &nl#"
: put_att_append CALL_TEXT = "Parent: &parentname# &nl#"
: put_att_append CALL_TEXT = "Type: &parenttyp# &nl#"
: put_att_append CALL_TEXT = "Run#: &parentnr# &nl#"
:endif
:if &lang# = 'D'
!: put_att SUBJECT = "Alarm:'&UC_CAUSE_NAME' RunID:'&UC_CAUSE_NR' Client:'&client#'
: set &date# = conv_date(&date#,"MM/DD/YYYY")
: PUT_ATT CALL_TEXT = "Ein Fehler ist aufgetreten! &nl# &nl#"
: put_att_append CALL_TEXT = "AE system: &system# &nl#"
: put_att_append CALL_TEXT = "Mandant: &client# &nl#"
: put_att_append CALL_TEXT = "Objekt: &UC_CAUSE_NAME &nl#"
: put_att_append CALL_TEXT = "Run#: &UC_CAUSE_NR &nl#"
: put_att_append CALL_TEXT = "Status: &statustext# (&UC_CAUSE_STATE) &nl#"
: put_att_append CALL_TEXT = "Retcode: &UC_CAUSE_RETCODE &nl#"
: put_att_append CALL_TEXT = "Datum/Zeit: &date# &time# &nl# &nl#"
: put_att_append CALL_TEXT = "Parent dieses Objektes (wenn vorhanden): &nl# &nl#"
: put_att_append CALL_TEXT = "Parent: &parentname# &nl#"
: put_att_append CALL_TEXT = "Typ: &parenttyp# &nl#"
: put_att_append CALL_TEXT = "Run#: &parentnr# &nl#"
:endif
:if &lang# = 'F'
!: put_att SUBJECT = "Alarm:'&UC_CAUSE_NAME' RunID:'&UC_CAUSE_NR' Client:'&client#'
: set &date# = conv_date(&date#,"MM/DD/YYYY")
: PUT_ATT CALL_TEXT = "Une erreur s'est produite! &nl# &nl#"
: put_att_append CALL_TEXT = "AE system: &system# &nl#"
: put_att_append CALL_TEXT = "Client: &client# &nl#"
: put_att_append CALL_TEXT = "Objet: &UC_CAUSE_NAME &nl#"
: put_att_append CALL_TEXT = "Run#: &UC_CAUSE_NR &nl#"
: put_att_append CALL_TEXT = "Statut: &statustext# (&UC_CAUSE_STATE) &nl#"
: put_att_append CALL_TEXT = "Retcode: &UC_CAUSE_RETCODE &nl#"
: put_att_append CALL_TEXT = "Date/Heure: &date# &time# &nl# &nl#"
: put_att_append CALL_TEXT = "Parent de cet objet (si disponible): &nl# &nl#"
: put_att_append CALL_TEXT = "Parent: &parentname# &nl#"
: put_att_append CALL_TEXT = "Type: &parenttyp# &nl#"
: put_att_append CALL_TEXT = "Run#: &parentnr# &nl#"
:endif
See also:
Getting Started - Notifications
Notification - Execution