The Rules section of the Rule Editor lets you create and group rules together based on the Boolean operators AND or OR that tell the system which keywords the portlet’s content must include or exclude before the portlet’s agent executes.
AND or OR– use these operators to specify what terms must appear in the selected portlet’s content. When you click the plus sign to save the rule, then click OK, the rule is summarized on the Rule tab. For example,
If you set the rule as:
The rule will execute this agent when 'Maturity' equals (text) '3 Month' AND label 'Yield' is greater than '0.5'
Then the bond portlet meets the rule, and the actions can be executed.
If you set the rule as:
The rule will execute this agent when 'Maturity' equals (text) '3 Month' AND label 'Yield' is greater than '1'
Then this bond portlet does not meet the rule, and the actions will not be executed.
If you set the rule as:
The rule will execute this agent when 'Maturity' equals (text) '3 Month AND 6 Month'
Then this bond portlet does not meet the rule, and the actions will not be executed.
If you set the rule as:
The rule will execute this agent when'Maturity' equals (text) '3 Month' OR 'Maturity' equals (text)'6 Month'
Then this bond portlet meets the rule, and the actions can be executed.
The relational operators that appear in the 2nd rule box are:
equals (number) – converts the portlet data into floating point numbers for the equals comparison. If the data is not numeric, the comparison fails.
is greater than – converts the portlet data into floating point numbers for the greater than comparison. If the data is not numeric, the expression returns false. The portlet data must be greater than the value supplied in the rule’s text field.
is less than – converts the portlet data into floating point numbers for the less than comparison. If the data is not numeric, the expression returns false. The portlet data must be less than the value supplied in the rule’s text field.
equals (text) – compares the portlet data to the text supplied in the rule’s text field. If they are equal, the expression returns true.
contains – returns true if the portlet data contains the text string supplied in the rule’s text field.
starts with – returns true if the portlet data starts with the text string supplied in the rule’s text field.
ends with – returns true if the portlet data ends with the text string supplied in the rule’s text field.
matches RegExp – returns true if the portlet data matches the regular expression supplied in the rule’s text field. To understand the format of regular expressions, see the documentation .
contains data – checks the portlet to see if any data has a size greater than zero. The rule’s text field is disabled for this option.
contains no data – is the opposite of “contains data.” Checks the portlet to see if any data has a size equal to zero. The rule’s text field is disabled for this option.
is found – used with XPath. Returns true if the XPath expression resolves to a XML node or attribute.
is not found – used with XPath. This operator is the opposite of “is found.” Returns true if the XPath expression does not resolve to a XML node or attribute.
Basing rules on criteria
Basing a rule on criteria allows you to execute a rule on a selection of portlets that meet user-specified parameters; for example, to execute the rule on portlets owned only by a particular user.
This procedure describes how to set up an agent to find portlets in which one-click content capture has failed and the portlets are broken.
In the Rule Editor, select Criteria and click Select. You see the Add Content by Criteria window.
To complete the Criteria Parameters, select:
Category – find portlets only in the selected category.
Subcategory – find portlets that are only in the selected subcategory.
Status – find portlets that only have the selected status.
Catalog – find portlets that are only in the catalog you select.
Page – find portlets that are only on the page you select.
Owner – find portlets that only belong to the user whose name you enter.
Modified By – find portlets that only belong to the user whose name you enter.
Roles – find portlets that are assigned only those roles you select in the Available Roles list and move to the Assigned Roles list.
Click OK to save the criteria and return to the Rule Editor, which populates the Name drop-down list for Preview Source with all items that meet the selected criteria at that moment.
In the Rules section, select xpath and enter this execution statement:
'//ContentDoc/Element/text( )' equals (text) 'ERROR'
and click OK.
The rule has been set up to check for a particular type of error by looking at the XML returned from the portlet when it fails. The XML for this portlet displays as:
<?xml version="1.0" encoding="UTF-8 ?> -<ContentDoc> <Element name=”bonds2”>ERROR</Element> </ContentDoc>
Copyright © 2004. Sybase Inc. All rights reserved. |
![]() |