Solution
This is an alternative to linking an active time to a rule or disabling/enabling a rule in the Gateway Setup Editor. This solution entails creating a custom dataview with a "dataview name" and "rule status" columns, and having a new or existing rule reference the "rule status" value using a path alias and path variable. Once referenced, you can adjust the logic in the rule to trigger based on the dataview's rule status value.
Below is an example FKM rule where we set the FKM status cell to critical if the status contains a string like "NOT_FOUND" or "FAIL." Notice this rule targets the status columns on both the "Beta FKM" and "Generic_FKM_Testing_Sampler" dataviews.
Let's say we 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 dataview's "Rule Status" value. 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
- Set the path variable name to "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 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:
Notice each dataview now sets the status to critical now based on the "Rule Status" value as well.
Rule XML is attached below.
Related Articles
If you have follow up questions about this FAQ:
- Please contact our Client Services team via the chat service box available in any of our websites or email us at support@itrsgroup.com
- Make sure you provide to us:
- Sampler and rule XML used for your example.
- Screenshots of the "Show Rules" output of the rule you set up
- Description of which part of the rule you are having issues setting up, or not working
Comments
0 comments
Please sign in to leave a comment.