Solution
This is an alternative to linking an active time to a rule or disabling/enabling a rule in the Gateway Setup Editor. Create a custom dataview that shows the dataview name and rule status. In an existing or new rule create a path alias that uses a path variable to reference the rule status column from the custom dataview. Once referenced, you can adjust the logic in the rule to trigger based on the dataview's rule status.
Below is an example FKM rule where we set the FKM status cell to critical on the "Beta FKM" and "Generic_FKM_Testing_Sampler" if the status contains a string like "NOT_FOUND" or "FAIL."
Let's say we always want this rule to be active but want the ability to disable some or all parts of the rule during downtime or maintenance on the fly without using active times or disabling the rule. You can create a custom dataview like the one below that lists "Dataview Name" and it's "Rule Status." You can then modify your rule to trigger based on the value of the "Rule Status" column. Below are the steps to set this up.
Steps to create a Path Variable that will grab the rule target's dataview name:
- Go to the Rule's Advanced tab and click "Add new" in the Path variables section
- We will call this path variable "rowname"
- Under the Value section, remove the value "true" and right click on the white space of the Value section and select "Target names" -> "dataviewName"
Steps to add Path Variable to Path Alias referencing "Rule Status" column in the "Dataview Status Toolkit View":
Note this is how we match the rule target's dataview name and the rowname in the "Dataview Status Toolkit View" to grab the corresponding "Rule Status" value.
- Go to the Rule's Advanced tab and click "Add new" in the Path alias section
- Name the path alias "rule_status"
- Drag and drop the "Rule Status" cell from any row in the "Dataview Status Toolkit View" to the xpath field.
- Click the "EDIT..." button next to the Xpath
- Hover over the Row element and click "EDIT"
- In the Element Properties window, set the name to "$rowname"
- Close the Element Properties window
- Click the "OK" button in the Edit Path window
Add logic in the rule block to determine if the rule is active depending on the path alias value:
Now that we have the "rule_status" path alias set in the advanced tab, we can now reference it in the rule block. In the example rule block we are setting a variable called $(rulestat) that references the "rule_status" path alias.
set $(rulestat) path "rule_status" value
In this rule, we are looking to only set the cell to critical if the status contains a string like *NOT_FOUND* or *FAIL* and "Rule Status" cell for the corresponding dataview is set to "Active." The elseif block is adjusted as follows:
elseif $(rulestat) = "Active" and value like "*NOT_FOUND*" or value like "*FAIL*" then
Below is the adjusted rule block:
If you take a look at the FKM dataviews now, notice each dataview sets the status to critical now based on the "Rule Status" value.
Rule XML is attached below.
Related Articles
If you have follow up questions about this FAQ:
- Please contact with our Client Services team via the chat service box available in any of our websites or via email to support@itrsgroup.com
- Make sure you provide to us:
- SAMPLER AND RULE XML
- ANY SCREENSHOT
-
Tags:
- gateway
- Gateway
- rule
- rules
Comments
0 comments
Please sign in to leave a comment.