Apparatus and method for message matching using pattern decisions in a message matching and automatic response system5794239Abstract A system for automatically responding to character-based messages is disclosed. A pattern database is defined with pattern definitions for matching input messages and response definitions for automatically responding to matching input messages. Patterns definitions include token definitions which define criteria for matching a portion of an input message. The pattern definitions further include pattern decisions that contain logical expressions which increases the flexibility in defining patterns to match messages. The response definitions include function definitions and optional function decisions. Functions to be performed in response to a matching message are specified in the function definitions, wherein performance of the specified functions is dependent upon evaluation of the function decisions. Claims We claim: Description CROSS-REFERENCE
______________________________________
XX/YY//ZZ A:/B C
______________________________________
yields the following tokens:
______________________________________
XX/YY//ZZ
A:/B
C
______________________________________
The Message Processor considers multiple spaces to be a single delimiter (such as between B and C). A delimiter set is a number of delimiter characters that can occur in any order in the message. Assume the following message:
______________________________________
XX/YY//ZZ A:/B C
______________________________________
If a pattern has a delimiter set of {/}, which means a slash or a space, it produces the following tokens:
______________________________________
XX
YY
ZZ A
B C
______________________________________
If two or more delimiters are in a row, they are treated as a single delimiter even if they are separate characters. If a pattern has a delimiter set of {:/}, which means a colon or a slash, the same message yields the following tokens:
______________________________________
XX
YY
ZZ A
B C
______________________________________
A delimiter list is a string of character delimiters that are specified in the order that they appear in the message. Assume the following message:
______________________________________
XX/YY//ZZ A:/B C
______________________________________
If a pattern has a delimiter list of "// " (slash, slash, space, and space), it produces the following tokens:
______________________________________
XX
YY
ZZ
A:/B
C
______________________________________
If a pattern has a delimiter list of"/ :/" (slash, space, colon, and slash), the same message yields the following tokens:
______________________________________
XX
YY//ZZ
A
B C
______________________________________
The delimiters, " ", ":" and "/" are treated as a single delimiter because they occur adjacent to each other with no intervening characters. The delimiter character should be specified only once in the list if it appears in two or more consecutive positions. Tokens are the building blocks of pattern definitions. They are numbered from left to right within a message (1 to n). Assume the default delimiters are spaces and the following message:
______________________________________
THIS IS A MESSAGE
______________________________________
Token number 1 is THIS, token number 2 is IS, token number 3 is A, and token number 4 is MESSAGE. There are four token types: Fixed, Keyword, Masked, and Run-id. Each type is defined below: Fixed: A sting of characters that must match the message token exactly, character for character. Keyword: A special type of fixed token that is the most unique portion of a message. Standard patterns that have one keyword token are most efficient for pattern matching. Nonstandard patterns can be matched more efficiently if a keyword is specified. Masked: Used to match variable data (such as a tape number) within a message. Run-id: A special type of masked token specified when the action must depend on the value of the run-id generating the message. OS-2200 messages have a blank run-id. The following example shows the different token types that could be specified for the following message:
______________________________________
IS TAPE ON drive-name A LABELED TAPE Y, N, REEL
______________________________________
The pattern definition could consist of a fixed token in position 2, a masked token in position 4, and a keyword token in position 6. The word TAPE is a fixed token in position 2 because it always appears that way in the message. The word LABELED is also fixed but it has been chosen to be the keyword token for this message. The word drive-name is a variable word, as shown. If the following message appears:
______________________________________
IS TAPE ON UNIT4 A LABELED TAPE Y,N,REEL
______________________________________
The fourth token would be masked for the purpose of matching the above pattern. Note that if this fourth token was fixed, it would only match UNIT4. (In some cases, this might be desirable). One or more tokens from a message can be referenced with a positive token number or a negative token number. Tokens can be referenced either by their associated token numbers or with the descriptive, predefined variable prefixes, .sub.-- TOKEN and .sub.-- NEGTOKEN. The following example shows how to reference the fourth message token:
______________________________________
.backslash..sub.-- TOKEN4.backslash.
______________________________________
Alternatively, the fourth message token could be referenced this way:
______________________________________
.backslash.4.backslash.
______________________________________
If the token of interest is at or near the end of the text, or if portions of the text vary, use the negative token variable (.sub.-- NEGTOKENn). When negative numbers are used, the tokens are numbered from right to left instead of left to right. The following example shows how to reference the rightmost token:
______________________________________
.backslash..sub.-- NEGTOKEN1.backslash.
______________________________________
Another way to reference the token is by using its token number, as shown in this example:
______________________________________
.backslash.-1.backslash.
______________________________________
Responses Response definitions are interpreted upon the matching of messages and are defined in a Pattern Database in pattern definitions. The response definitions provide the automation in the database to perform such functions as: Update the display of the Automated Operation Console Execute an automated response to a system message Perform changes to the values of variables that have been defined in the database Apply decisions to the execution of functions Variables Variables provide the ability to store information from a message so that it can be retrieved for later use during pattern matching, substitution, and logic processing. Variables provide the ability to do such things as: Store integer and string information Reset the value of a variable after a given period of time Dynamically create variable values at run-time There are two kinds of variables: predefined and user-defined. A number of predefined variables are available to the user and are maintained internally by the Message Processor. In addition, user-defined variables can be explicitly set by the user and need to be defined in the Pattern Database before they can be used. Predefined Variables cannot be set by the user and do not need to be defined before they can be used. The Message Processor 50 supports the use of expressions in pattern matching and response definition. Expressions are a series of operands and operators that whose computation yields a value. Expressions are useful when adding decisions and variables to the action definitions in the Pattern Database 44. Input to Create Pattern Database The input for creating the Pattern Database 44 is a series of commands. The commands are composed of a command name followed by one or more parameters. The parameters may be specified in any order, but they must be separated by spaces or commas. More than one command may be included per line and separated by one or more spaces. Individual commands may be split across input lines by using the backslash (.backslash.) as a continuation character. A space must be included before the backslash, and all characters after the backslash are ignored. In this section, commands and parameters appear in uppercase text, and user-supplied information appears in lowercase italics. Brackets › ! indicate optional parameters. An ellipsis (. . . ) indicates that the preceding parameter may be repeated any number of times. All commands and parameters can be abbreviated as follows: Abbreviated to five characters ELSEIF Abbreviated to four characters CONTINUOUS-DISPLAY CONSTRAINT ENDIF PRIMARY PRIORITY PRIVILEGED-EXEC RESET RESPONSE All other commands and parametersharacters All other commands and parameters The Create Pattern Database software uses strings and sets to group related characters. Strings are denoted by enclosing the characters within quotation marks (" "), while sets are denoted by enclosing them within braces ({ }). There are several special operators that may be use within strings and sets. These operators are always preceded by and usually followed by a backslash (.backslash.):
______________________________________
.backslash..backslash.
______________________________________
indicates one backslash is desired within a string or set. The following operators are for strings only: .backslash. " is used to indicate that a quotation mark is desired within a string. .backslash.*n.backslash. is used within mask strings to indicate the maximum number of optional characters (n is a number from 1 to 255). the asterisk (*) indicates that the string can have 0 to n characters. .backslash.?n.backslash. is used within mask strings to indicate a place-holder character (n is a number from 1 to 255). The question mark (?) indicates that the string must have n characters. .backslash.var-name.backslash. where var-name is the name of a predefined or user-defined variable. The following operators are for delimiter sets only: .backslash.{ indicates a left (open) brace is desired within a set. .backslash.} indicates a right (close) brace is desired within a set. EXAMPLES "apples .backslash..backslash. and oranges .backslash."" The string is interpreted as apples .backslash. and oranges". "TA.backslash.?2.backslash..backslash.*2.backslash." Mask string starting with TA, followed by at least 2 more characters but no more than 4. "RC.backslash..sub.-- RUNID.backslash." Command string using text substitution to create an RC console command using the generated run-id of the message. "RV.backslash.3.backslash." Command string using message token text substitution to generate an RV console command using the third token from the message. {:.backslash.}} A delimiter set containing the character: and }. Comments may be inserted anywhere a space or blank is valid, but not within quoted strings or delimiter sets. Comments begin with /* and end with */. For example /*This is a comment*/ These comments are not saved in the Pattern Database. General Command Layout for Pattern Definitions All pattern definitions begin with the DEFINE command. This command is used to create or redefine a pattern. This command uniquely identifies the message pattern in the database by assigning it a message-id consisting of the group and message number. The following commands show the general syntax for a pattern definition:
__________________________________________________________________________
DEFINE "group" ›message-number!
MESSAGE "message-text"
›TYPE›message-type! ›sender-type. . .! ›TEST! ›VARIABLE-LENGTH!!
›INSTANCE ›instance-type. . .!!
›PRIORITY value!
›DELIMITERS delimiter-spec!
TOKEN ›token-type! number ›"token-text"!
›CONSTRAINT expression!
›ACTION mode action-type "action-text" ›WAIT xx›time-unit!!
›CREATE variable-group-name:member-name!
›DESTROY variable-group-name:member-name!
›SET target-variable = variable-expression!
›RESET target-variable!
IF expression
›actions!
ELSEIF expression
›actions!
ELSE
›actions!
ENDIF
END
__________________________________________________________________________
The DEFINE command begins a message pattern definition. It identifies a unique pattern in a Pattern Database by its group and message number. All pattern definitions must begin with a DEFINE command. The format of the DEFINE command is:
______________________________________
DEFINE "group" ›message-number!
______________________________________
where group is the group-id associated with the message. It must be enclosed within quotation marks. Group-ids cannot contain embedded spaces. Related messages may be grouped together for reporting purposes to support site needs. The groups have no effect on pattern matching. A group-id is from 1 to 12 characters. Group-ids must be specified as strings of ASCII characters. They can contain any printable ASCII character except an embedded space or backslash. THE MESSAGE PROCESSOR removes leading and trailing spaces. A maximum of 256 groups in a database is allowed. A blank or null group-id is not allowed. Examples of group-id are:
______________________________________
"boot-msgs" "cms-msgs"
"mapper"
______________________________________
EXAMPLES DEFINE "eastsite" 2 Defines or replaces a pattern with message number 2 in group-id eastsite. DEFINE "xyz123" A new pattern is added to the group-id xyz123 and the next available message number is automatically assigned. The MESSAGE command is required and must immediately follow the DEFINE command. It defines the text of the input message to be matched. The Create Pattern Database software breaks apart this text into message tokens that the Message Processor uses while searching the database for a pattern match. The Message Processor uses the total number of tokens in the message text as a criterion for matching all standard patterns unless the TYPE command includes VARIABLE-LENGTH. A match does not occur if the number of tokens in the message does not match the total token count of the pattern definition. In addition, the Message Processor cannot match message that are completely blank. Furthermore, the number of tokens defined in MESSAGE must be at least as many as the highest token number that is referenced in the pattern. The format of the MESSAGE command is:
______________________________________
MESSAGE "message-text"
______________________________________
where message-text is a string containing the exact text of the message. The TYPE command is used to specify: The message type Message type distinguishes among READ-AND-REPLY, OTHER, CONTINUOUS-DISPLAY, and SCF messages. Message-type information is used to identify, with greatest efficiency, messages that can cause a response action. The message types READ-AND-REPLY, OTHER, CONTINUOUS-DISPLAY, and SCF are unique to 2200 Series data processing systems. The sender type Sender type is used to identify the type of run that issued the message. Patterns can be associated with one or more sender types. TYPE is useful for preventing unauthorized use of a message. Specifying a sender type of PRIVILEGED-EXEC ensures that a non-privileged user cannot send a matching message that triggers undesirable actions. The sender type PRIVILEGED-EXEC is unique to 2200 series data processing systems and therefore, beyond the scope of the present invention. A test pattern When TEST is specified, the display enhancement and automation actions of the pattern are logged instead of executed. Function decisions and actions on variables are executed and logged. A pattern of variable length TYPE is one of four separate attribute commands: TYPE, PRIORITY, INSTANCE, and DELIMITERS. Default values are used if values are not specified for them. The commands may be specified in any order, but they must follow the MESSAGE command and precede all TOKEN and ACTION commands. The format of the TYPE command is: TYPE ›message-type! ›sender-type . . . ! ›TEST! ›VARIABLE-LENGTH! where message-type is one of the following: READ-AND-REPLY for read-and-reply messages OTHER for read-alert, read-only messages, and the Message Processor internal message for database activation and deactivation CONTINUOUS-DISPLAY for the continuous display data sent by the Exec SCF for system control facility (SCF) messages For the purposes of pattern matching, The Message Processor considers read-alert and read-only messages to be equivalent. The default is OTHER. The sender-type is one of the following: PRIVILEGED-EXEC for messages sent by either the Exec or a privileged run. NON-PRIVILEGED for messages sent by a non-privileged run. ANY-SENDER matches all sender types. TEST is specified for a test pattern. The Message Processor does not perform the actions specified for display enhancement and automation actions; it sends messages to the system log file and displays them on the screen. For function decisions and performing functions on variables the Message Processor executes the actions, and sends messages to the system log file and displays them on the screen. VARIABLE-LENGTH is specified to override the automatic check for total token count in a message. This keyword can be specified for standard patterns with or without keywords; it has no effect on nonstandard patterns. EXAMPLES
______________________________________
DEFINE "tapemsg" 20
MESSAGE "IS TAPE ON unit# A LABELED TAPE Y,N,REEL"
TYPE PRIVILEGED-EXEC READ-AND-REPLY
______________________________________
Message text is defined for read-and-reply message number 20 in group-id tapemsg, sent by either the Exec or a privileged run.
______________________________________
DEFINE "group2"
MESSAGE "THIS IS A USER MESSAGE"
TYPE ANY-SENDER TEST
______________________________________
Message text is defined for a read-alert or read-only message sent by any run. It recognizes this as a test pattern. The INSTANCE command is used to indicate which instance of a read-only or read-alert message should be matched when multiple system consoles are attached to a 2200 Series system. INSTANCE is one of four separate attribute commands: TYPE, PRIORITY, INSTANCE, and DELIMITERS. The default values if values are not specified for them. These attribute commands can be specified in any order, but they must follow the MESSAGE command and precede all TOKEN and ACTION commands. The format of the INSTANCE command is:
______________________________________
INSTANCE ›instance-type...!
______________________________________
where instance-type is one of the following: PRIMARY is the primary instance of the message. ECHO is the secondary or echo instance of the message. ANY-INSTANCE is any instance of the message, primary or echo. The PRIORITY command is used to assign a special priority from 0 to 255 to a pattern. The priority determines the search order of patterns of the same pattern type. The lower the number, the higher the priority. The Message Processor searches the lowest numbers first in the event of a pattern search conflict. The Message Processor search the priority of standard patterns with keywords first, of standard patterns without keywords second, and nonstandard patterns last. The Message Processor stops searching the database after it find a pattern match. PRIORITY is one of four separate attribute commands: TYPE, PRIORITY, INSTANCE, and DELIMITERS. All attributes are optional, and default values are used if values are not specified. The attribute commands may be specified in any order, but they must follow the MESSAGE command and precede all TOKEN and ACTION commands. The format of the PRIORITY command is:
______________________________________
PRIORITY value
______________________________________
where value is the priority associated with the pattern, from 0 (highest priority) to 255 (lowest priority). The default value is 128. Under certain circumstances, the order that the Message Processor searches for patterns becomes important, and the search order can be controlled using pattern priority. Each pattern in the database has an associated priority. For standard patterns, the Message Processor uses this priority to determine the search order for patterns that share a particular keyword. The priority does not affect the order that the Message Processor searches for keywords. The priority is only used after the Message Processor finds a keyword match. If a message matches patterns with different keywords, the priority is not used. The Message Processor searches standard patterns without keywords and nonstandard patterns strictly in order of priority. The search order for standard patterns without keywords and for nonstandard patterns using the same priority value cannot be predicted. The DELIMITERS command specifies the delimiters in a nonstandard pattern. This command is needed only when the Message Processor needs delimiters other than spaces to break a message into tokens. Delimiters may be specified as a list (enclosed in " ") or as a set (enclosed in { }). A DELIMITER list is a string of character delimiters specified in the order in which they appear in the message. A delimiter set is a number of delimiter characters that can occur in any order in the message. If a DELIMITERS command is not used, it is assumed that the pattern is a standard pattern (with spaces as the delimiters). DELIMITERS is one of four separate attribute commands: TYPE, PRIORITY, INSTANCE and DELIMITERS. All commands are optional, and default values are used if commands are not specified. The attribute commands may be specified in any order, but they must follow the MESSAGE command and precede all TOKEN and ACTION commands. The format of the DELIMITERS command is:
______________________________________
DELIMITERS delimiter-spec
______________________________________
where delimiter-spec are the delimiters for the Message Processor to use when breaking up the input message into tokens. If delimiters are specified as a list, they must be enclosed in quotation marks (" ".). To use a quotation mark in a delimiter list, it must be preceded by a backslash. If delimiters are specified as a set, enclose them it braces ({ }). To use a brace in a delimiter set, it must be preceded by a backslash. If an entire message is to be treated as one token, two consecutive quotation marks (" ") must be specified. The Message Processor considers this the null delimiter list. The Message Processor automatically strips off leading and trailing spaces from a input message. The delimiter list should not include characters meant to strip off leading and trailing spaces. For example, for the message: This is a list: x, y, z and d The delimiter list " : , , " (three spaces, colon, space, comma, space, comma, and three spaces) could be used, or the delimiter set { :,} (space, colon, comma) could be used, either of which would result in these tokens:
______________________________________
This
is
a
list
x
y
z
and
d
______________________________________
The TOKEN command is for defining message pattern tokens. To optimize efficiency, only those tokens that are needed to identify the message (although as many pattern tokens as there are message tokens may be defined) should be defined. The TOKEN command uses equality test, unlike the CONSTRAINT command that can be a variety of comparison operators. The format for the TOKEN command is:
______________________________________
TOKEN ›token-type! number "token-text"
______________________________________
where token-type is one of the following: KEYWORD For the most efficient pattern matching, use the keyword token with standard patterns. THE MESSAGE PROCESSOR allows only one keyword token per pattern. Keyword tokens are used to identify the most unique, fixed portion of the message text. Token text is optional with a keyword token. FIXED Fixed tokens are used to match text in which every character must match character for character. MASKED Masked tokens are used to match either portions of text or text that varies from message to message. RUNID Run-id token. A token number is not used, but token text must be specified. THE MESSAGE PROCESSOR allows only one run-id token per pattern. If a token type is not specified, THE MESSAGE PROCESSOR assume a type of FIXED or MASKED, depending on whether or not the token text contains a mask specification. number specifies the position of the token within the message. Token numbers can range from 1 to n, where n is the total number of tokens in the message. A token number must be specified for all token types except run-id tokens. The TOKEN command does not support negative token numbers. token-text is a string containing the text of a token. Token text can be fixed characters and masked operators, depending on the type of token. If token text is not specified for keyword, fixed, or masked tokens, THE MESSAGE PROCESSOR assumes the text found in the specified message text at that token position. If token text is specified, THE MESSAGE PROCESSOR compares it to the message text for correctness. Token text is optional, except for run-id tokens. A masked token is specified by using a mask string. A mask string consists of fixed characters and special mask operators. The mask string allows pattern matching on partial message tokens. There are two types of mask operators: optional and place-holder. The optional mask operator means that any number of characters up to the number specified (0 to n) can appear in the position of the token. The format for the optional mask operator is .backslash.*n.backslash., where n is the maximum number of optional characters, from 1 to 255. For example, the optional mask operator of TA.backslash.*2.backslash. matches the following: TA TA1 TA2 TA33 but does not match the following: TB TC1 TA111 The place-holder mask operator specifies that a specific number of characters appear in the position of the token. The format for the place-holder mask operator is .backslash.?n.backslash., where n is the required number of characters, from 1 to 255. For example, the place-holder mask operator of TA.backslash.?2.backslash. matches the following: TA11 TABC TA/* TA-3 but does not match the following: TA TA1 TA111 TB12 The CONSTRAINT command adds decisional logic to the pattern-matching process. The CONSTRAINT command effectively creates a pattern decision upon which a decision is based as to whether a message matches the pattern definition. Any number of CONSTRAINT commands may be included in a pattern definition in a Pattern Database. CONSTRAINT commands may be used with or instead of TOKEN commands. If TOKEN and CONSTRAINT commands appear in the same pattern, TOKEN commands are evaluated first. Masked tokens cannot be used with the CONSTRAINT command. The CONSTRAINT command uses an expression to limit pattern matching. The result of the expression must be non-zero for the pattern to match the message. If the result of the expression is zero, then no pattern is matched. If more than one CONSTRAINT command is present in a pattern, the result of the expressions in each of the CONSTRAINT commands must be non-zero for the pattern to match the message. Pattern matching does not succeed in the event of a run-time error, such as an invalid token number reference. The format of the CONSTRAINT command is:
______________________________________
CONSTRAINT expression
______________________________________
where expression provides the decisional logic for pattern matching to occur. The expression must evaluate to a non-zero integer value for the pattern to match the message. The following example shows part of a pattern definition that matches a DEVERR message associated with device "DEV1" or "XYZ" that occurred on a path that included "IOP1" as the iop. This example is more efficient than using a nonstandard pattern or masking.
______________________________________
DEFINE "DEVICE"
MESSAGE "device ip/iop/cm/cu DEVERR function run-id responses"
TOKEN KEY 3
CONSTRAINT (.backslash.1.backslash. = "DEV1" .vertline. .backslash.1.bac
kslash. ="XYZ")
CONSTRAINT (.backslash.2 {/} 2.backslash. = "IOP1")
______________________________________
Backslashes are required around token numbers, such as .backslash.1.backslash.. Backslashes are optional when referencing tokens with the .sub.-- TOKEN predefined variable, such as .sub.-- TOKEN1. For example, CONSTRAINT (.sub.-- TOKEN1="DEV1") is equivalent to:
______________________________________
CONSTRAINT (.backslash..sub.-- TOKEN1.backslash. = "DEV1")
______________________________________
The Message Processor allows use of two types of variables, predefined and user-defined. Predefined variables are maintained by the Message Processor and user-defined variables are defined and maintained by the user. All predefined variables begin with a leading underscore (.sub.--) to distinguish them from user-defined variables. However, the predefined variables DT, IMAGE, MESSAGE, RRID, and RUNID can be specified without the leading underscore since they predate this convention. The Message Processor provides the following predefined variables: .sub.-- ALL is a string variable and contains all the members of a variable group. .sub.-- DAY is a string and contains the name of the day of the week, for example, Monday, Tuesday, and so forth. .sub.-- DAYNUM is an integer and represents the day of the week as follows: Integer Day 1 Monday 2 Tuesday 3 Wednesday 4 Thursday 5 Friday 6 Saturday 7 Sunday .sub.-- DBNAME is a string and contains the name of the database that is currently active. The database name is always in lower case. .sub.-- DT is a string and contains the current date and time from the system console's PC clock. The output fornat of the date-time substitution is mmddyy hhmmss .sub.-- ERRORS is an integer and is the number of errors encountered while processing the actions for a matched pattern. .sub.-- IMAGE is a string and contains the text of the message as it appears on the console, including the read-amd-reply numbers and Exec prefixed run-ids. .sub.-- NEGTOKENn is a string and contains the text of a message token associated with a negative token number. n is an integer token number. An alternative way to reference a message token number is .backslash.-n.backslash.. .sub.-- RRID is a string and contains the unique read-and-reply identifier (RRID) of the matched message. The RRID is an 8-character string assigned by the system console to a read-and-reply message. RRID substitution can be used only with actions associated with read-and-reply patterns. .sub.-- RUNID is a string and contains the run-id associated with a matched message. The run-id associated with an Exec message is always blank. .sub.-- STATUS is an integer and is the result of the previous action. Included in this variable are results from action types specified by the ACTION command, the IF-ELSEIF-ELSE-ENDIF construction, and the SET, RESET, CREATE, and DESTROY actions. Possible values are: 1 (Warning) 0 (Action executed) -1 (Error) .sub.-- TOKENn is a string and contains the text of the message token associated with a token number. n is an integer token number. An alternative way to reference a message token number is .backslash.n.backslash.. .sub.-- TOKENS is an integer and is the number of tokens in the message. User-defined variables must be defined before they can be used. A maximum of 2,720 variables can be defined in any database. A variable must be defined with a name, as a variable or as a variable group and, a type. A default value and a time-out value are optional. A variable group is a collection of dynamically created members that share common characteristics that are user defined. With these common characteristics, a template for each member of a variable group is created. There group characteristics are: The variable type can be integer or string. The default value The time-out value Whether or not the variable value is retained when another database is activated Once the variable group is defined, members within the variable group may be created. The members have a unique name within the group and a unique value. All variable definitions begin with the DEFINE command. The DEFINE command uniquely identifies each variable in a database by assigning it a variable-name. The following commands show the general layout of commands for defining each user-defined variable in a database:
______________________________________
DEFINE VARIABLE ›GROUP! "variable-name"
›TYPE variable-type ›RETAINED!!
›DEFAULT default-value!
›TIME-OUT time-out-value ›time-unit!!
END
______________________________________
DEFINE Begins each variable definition. Use to define variables as well as variable groups. To define a variable group, include the GROUP keyword in the DEFINE command. TYPE Optional command for specifying the type of variable, where variable-type is either INTEGER or STRING. Also use to specify if the member or value of the variable should be retained when another database is activated. A variable of type integer means that the value of the variable can only be an integer. A variable of type string means that the value of the variable can be a string of character data. String is the default type. DEFAULT Sets the initial value of the variable. Note: If a default value is not defined, the Message Processor uses a default of 0 for integer variables and a null string (" ") as the default for string variables. TIME-OUT Resets a variable to its default value if it has not been changed using the SET and RESET commands after a specified period of time. The time-unit may be specified as either MINUTES or SECONDS. SECONDS is the default time-unit. END Ends the definition block. There must be a corresponding END command for each preceding DEFINE command. The names of user-defined variables are always case insensitive whether or not the database is case sensitive or case insensitive. For example, references to a variable name of DISKERRORS, diskerrors, and DISKerrors can be used to refer to a variable defined as DiskErrors. Variable group members are the means for creating multiple values within user-defined variable groups. Members of the variable group are created or destroyed at run time. Each member has a permanent, descriptive name within its variable group. A member name can contain up to 128 characters including spaces; longer names are truncated. A member name must be unique within it,; variable group; however, the same member name may be used in multiple variable groups because members are always referenced with their variable croup names. Unlike variable names, case sensitivity of member names is consistent with the case sensitivity of the database. If the database is case sensitive, then the member names are created and matched exactly as they are named them in the pattern definition. If the database is case insensitive, the member names are created and matched using all uppercase letters. When referencing user-defined variables, use the format:
______________________________________
.backslash.variable-ref.backslash.
______________________________________
where variable-ref is either a variable or a member of a variable group. In the case of a member of a variable group, the member reference has the form:
______________________________________
variable-group:member-name
______________________________________
where variable-group is the name of a user-defined variable group that the user defined previously. member-name is the name of the member the user wants to reference. A member name can be a fixed string constant or the name of a variable. To reference a member, both the member name and the name of its variable group must be specified. The name of a variable group member can be referenced by a variable or by a fixed string constant. Variable group member names have a maximum length of 128 characters; longer names are truncated. A variable reference is the name of a user-defined or a predefined variable. A fixed string constant reference is a set of characters, in quotation marks ("). Fixed string constants cannot include substitution. For example, "Disk" is a valid fixed string constant member name, but "Disk.backslash.Diskname.backslash." is not. The following example uses a fixed string constant to set a member named "DN" in the variable group DeviceStatus to a value of "down."
______________________________________
SET DeviceStatus:"DN" = "down"
______________________________________
An equivalent reference uses a user-defined string variable, StatusName, as shown in this example.
______________________________________
SET StatusName = "DN"
SET DeviceStatus:StatusName = "down"
______________________________________
The following example references the same member, "DN", from the variable group DeviceStatus within a string. Notice that when referencing a variable group member within a string, both the group name and the member name must be enclosed within backslashes (.backslash.).
______________________________________
Device .backslash..sub.-- TOKEN1.backslash. is .backslash.DeviceStatus:"DN
".backslash."
______________________________________
The above example is more meaningful if the member name is extracted from message text rather than from a fixed string constant. For the following example, assume that the message text is "DA0 DN". In this case, the second token from a message is used to reference the variable group member. This reference causes the device status of "DN" to become the more meaningful word, down.
______________________________________
"Device .backslash..sub.-- TOKEN1.backslash. is .backslash.DeviceStatus:.s
ub.-- TOKEN2.backslash."
______________________________________
After text substitution occurs, the resulting string is:
______________________________________
"Device DA0 is down."
______________________________________
In some cases, all of the members of a variable group may need to be referenced. To do this, the predefined variable called .sub.-- ALL may be used. The .sub.-- ALL may be used with the following commands: DESTROY Destroys all members of the specified variable group. SET Sets all members of the specified variable group to a common value. RESET Resets all members of the specified variable group to the default value of that variable group. The following example resets all of the members in the variable group called DiskErrors to their default value.
______________________________________
RESET DiskErrors:.sub.-- ALL
______________________________________
The .sub.-- ALL may also be used within an expression or string. The result of this reference is a string that includes all of the member names separated by two spaces. The following example generates a string that contains all of the member names in the variable group called DiskErrors.
______________________________________
ACTION ALL DISPLAY ".backslash.DiskErrors:.sub.-- ALL.backslash."
______________________________________
If DiskErrors has three members named DISK01, DISK02, and DISK03, the resulting string would be:
______________________________________
"DISK01 DISK02 DISK03"
______________________________________
To reference a variable within a string, the value must be enclosed within backslashes (.backslash.). The following example shows how to reference the value of the variable DISKNAME in a string:
______________________________________
"The name of the disk is .backslash.DISKNAME.backslash."
______________________________________
The following example shows how to reference the value of a variable group member within a string. Assume that the name of each member of the variable group, EXECErrorText, is actually an Exec error code (for example, 001 or 002). The value of each member is a text description of the Exec error code. For example, member 001 has a value of "facilities inventory complex error," and member 002 has a value of "function control error." The following example shows how to insert the text description of Exec error code 001 into a string.
______________________________________
"System error code 001 (.backslash.EXECErrorText:"001".backslash.)
occurred"
______________________________________
After substitution, the resulting string is:
______________________________________
"System error code 001 (facilities inventory complex error)
______________________________________
occurred"
Now assume that the error code is stored in a variable named ErrorCode. The following example shows how to generically reference the error code and Exec error code text.
______________________________________
"System error code .backslash.ErrorCode.backslash. (.backslash.EXECErrorTe
xt:ErrorCode.backslash.)
occurred"
______________________________________
If ErrorCode has a value of 001, the results of the two example strings are identical. ErrorCode can be an integer or string variable; the results are the same in either case. Backslashes (.backslash.) may be omitted when referencing variables within expressions. However, if a variable is being referenced within a string that is within an expression, or if partial text is being referenced, the reference must be enclosed in backslashes. The following example shows how to reference the values of variables called Count and DISKNAME in expressions.
______________________________________
SET Command = "UP .backslash.DISKNAME.backslash."
SET Current = DISKNAME
SET Count = Count+1
______________________________________
User-defined variables can be referenced as the target of the SET, RESET, CREATE, and DESTROY actions. The following rules apply when using references as the target of these actions: The variable reference cannot consist of partial text. The reference cannot be enclosed within backslashes (.backslash.). Predefined variables cannot be referenced as the target of the command. However, a predefined variable name can be used as the member reference of a variable group. For example, assume that .sub.-- TOKEN1 has the value of PRD10C. The value of PRD10C is used as the member name of the DiskErrors variable group. In this example, the member PRD10C is reset to its default value.
______________________________________
RESET DiskErrors:.sub.-- TOKEN1
______________________________________
The following example shows how to reference the variable called DISKNAME. In this example, DISKNAME is set to the value of token 3.
______________________________________
SET DISKNAME = ".backslash..sub.-- TOKEN3.backslash."
______________________________________
In this example, DISKNAME is the target of the SET command and therefore does not get enclosed in backslashes. .sub.-- TOKEN3 is referenced as part of the string and therefore is enclosed in backslashes. Partial text reference is used to extract only a portion of a variable value. Subtokens, character positions, or a combination of both may be extracted. The format for partial text reference is:
______________________________________
.backslash.identifier "list" subtoken.backslash.
.backslash. identifier {set} subtoken.backslash.
.backslash.identifier "list" subtoken ›start,end!.backslash.
.backslash.identifier {set} subtoken ›start,end!.backslash.
.backslash.identifier ›start,end!.backslash.
______________________________________
where identifier is a predefined variable, user-defined variable, token number (nn), or negative token number (-nn). list is the optional delimiters separatehin quotation marks (" "). The delimiters separate the token into subtokens. set is the optional delimiter set, within braces ({ }). The delimiters separate the token into subtokens. subtoken is an integer that indicates the portion of text to be referenced. Subtokens are numbered left to right unless preceded by a minus sign (-); then the subtokens are numbered right to left. start is an integer that indicates the starting character position within the inset (or subtext insert). Character position are numbered from left to right, starting at 1. The starting character position cannot be greater than the total number of characters of the insert. end is an integer that indicates the ending character position within the insert (or subtext insert). The ending character position must be greater than or equal to the beginning character position. Character positions are numbered from left to right, starting at 1. If the ending character position is greater than the total number of insert characters, the last insert character position is used. Subtoken substitution is used to break apart or tokenize the substitution text into subtokens. For example, assume the following device error message is pattern matched using the standard delimiters (blanks).
______________________________________
device ip/iop/cm/cu DEVERR function run-id responses
______________________________________
Token 1=device Token 2=ip/iop/cm/cu Token 3=DEVERR Token 4=function Token 5=run-id Token 6=responses The following subtext specification extracts the instruction processor name (ip) from the second token:
______________________________________
.backslash..sub.-- TOKEN2 {/} 1.backslash.
______________________________________
An alternate way of specifying the second token is:
______________________________________
.backslash.2 {/} 1.backslash.
______________________________________
The identifier is the second token: ip/iop/cm/cu, which results in the following subtokens: Subtokens 1=ip Subtokens 2=iop Subtokens 3=cm Subtokens 4=cu When the delimiter of / is used, the subtoken specification (1) extracts ip from the substitution text. Note that negative token numbering can also be used with subtoken substitution. The following example shows how to reference part of the text value of a member of a variable group. The substring ›1,4! is applied to the value of the variable group member referenced by DiskName:.sub.-- token3.
______________________________________
.backslash.DiskName:.sub.-- token3 ›1,4!.backslash.
______________________________________
The following example shows how to reference the first five characters from the third token of MESSAGE:
______________________________________
.backslash.MESSAGE { } ›1,5!.backslash.
______________________________________
Notice that in this example, MESSAGE, a predefined variable does not begin with the underscore (.sub.--) character. Character position substitution is used to extract particular character positions within a text substitution. Specify the starting and ending characters, separated by a comma. The following example extracts the third and fourth characters from the "MMDDYYHHMMSS" date substitution:
______________________________________
.backslash.DT›3,4!.backslash.
______________________________________
As a result, only the DD portion of the date is substituted into the action text. If only one character is desired, specify the start and end characters as the same:
______________________________________
.backslash.DT›6,6!.backslash.
______________________________________
As a result, only the last digit of the year is substituted into the action text. The starting character position must be less than or equal to the total number of characters, and the ending position can be greater than the total number of characters. For example, if ›20,40! is used to extract part of a message that is 30 characters long, characters 20 through 30 are extracted. However if ›41,50! is specified, an error occurs because the starting character position is greater than the total number of characters. The .sub.-- STATUS predefined variable is set to -1 in this case. A partial text reference can combine subtoken and character position substitution. For example, assume the following device error message is pattern-matched using the standard delimiters (blanks):
______________________________________
device ip/iop/cm/cu DEVERR function run-id responses
______________________________________
The following subtoken substitution combined with character position substitution, extracts only the first three characters of the iop name:
______________________________________
.backslash.2 {/} 2›1,3!.backslash.
______________________________________
The following example shows how to reference the fourth and fifth characters of the second token of the member of the variable group ErrorText named by the third token in the matched message. In this example, the backslashes are required because a partial text reference is used.
______________________________________
.backslash.ErrorText:.sub.-- token3 { } 2›4,5!.backslash.
______________________________________
This reference is part of a pattern that matches the following message:
______________________________________
Operator: Enter E002 most recent bag number.
______________________________________
The value of .sub.-- token3 is E002. Within the variable group (ErrorText), there is a member called E002. If the value of E002 is undefined bag65, then 6 and 5 are the fourth and fifth characters of the second subtoken (bag65). The following example shows how to reference the fourth and fifth characters of the third subtoken of the variable called ErrorText in a string.
______________________________________
"The error code is .backslash.ErrorText { } 3›4,5!.backslash."
______________________________________
The value of a user-defined variable can be changed to its default value or to a new value by including the SET and RESET actions in the Pattern Database. The SET and RESET commands are executed during action processing. To change the value of a variable group member, the variable group and the member name to be changed must be specified. If a member name that does not exist is specified, it is dynamically created with the new value. The value of all of the members of a variable group can be changed to a default value or to a new value by referencing the predefined variable, .sub.-- ALL, that includes all of the members. Expressions are a series of operands and operators whose computation yields a value. Spaces between operands and operators are permitted but are not required. If an expression cannot fit on one line, a backslash (.backslash.) must be inserted at the end of the first line to continue the expression to the next line. If the backslash is not included, the lines will be treated as two separate expressions and an error is likely to occur. In the Message Processor, operands are: Integer constants Integer constants are numbers ranging from -32676 to 32676 Strings There are two kinds of strings: fixed string constants and strings with substitution. Fixed string constants are enclosed in quotation marks and contain characters only. Text cannot be substituted into a fixed string constant. Strings with substitution are enclosed in quotation marks and can contain characters and variable references that are inserted into the string. Masking sequences (.backslash.?n and.backslash.*n.backslash.) are not allowed. Variable references Variable references can be used to reference message tokens, predefined variables, user-defined variables, members of variable groups, and partial text references of any variable. Expressions within parentheses () An expression can be enclosed in parentheses to control the order of evaluation. For example, in the expression (A+B)*C A and B are first added together and their sum is multiplied by C. Without the parentheses, the expression A+B*C would be evaluated by multiplying B and C and adding the result to A, since multiplication ha,, precedence over addition. In the Message Processor, operators are Arithmetic Arithmetic operators operate on integer constants, integer variables, and integer expressions. Comparison Binary comparison operators compare two integer operands or two strings. The result of a comparison operator is zero if the condition is false and is non-zero if the condition is true. The unary comparison operator (?) can be used to check for the existence of a member in a variable group. Boolean Boolean operators perform the following logical operations. Logical AND (&) Logical OR (.vertline.) Unary NOT (|) The result of a Boolean operator is zero if the result is false and is non-zero if the result is true. Conversion The unary uppercase operator, , and be applied to string operands to convert the text "a" through "z" to uppercase characters. The # symbol converts string operands to integers. Integer operands within quotation marks (" ") are converted to strings. The following are the Message Monitor supported operators:
______________________________________
Operator Action
______________________________________
- Unary negation
+ Unary positive
| Unary NOT
? Test for the existence of a member in a variable group
# Converts string operand to integer operands
Converts string operands to upper case
* Multiplication
/ Integer division
% Integer remainder
+ Addition
- Subtraction
< Relational less than
> Relational greater than
<= Less than or equal to
>= Greater than or equal to
= Equal to
|= Not equal to
& Logical AND
.vertline.
Logical OR
______________________________________
The following are conditions for using comparison operators in strings: Masking is not allowed in fixed string constants. Strings must be in the same case in order to match. The operator can be used to change the case, if necessary. Leading and trailing spaces are included in string comparisons. For example "AB" does not match "AB ". The following list shows the precedence of the operators. The list is in sequence of highest to lowest precedence. Where several operators are grouped, they have equal precedence to each other and are evaluated from left to right. To change the order of precedence, operands and operators can be enclosed within parentheses ().
______________________________________
Evaluation Sequence
Operators
______________________________________
Evaluation first -(unary) | ? # + (unary)
Evaluation second * / %
Evaluation third +(binary) -(binary)
Evaluation fourth < > <= >=
Evaluation fifth = |=
Evaluation sixth &
Evaluation last .vertline.
______________________________________
The existence operator (?) applies only to references of variable group members. An error occurs if this operator is applied to any other operand. The existence operator may be used to check for the existence of any members in a variable group. In addition, if .sub.-- ALL is used to refer to all of the members in the variable group, evaluation of"?" results in the number of members in the group. The following example shows how to use the existence operator. In the example
______________________________________
?MacroKeyins:.sub.-- TOKEN1
______________________________________
the statement yields true if the value of the first message token is a member of the variable group MacroKeyins. Otherwise, it yields false. If MacroKeyins is a variable group whose members are SP* and RE*, the following constraint:
______________________________________
CONSTRAINT (?MacroKeyins:.sub.-- TOKEN1)
______________________________________
allows message to match only if they begin with "SP*" or "RE*." The following example results in the count of the existing members of MacroKeyins.
______________________________________
?MacroKeyins:.sub.-- ALL
______________________________________
Response definitions are specified as input to the Create Pattern Database software 42 through use of the ACTION command for specification of automation functions and function decisions that are used for conditioning performance of the functions. Actions can be executed in three ways: They can be included in the ACTION command to automate responses to system messages and display or suppress system information to the operator. They can be specified to change the values of user-defined variables. They can be associated with function decisions for execution of actions that depends on information from more than one message. The ACTION command allows specification of the actions the Message Processor should perform when it finds a pattern match for a input message. Any number of actions may be specified per pattern. The format of the ACTION command is:
______________________________________
ACTION mode ›mode...! action-type "action-text"›WAIT xxx
______________________________________
›time-unit!!
The mode is the mode to which the action applies. These modes are unique to 2200 Series data processing systems and beyond the scope of the present invention. The action-type is the type of action the Message Processor should initiate. There are two types of actions: automation actions and display enhancement actions. Automation actions ACTIVATE ALARM ANSWER COMMAND DEACTIVATE EVENT-REPORT RESPONSE TCOMMAND Display enhancement actions DISPLAY HIGHLIGHT HOLD RELEASE SUPPRESS The particular functions are unique to 2200 Series data processing systems and beyond the scope of the present invention. However, the functions will be further described as examples of functions whose initiation could be automated as a responses to messages that match defined patterns. The action-text is any predefined or user-defined variable whose length does not exceed a predetermined maximum length. If the length of a substituted variable exceeds the maximum length, or the text is inappropriate for the action type, a run-time error can occur. When the Message Processor creates action text from substituted variables, the generated text length cannot be determined until execution time. Substitution of all predefined variables adds 1 character to the length of the generated text, except for the following variables: .sub.-- DT adds 13 characters .sub.-- RRID adds 8 characters .sub.-- DAY adds 6 characters Partial text references add the end-position - start-position+1. This overrides the previous length calculations for this particular substitution. WAIT xxx ›time-unit! xxx is an integer (minimum of 1 and maximum of 32767) that indicates the number of seconds or minutes to wait before performing the specified action. It must be specified as an integer constant; a variable reference is not allowed. time-unit is either SECONDS or MINUTES. SECONDS is the default if neither is specified. The WAIT clause can be used to delay the execution of automation actions for a specified number of minutes or seconds. The WAIT clause cannot be used with display enhancement actions nor with the SET, RESET, CREATE, and DESTROY actions. Delayed actions are Generated and then saved until the specified number of seconds or minutes have elapsed. Executed once the specified time has elapsed. When WAIT is used with ACTIVATE and DEACTIVATE, the specified database is activated or deactivated after the elapsed amount of time. If an operator activates another database between the time that the ACTIVATE or DEACTIVATE action is generated and executed, the database that is activated as a result of the delayed action takes effect at the specified time. Executed if no database is active at the time that the specified number of seconds or minutes has elapsed. Not executed if the system operations session loses its connection to the Host or terminates and restarts, or if the console is rebooted. The automation actions that can be defined using the ACTION command are described in the following paragraphs. The ACTIVATE action activate s a Pattern Database. The database name is supplied for the action text. Activation failure causes the previously active database to remain active. The ALARM action activates an alarm. The action text is the alarm identifier (a value of 0 through 18, or 33). The ANSWER action automatically answers an outstanding read-and-reply message. The matching message or variable indicates which outstanding read-and-reply message to answer. The action text consist of the response number indicator followed by the text of the response.
______________________________________
ACTION mode ANSWER ".backslash.rridno.backslash.-response"
______________________________________
where mode is one of the following: ATTENDED, CASUAL, UNATTENDED, ALL .backslash.rridno.backslash. is the response number, which can be the token position of the read-and-reply identifier in the defined message, a variable, or a member of a variable group. response is the text used to answer the read-and-reply message indicated by the RRID. The response text can use variable and token substitution, and can be up to 68 characters long. It does not include the leading response number and data. The COMMAND action generates an unsolicited console key-in. The action text is the text of the key-in. The DEACTIVATE action deactivates the current active database. Once a database is deactivated, operator intervention is required to activate it. Action text is not specified. Only one DEACTIVATE or ACTIVATE action is allowed per mode. It is executed after all other specified actions have executed. The EVENT REPORT action can be used to communicate with other Software processes that a pattern was matched. The RESPONSE action responds to a read-and-reply message. The TCOMMAND action generates an unsolicited console key-in but does not display it on the system console. This action functions like the COMMAND action. The action text is the text of the key-in. The transparent command is used to send commands without distracting the operator. Display enhancement actions are available for the Automated Operation Console. The display enhancement actions include DISPLAY, HIGHLIGHT, HOLD, RELEASE, and SUPPRESS. The DISPLAY action displays the text as specified by the action text on the display of the Automated Operation Console. This action can be used in combination with the Suppress action to perform message replacement. The HIGHLIGHT action attaches a display attribute to a received message. In addition, supplemental messages are highlighted when the Display command is used. The display attributes include background and foreground colors. The HOLD action prevents a received message from scrolling off the Automated Operation Console display screen. The message may be released by the Release action. This action may be used in combination with the Display action. The RELEASE action automatically removes held messages. The action text is a 1-12 character identifier specified on a Hold action. The SUPPRESS action prevents a received message from being displayed on the display screen of the Automated Operation Console. The following functions can be executed to create and destroy members of user-defined variable groups, and to set and reset variables and members of variable groups. The CREATE action creates a member of a variable group. The format of the CREATE action is:
______________________________________
CREATE variable-group-name:member-name
______________________________________
where variable-group-name is the name of a previously defined variable group. member-name is the unique name of the member. The member name can be a variable or a fixed string constant but cannot be a reference to another variable group member. A fixed string constant is a set of characters enclosed in quotation marks (for example, "ABC") and cannot include variable substitution (for example, "FROM .backslash..sub.-- RUNID.backslash."). If the CREATE action is use d to create a member that already exists, the value of the member and the Time-OUT value do not change, and the .sub.-- STATUS variable is set to 1, indicating a warning. The following example adds a m ember named "SYS" to the variable group called RunidList. "SYS" is a fixed string constant .
______________________________________
CREATE RunidList:"SYS"
______________________________________
The following example shows how to create a member called PRD01C, when PRD01C is the value of the variable called disk, in the previously defined variable group called DiskErrors. The value (PRD01C) of the variable (disk) is used to name the member.
______________________________________
CREATE DiskErrors:disk
______________________________________
The following example shows how to use a predefined variable as a member of a user-defined variable group. The value of the predefined variable, .sub.-- RUNID, names a member of the user-defined variable group called RunidList.
______________________________________
CREATE RunidList:.sub.-- RUNID
______________________________________
The following example shows how to create a member in the user-defined variable group called Status. The name of the member is the value of the fifth token. If the fifth message token i s RESERVED, this command creates the member RESERVED in the variable group Status.
______________________________________
CREATE Status:.sub.-- TOKEN5
______________________________________
An alternative way to reference .sub.-- TOKEN5 is to use the number of the token, as shown in this example:
______________________________________
CREATE Status:5
______________________________________
The DESTROY action destroys a member that was created in a user-defined variable group. The DESTROY actin can be used to delete one or all members that were created for a given variable group. The format for the DESTROY action is:
______________________________________
DESTROY variable-group-name:member-name
______________________________________
where variable-group-name is the name of a previously defined variable group. member-name is the unique name of the member. The member name can be a variable, a fixed string constant, or the predefined variable, .sub.-- ALL. A fixed string constant is a set of characters enclosed in quotation marks (for example, "ABC") and cannot include variable substitution (for example, "FROM.backslash..sub.-- RUNID.backslash."). .sub.-- ALL references all of the members of a previously defined variable group. If the DESTROY action is used to delete a member that does not exist, the .sub.-- STATUS variable is set to 1, indicating a warning. If the DESTROY action is used to delete all (.sub.-- ALL) members of a variable group that has no members, the .sub.-- STATUS variable is set to -1, indicating an error. The .sub.-- STATUS variable is also set to -1 if the member name is a token that does not exist. The following example shows how to delete the member from the user-defined variable group called DiskErrors. The member that will be deleted is named by the value of the variable called disk. If the variable, disk, has the value PRD01C, the member named PRD01C in variable group DiskErrors is destroyed.
______________________________________
DESTROY DiskError:disk
______________________________________
The following example shows how to delete the members named "SYS" from the variable group called RunidList. "SYS" is a sting literal.
______________________________________
DESTROY RunidList:"SYS"
______________________________________
The following example shows how to delete all of the members from the user-defined variable group called DiskErrors.
______________________________________
DESTROY DiskError:.sub.-- ALL
______________________________________
The SET action sets the value of a variable, or one or all members of a variable group. Variable group members are automatically created if they do not exist when a value is assigned using the SET action. The format of the SET action is:
______________________________________
SET target = expression
______________________________________
where target is a variable or variable group member reference of the form variable-group:member-name. expression is the value to assign to the variable or member in the form of either an expression, or a fixed string constant. Fixed string constants must be enclosed in quotation marks (") and can contain characters and variable references that are inserted into the string. The following example shows how to set the value of the variable called DiskMessage. The value of DiskNumber is inserted into the string before it is assigned to DiskMessage.
______________________________________
SET DiskMessages = "The number of the disk if .backslash.DiskNumber.backsl
ash."
______________________________________
Assume that .sub.-- TOKEN1 has the value of PRD01C. The following example shows how to add 1 to the value of the member named PRD01C. If PRD01C is not yet a member of variable group DiskErrors, it is automatically created when it is referenced by the SET action. The right side of the equation is evaluated by using the default value for members of variable group DiskErrors and adding 1 to that value.
______________________________________
SET DiskErrors:.sub.-- TOKEN1 = DiskErrors:.sub.-- TOKEN1
______________________________________
+ 1
Assume that .sub.-- TOKEN1 has the value of PRD10C and that .sub.-- TOKEN2 has the value of DISK01. The following example shows the value of PRD10C being set to the value of DISK01 incremented by 1.
______________________________________
SET DiskErrors:.sub.-- TOKEN1 = DiskErrors:.sub.-- TOKEN2
______________________________________
+ 1
If member PRD10C does not exist, it is automatically created and assigned the value resulting from the right side of the equation. However, if member DISK01 does not exist, an error message results. THE MESSAGE PROCESSOR does not automatically create members that are referenced in an expression. Members are created when referenced as a target of a SET or RESET command. The following example shows how to set the value of a member using a variable (StatusName) as a member name reference, in the variable group called DeviceStatus.
______________________________________
SET StatusName = "DN"
SET DeviceStatus:StatusName = "Down"
______________________________________
Alternatively, the member name can be referenced directly as:
______________________________________
SET DeviceStatus:"DN" = "Down"
______________________________________
The RESET action reset the value of one or all members of a user-defined variable to the default value. Variable group members are automatically created if they do not exist when referenced by the RESET action. The format for the RESET action is:
______________________________________
RESET target
______________________________________
where target is a variable or variable group member reference of the form variable-group:member-name The following example shows how to reset the string variable called DiskMessage to the default value when the variable was defined.
______________________________________
RESET DiskMessage
______________________________________
The following example shows how to reset all of the members in the variable group called DiskErrors to the default value specified when the variable group was defined.
______________________________________
RESET DiskErrors:.sub.-- ALL
______________________________________
Function decisions Decisions can be applied to action processing in a Pattern Database using the IF-ELSEIF-ELSE-ENDIF construction. Nested IF statements permit definition of multiple sets of conditions and associated actions in the database. The IF-ELSEIF-ELSE-ENDIF construction consists of conditional clauses in the database that use expressions to determine when to execute an action. The construction is flexible and allows the definitions of actions that should occur if certain conditions are true or not true. The format of the IF-ELSEIF-ELSE-ENDIF action is:
______________________________________
IF expression
›actions!
ELSEIF expression
›actions!
ELSE
›actions!
ENDIF
______________________________________
where IF indicates the beginning of the function decision. The expression is required; the actions are optional. expression is a set of conditions that result in a non-zero integer value for the specified actions to occur. actions are any of the following: All keywords of the ACTION command SET action RESET action CREATE action DESTROY action A nested IF-ELSEIF-ELSE-ENDIF construction ELSEIF Is an optional clause that introduces a set of conditions that are checked if conditions from the IF clause are false. If the ELSEIF conditions are true, another set of actions are executed. Multiple ELSEIF clauses can be specified for an IF construction. ELSE Is an optional clause that introduces a set of actions that occur if none of the preceding conditions in the IF and ELSEIF clauses are true. ENDIF Indicates the end of the IF-ELSEIF-ELSE-ENDIF construction. Nested IF constructions provide the ability to specify any number of conditions that must be true for action processing to occur. When IF constructions are nested, each one must have its own ENDIF clause. IF constructions and be nested up to 32 levels deep. The END command indicates the end of a pattern definition. There must be a corresponding END command for each DEFINE command preceding it. The format of the END command is:
______________________________________
END
______________________________________
The follow is a complete example of a pattern definition:
______________________________________
DEFINE "newplant" 20
MESSAGE "IS TAPE ON unit# A LABELED TAPE Y,N,REEL"
TYPE READ-AND-REPLY PRIVILEGED-EXEC
PRIORITY 120
DELIMITERS {,}
TOKEN 6 FIXED
TOKEN 2
TOKEN MASKED 4 "TAO.backslash.?1.backslash."
ACTION CASUAL RESPONSE "N"
ACTION ATTENDED RESPONSE "N"
END
______________________________________
The Create Pattern Database software 42 creates a pattern with the message number 20 in group-id newplant, and enters it into the Pattern Database 44. The following examples show how to include function decisions in a Pattern Database to automate actions and respond to system messages in typical applications. The following example shows how to use the Message Processor 50 and a Pattern Database 44 to execute an action on a message only when it is the first time the message has been matched. After the message has been matched, the pattern is disabled.
______________________________________
/* Define a variable to indicate if the pattern is enabled or disabled
*/
DEFINE VARIABLE "X1.sub.-- on"
TYPE INTEGER
DEFAULT 1 /* 1 indicated the pattern is enabled (active) */
END
DEFINE "X" 1
MESSAGE "message text . . ."
TOKEN . . .
.
.
.
CONSTRAINT (X1.sub.-- on)
/* Pattern only matches if X1.sub.-- on
is non-zero */
ACTION ALL . . .
.
.
.
SET X1.sub.-- on = 0
/* Turns pattern off after actions
are executed */
______________________________________
The pattern defined as "X" 1 can be enabled again by another pattern by resetting the X1.sub.-- on variable. Returning to FIG. 3, after the input has been defined in accordance with the rules above, the Create Pattern Database software 42 creates the appropriate pattern definitions in the Pattern Database 44 as shown by Step 74. The Pattern Database consists of the specified number of pattern definitions, specified ones including pattern decisions, along with associated response definitions. The response definitions include one or more functions along with optional function decisions. In corresponding to the exemplary embodiment, the pattern definitions may be specified with the TYPE, DELIMITERS, TOKEN, and CONSTRAINT commands; the response definitions may be specified with the ACTION commands in combination with the function decisions; and the function decisions may be specified with the IF, ELSE-IF, and ELSE logic. The function definitions may be specified with the ACTION commands and the variable manipulation functions (e.g., SET and RESET). Also in the exemplary embodiment, the functions specified by the function definition are of two types relative to the Message Processor 50, internal and external. Internal function are those which affect the variables defined in the database, and external function identify a function of processor that is external to the Message Processor (e.g., a power control unit or a status monitor program on another computer). Data structures of the exemplary embodiment correspond to the VARIABLES, both predefined and user-defined. After the Pattern Database 44 has been created and established for use by the Message Processor 50 (e.g., on the Automated Operation Console), at Step 76 the Message Processor opens the Pattern Database for use in processing input messages. The flowchart of Open Database For Pattern Matching may be consulted for further details. After the Pattern Database 44 has been opened, the Message Processor 50 enters a processing loop for receiving and processing messages. A message is received at Step 78 according to methods and protocols specific to the Console 12/Host 10 interface. The particular means by which messages are received for processing should not be seen as limiting the present invention. For example, messages cou | ||||||
