The returned list is used to access the notifications so that they can be presented to the User. By default, the returned notifications are listed in reverse chronological order, from newest to oldest. This can occasionally result in lower-priority notifications being presented first, as opposed to the originating notification, which may be of higher priority.
Note that the optional parameter for this method is case-insensitive, and will automatically be trimmed of leading or trailing whitespace. If the parameter is unrecognized, a runtime exception error will be thrown.
@session::getNotifications([String order])
(String) order: specifies the order in which the notifications are returned (optional); this parameter can be one of the following values:
(List) List of notification IDs
The following example illustrates how to modify the default scripts to access the notifications in a different order:
main:
@recipient = @interaction::getRecipient($targetName)
@phone::setLanguage($recipient.language)
@session = @interaction::createUserSession($targetName)
$notificationIds = @session::getNotifications("INITIATING_NEWEST")
FOR ($notId : $notificationIds )
$contextResult = @interaction::retrieveInteractionContext($notId)
IF ($contextResult)
@interaction::runInteractionScript(@script, @session, @recipient, @phone)
ENDIF
ENDFOR
@phone::play("phrase", "goodbye")
@phone::hangup()
exit