Creating a Chained Rule Group
Chained Rule groups (CRGs) allow you to chain together of a set of Rules that act as a single unit to automate an event. All of the Rules in the CRG are defined for a single event type. A CRG processes all of its Rules, from head to tail (or the beginning to the end) for the event type. All, or any subset, of the Rules in the CRG can fire for that event depending on the IF-THEN-ELSE logic that is specified by each Rule’s selection criteria, in conjunction with the “evaluate when policy” for each Rule. Once the CRG begins with the head Rule, the chain acts autonomously based on the logic and the evaluation policy,
How CRG processing works
The first Rule in the CRG is called the head Rule. The head Rule is processed by the Rules Processor in the same way as when an event is processed by any Rule. After the head Rule is evaluated, the rest of the CRG is processed when the event type matches the head Rule’s event type. The term “evaluation” means that Rule’s selection criteria is inspected and evaluated to see if the Rule should fire for the event.
Once the head Rule is evaluated (and potentially fired), the head Rule’s Exit policy will be examined and compared to the result of the Rule (did it fire or not). If the Exit policy specifies, the CRG can end at this point or it can continue to the next Rule in the CRG. If the CRG continues, the second Rule in the chain is examined. The second Rule’s “evaluate when policy” is inspected to decide what happens next. If the “evaluate when policy” specifies that the second Rule should be evaluated, the second Rule will have its selection criteria evaluated so it can fire, if possible. When the second Rule has been processed, its Exit policy is examined in the same way the head Rules’ Exit policy was examined. If CRG continues, the third Rule in the chain is examined based on its policy and the process is repeated until all the Rules in the chain are examined.
Effects on a Rule Set's automation strategy
The automation strategy of FIRST and ALL for the Rule Set is unchanged when you use Rules in CRGs. When a Rule Set has an automation strategy of FIRST of ALL, the head Rule of a CRG is evaluated for the Rule's selection criteria by the Rules Processor application just as the Rule is evaluated when it is not in a CRG. Once a a Rule is defined in a CRG, the entire CRG is internally processed with a strategy of ALL. Additionally, any Rule in the CRG that fires will satisfy a Rule Set defined with an automation strategy of FIRST so that no more Rules in the Rule Set beyond the last Rule in the CRG are evaluated.
For more information, you can view a quick course video: Chained Rules Groups (CRGs)
To create a CRG
Select Chained Rule Groups from the EZAORUL menu.
The CHNRULES view is displayed. For information about this view, place the cursor on the view name and press PF1/Help.
The CHNRULES view shows a list of existing CRGs that are defined in the registry. Each CRG can contain any number of Rules. All the Rules in a CRG act as a single automation entity once an event matches the CRG event type and the event is processed by the head Rule.
The Rules in the CRG are processed in the sequence based on policies that are defined for the chain.
Issue the ADD command in the COMMAND field to create a new Chained Rule Group.
COMMAND ===>
CURR WIN ===> 1 ALT WIN ===>
W1 =CHNRULES==========AGSDL82D=*========ddmmmyyyy==06:56:26====MVAO=====D===13==========
- Chained Rules Group List
CMD Name Group Member Description
--- -------------------------------- -------- Count- ------------------------------------
___ IEF405I_Management CONYERS 5 Handle cleanup when IEF450I seen
___ Inventory_Cleanup CONYERS 2 Handle Inventory problemEnter values for the required fields on the ADD (New) Rule Pool dialog.
Add Chained Rule Group(s)
COMMAND ===> SCROLL ===> CSR
Instructions
Enter a CRG Name and Group for the new CRG and then press END
to create the new CRG. Use the filter to quickly locate an
existing group and select it for use if desired.
Chained Rule Group Information
Name.: ________________________________ (required)
Group: ______ (required)
Desc.: _______________________________________________________________
Add Rsn: ___________________________________________________________
Filter: *_______
Cmd Group
--- --------
_ CONYERS
_ DALLAS
_ DENVER
END to save the new CRG
CANCEL to exit without saving
HELP to see dialog helpAfter filling the required information on the dialog, enter END to save the new CRG definition and return to the CHNRULES view.
Use the RM line command on the newly created CRG to see the list of Rules that are a member of the CRG. Because this is a new CRG, the CHNRMBR view is empty.
COMMAND ===>
CURR WIN ===> 1 ALT WIN ===>
>M1 =CHNRMBR===========AGSDL82D=*========ddmmmyyyy==07:14:20====MVAO=====D====0=========
- CRG Member List
Name..........: Handle_EOS_APAYDLY
Group.........: DALLAS
Description...: Handle bad EOS for daily acct payable job
Last Change...: Fix it
CMD RuleName SeqNo Rule Eval Exit Initial Text-id EXEC Description
--- -------- ----- Type Policy-- Policy-- Mode ---------------- -------- -----------
BBMXBD15I There is no data that satisfies your request
-Related:BBMXBD23I 0 records presented by the productUse the EDIT line command to start the wizard to edit the contents of the CRG. The following is an example of the dialog displayed.
Edit Chained Rule Group Properties
COMMAND ===> SCROLL ===> CSR
Identification:
Ruleset Name: Handle_EOS_APAYDLY
Group.......: DALLAS
Last Chg: Fix it
Properties:
Desc: Handle bad EOS for daily acct payable job
Chg Rsn: ______________________________________________________________
Line Cmds: Edit, Browse, Insert, Up, Down, TOP, BOT,
REPeat, REMove, SEF, SEN, SXC, SXF, SXN
Cmd RuleName Type EvalPlcy ExitPlcy Description
--- -------- ---- -------- -------- --------------------------------
ADD to add rule to end of list
END to exit and save the changes
CANCEL to exit without saving any changes
HELP to see dialog help
Use the ADD primary command to find existing Rules to add to the CRG. The ADD wizard allows you to select the Rule pool that contains the Rules you want to include in the CRG. Note that you can also create new Rules with this wizard.
The first dialog in the ADD wizard displays a list of known Rule pools. You must select an existing Rule pool to use. Existing Rules can be selected from this Rule pool or new Rules can be created in this Rule pool with the wizard.List Rule Pools
COMMAND ===> SCROLL ===> CSR
Instructions
Select a Rule Pool from the supplied list to be used as the
source for rules in the CRG. Use the rule pool filter to
quickly locate the desired rule pool.
Search Filter
*_________________
(Line Cmds: Select)
Cmd Rule-Pool-Name Description
--- -------------------------------- ---------------------------------
_ Accounts_Payable_Handlers Rules to deal with ACCTPAY Issues
_ General_Purpose_Rules Created by Import
_ AAORULBB.Rule.Pool Created by Import
_ AAORULBC.Rule.Pool Created by Import
_ AAORULBD.Rule.Pool Created by Import
Next to continue the request
CANCEL to abandon the request
HELP to view related helpSelect the Rule pool and use the NEXT command to continue to the next step in the wizard. You can use the Search Filter value to filter the displayed Rule pools to more easily locate a pool.
List Rules
COMMAND ===> SCROLL ===> CSR
Instructions
Select one or more rules from the supplied list to be inserted
into the CRG. Use the rule filter to quickly locate the
desired rule(s).
Source Rule Pool
Name: Adhoc-AO82-Rules
Search Filter
*_______
(Line Cmds: Select)
Cmd RuleName Type S Description
--- -------- ---- - ------------------------------------------------------
_ APAY001A MSG E Handle this message id
_ APAY001B MSG E Handle this message id
_ APAY001C MSG E Handle this message id
_ APAY001D MSG E Handle this message id
_ APAY001E MSG E Handle this message id
ADD to add a new rule to this rule pool
BACK to return to previous list
END to complete the request
CANCEL to abandon the request
HELP to view related helpUse the S line command to select one or more Rules to add to the CRG and press END. You can also use the ADD primary command to create one (or more) new Rules in the selected Rule pool that you can selected and add to the CRG. When you press END with the selected Rule(s), the CHNRMBR view is displayed with the list of member Rules.
Edit Chained Rule Group Properties
COMMAND ===> SCROLL ===> CSR
Identification:
Ruleset Name: Handle_EOS_APAYDLY
Group.......: DALLAS
Last Chg: Fix it
Properties:
Desc: Handle bad EOS for daily acct payable job
Chg Rsn: ______________________________________________________________
Line Cmds: Edit, Browse, Insert, Up, Down, TOP, BOT,
REPeat, REMove, SEF, SEN, SXC, SXF, SXN
Cmd RuleName Type EvalPlcy ExitPlcy Description
--- -------- ---- -------- -------- --------------------------------
___ APAY001A MSG Continue Detect and send email
___ APAY001B MSG Fired Continue Send MVS command to fix
___ APAY001C MSG Fired Continue Send CICS command
___ APAY001D MSG Fired Continue Create non-escalated alert
___ APAY001E MSG Fired Continue Create escalated alert
ADD to add rule to end of list
END to exit and save the changes
CANCEL to exit without saving any changes
HELP to see dialog help- Use the line commands to adjust the sequence of the Rules, set the Evaluation and Exit polices, or edit or browse the Rules themselves.
When you are done, enter END to save the CRG into the registry. The CHNRMBR view is displayed and shows the contents of the CRG. You can use the EDIT primary command at any time to edit the CRG contents. - Once you created the CRG, add it to an existing Rule Set (just as you would add a new Rule).
Use the AR line command on the CHNRULES view to add the CRG. For more information, see “Association a Rule with a Rule Set” for instructions that also apply to adding a CRG to a Rule Set.
CRG in RSETRMBR view
You can use the RSETRMBR view to see the members of a Rule Set and a CRG is displayed as a single object with a Rule name of (CRG). This helps to you to see that the CRG is a member of the Rule Set.
CURR WIN ===> 1 ALT WIN ===>
>W1 =RSETRMBR==========AGSDL82D=*========(00 BROWSE )====MVAO=====D====9==========
- Ruleset Members
Ruleset Name..: CRGRSET Serial Number.: 0000006
Setbase Name..: Conyers.Production Update Version: 0802
Group Name....: CONYERS1
Last Change...: (none)
Change Reason.: _________________________________________________________________
CMD RuleName Seq Rule Initial Text-id EXEC Description
--- -------- --- Type Mode---- ---------------- -------- --------------------------------
MYWZ905I 0 JRNL Enabled DSNX905I DPE992C CREATE ALERT FOR DSNX905I
(CRG) 1 Handle_EOS_APAYDLY
MYWZ966I 2 JRNL Enabled DSNX966I DPE992C CREATE ALERT FOR DSNX966I
DDLMSG1 3 MSG Enabled DDLMSG1* Change this
(CRG) 4 Testing match limit
(CRG) 5 Match Limit with NoAction option
RULMTCHS 6 JRNL Enabled *DAVEMATCHSIM testing matchlim with CRG
Related topic