Operator Message Examples

This topic provides examples of various types of Operator Message.

Chain Example

In this example, an Operator Message is generated by a Chain named EMEA_SALES_RUN after it reached status Error, as defined in its default Status Handler. The operator navigates to the Operator Messages monitor and sees an Operator Message with the following information:

  • Creation Time: 3:17:34 PM.
  • Title Text: Choose restart option.
  • Reply Status: Required.
  • Reply: None yet.

The operator selects the message, and the Operator Message detail pane displays the following data.

  • Full Text: Choose restart option.
  • Reply Status: Required.
  • Sender Object: EMEA_SALES_RUN_STEP_3.
  • Creation Time: 3:17:34 PM.
  • Last Modification Time: 3:17:34 PM.

The operator now knows that a Chain Process in Step 3 reached status Error at 3:17:34 PM today. The Step contains the name of the Chain Definition, so the operator knows it is the EMEA_SALES_RUN Chain that failed.

The operator would like to know what happened, so they select the Sender Object EMEA_SALES_RUN_STEP_3. After examining the log file, the operator finds that the SAP System is down for emergency maintenance. The operator returns to the Operator Messages monitor once the SAP System is live again, and chooses Reply from the context menu of the Operator Message.

The operator chooses the following:

  1. Action: Restart.
  2. Restart: Entire Step.
  3. When: Hold Restarted Step.

The operator sees the following in the Operator Message Detail View:

  • Full Text: Choose restart option.
  • Reply Status: Replied.
  • Sender Object: EMEA_SALES_RUN_STEP_3.
  • Creation Time: 3:17:34 PM.
  • Last Modification Time: 3:27:55 PM.

The operator waits for the SAP Basis team to perform the maintenance. Once the SAP system is up again, the operator releases the Step in the Process Monitor.

RedwoodScript Examples

For more information about RedwoodScript, see RedwoodScript.

Creating an Operator Message with a Reply Expression

To create an Operator Message with a reply expression from within RedwoodScript, use code like the following.

Copy
{
  OperatorMessage oMessage = jcsSession.createOperatorMessage();
  oMessage.setPartition(jcsSession.getPartitionByName("GLOBAL"));
  oMessage.setFullText("This Operator Message is a somewhat more complex test");
  oMessage.setReplyExpression("^That was easy.|That was hard.|I don't know how hard that was.$");
  jcsSession.persist();
}

Replying to an Operator Message with RedwoodScript

This example demonstrates how to reply to multiple Operator Messages from within RedwoodScript. Note that this script only handles default Active Monitoring Module Operator Messages. You can retrieve these Operator Messages using the executeObjectQuery() method.

Copy
{
  String query = "select OperatorMessage.* from OperatorMessage";
  for (OperatorMessage oMessage : jcsSession.executeObjectQuery(OperatorMessage.TYPE, query))
  {
    //Check the Operator Message requires a reply
    if (oMessage.getReplyStatus() == ReplyStatus.Required)
    {
      oMessage.setReply("Acknowledge");
      jcsSession.persist();
    }
  }
}

The following example demonstrates how to reply to a Operator Message that uses a reply expression.

Copy
{
  //Query and bind parameter values
  String query = "select OperatorMessage.* from OperatorMessage where OperatorMessage.FirstText = ?";
  String param = "This Operator Message is a somewhat more complex test";

  //Retrieve Operator Message(s) based on full text
  for (OperatorMessage oMessage : jcsSession.executeObjectQuery(OperatorMessage.TYPE, query, new Object[] { param }))
  {
    //Check the Operator Message requires a reply
    if (oMessage.getReplyStatus() == ReplyStatus.Required)
    {
      oMessage.setReply("That was hard.");
      jcsSession.persist();
    }
  }
}

The following example demonstrates how to reply to multiple Operator Messages.

This script does not handle all possible reply expressions (for example, it does not handle \d). It does handle the following:

  • ^<option1>|<option2>[|<option...]$: For example, Chain restart requests, or your own multiple-choice Operator Messages.
  • ^<string>$: Such as ^Acknowledge$, the default Active Monitoring Module Operator Message reply.
  • <string>: Any string, except the characters \ and | are prohibited.
Copy
{
  String query = "select OperatorMessage.* from OperatorMessage";
  for (OperatorMessage oMessage : jcsSession.executeObjectQuery(OperatorMessage.TYPE, query))
  {

    //Check the Operator Message requires a reply
    if (oMessage.getReplyStatus() == ReplyStatus.Required)
    {
      if (oMessage.getReplyExpression().indexOf("^") == 0
          && oMessage.getReplyExpression().indexOf("$") == oMessage.getReplyExpression().length() -1
          && oMessage.getReplyExpression().indexOf("|") > 0)
      {
        //Here you use the first valid answer as a reply, chain Operator Messages (Request Restart) will be rescheduled to Error
        String[] ar = oMessage.getReplyExpression().split("\\|");

        //Here you remove \ as these are used in some built-in reply expressions
        oMessage.setReply(ar[0].replace("^", "").replace("\\", ""));
      }
      else if (oMessage.getReplyExpression().indexOf("^") == 0
               && oMessage.getReplyExpression().indexOf("$") == oMessage.getReplyExpression().length() -1
               && oMessage.getReplyExpression().indexOf("|") == -1)
      {
        //Here you use the only valid answer as a reply
        oMessage.setReply(oMessage.getReplyExpression().replace("^", "").replace("$", ""));
      }
      else if (oMessage.getReplyExpression().indexOf("\\") == -1 && oMessage.getReplyExpression().indexOf("|") == -1)
      {
        //Here you use the reply expression as string, we filter out \ and | to avoid special regex expressions like \d; they should be skipped
        oMessage.setReply(oMessage.getReplyExpression());
      }

      jcsSession.persist();
    }
  }
}

Note: The setReply() method can only be called on persisted Operator Messages.