Creating a response handler

Even though this is a one-way message, a “response handler” is still needed, in order for xMatters to provide feedback once a notification is delivered.  

To create a response handler:
  1. In the Workspace pane, open the "HelloWorld" workspace and the script package denoted as Production.
  2. In the Workspace pane, right-click HANDLER, and then select New Script.
  3. In the Script Properties dialog box, in the Name field, type response., and then type a description for the script in the Notes field.
  4. In the Workspace pane, double-click the response script.
  5. Type (or copy and paste) the following code into the response script window to create the script:

##################################################################

#

# Script: HelloWorld/HANDLER/response

#

# This script handles script responses.  

#

##################################################################

#/////////////////////////////////////////////////////////////////# This is the main entry point for this script.  Whenever a

# response event occurs, this script is called.  This will get

# called for EACH recipient.

#/////////////////////////////////////////////////////////////////

main:

 

  # only log information if debug is set

  IF (EXISTS($event.debug))

      @script::log("Response script called with response event " & $response.response_event)

  ENDIF

 

  # has a response has been received?

  IF ( $response.response_event =="SUCCESSFUL_DELIVERY" )

 

    # only log information if debug is set

    IF (EXISTS($event.debug))

      @script::log("Notification was successfully delivered to recipient " & $response.recipient_target)

    ENDIF

 

    # set continue to true (causes HelloWorld/PROCESS/initial

    # to continue)

    $main.continue = TRUE

 

  ENDIF

 

### DONE: main ###

Next topic: Configuring the k

For more information about the possible values for the $response.response_event variable, see .Reserved names generated during notification.