NET/MASTER RMS Management and Operations Guide

Adding a Message Action Rule
Creating and Developing Rulesets and Rules
115415 NonStop NET/MASTER RMS Management and Operations Guide 5–41
Controlling How the Variables Are Set. You can instruct RMS when to set the variables.
Specify this control in the Set Variables field on the RMS : Set Ruleset Variables panel
using the following values:
Value Description
AFTER Sets the variables as the last action of the rule. Use AFTER if you want to pass the
values of the variables to rules and exit NCL procedures after this rule processing has
completed. This is the initial value.
BEFORE Sets the variables as soon as a message triggers the rule. Use BEFORE if you want to
pass the values of the variables to other parts of this rule or to exit NCL procedures that
are invoked by this rule.
Specifying a Ruleset to Be Loaded
You can instruct RMS to replace the ruleset containing this rule with a another ruleset
when this rule is triggered. The message handler then uses the new ruleset to process
future messages. Specify the name of the ruleset to be loaded in the Load Ruleset field
on the RMS : System Action panel. The ruleset must exist in the RMS database.
Note For a %INCLUDE rule, the new ruleset overlays the loaded ruleset; that is, new records are added and
duplicate records are replaced.
Implementing User-Defined Actions
You can implement actions that RMS does not directly support by using your own rule
action exit NCL procedure. When a message triggers the rule, RMS invokes the
procedure before performing any other processing (except if the Set Variables field has
a value of BEFORE, then RMS sets the variables first). You must use the EXIT core
statement in your procedure to return a value to RMS. If the return code is nonzero,
RMS stops any further processing on the triggered rule. You cannot pass parameters
to the procedure.
Note The rule action exit NCL procedure executes in line with the message handler. When the procedure
starts executing, all processing within the handler stops until the procedure returns control to the handler.
If the message arrival rate is high, you should avoid introducing operations that may cause lengthy delays
in the procedure (for example, file input-output operations). If the procedure aborts, the handler also
aborts.
Your procedure has access to RMS variables with the prefixes WORD, ZZZ, $RMS,
and $UV. You should regard all the variables (except the $RMS-prefixed and the
$UV-prefixed variables) as read-only variables. Changes to these variables are not
retained when the procedure terminates. Changes to the $RMS-prefixed and the
$UV-prefixed variables, however, are retained when the procedure terminates. For
example, you can change a $RMS-prefixed variable to dynamically change the
characteristics of the rule.