2.2.133 rule

The rule element specifies a rule, which is composed of the rule definition and the event by which the rule is called. The rule definition is defined by the rule elements and the ruleSet elements (section 2.2.143). The event is defined by the button (section 2.2.110), domEventHandler (section 2.2.66), onLoad (section 2.2.79), and submit (section 2.2.72) elements and their associated ruleSetAction element (section 2.2.132).

A rule (1) consists of the following:

  • A set of one or more actions.

  • A condition that determines whether the actions are executed.

If the associated condition of the rule evaluates positively with the true function specified in [XPATH] section 4.3, the actions associated with the rule are processed sequentially in the order in which they are listed in the rule element.

           Rules are grouped together as a rule set, as specified by the ruleSet element, containing one or more rules. A rule set is bound to one of the following events with the ruleSetAction element:

  • A form file change, such as a change in the value of an XML node.

  • A form action, such as submitting the form file.

  • An unbound control event, such as a button click event.

Each rule set is processed sequentially in the order in which they are listed within the ruleSets element (section 2.2.144).

Parent Elements

ruleSet

Child Elements

assignmentAction

closeDocumentAction

dialogBoxExpressionAction

dialogBoxMessageAction

exitRuleSet

openNewDocumentAction

queryAction

submitAction

switchViewAction

Attributes:

caption: This attribute specifies the name of the rule (1).

condition: This attribute specifies an XPath expression that MUST evaluate to either "true()" or "false()". If it evaluates to "true()", the associated actions MUST be executed. If this attribute is not present, its value MUST be interpreted as "true()".

isEnabled: This attribute specifies if the rule (1) MUST be enabled for the form (1). If this attribute is not present, its value MUST be interpreted as "yes".

The following W3C XML Schema ([XMLSCHEMA1] section 2.1) fragment specifies the contents of this element.

 <xsd:element name="rule">
   <xsd:complexType>
     <xsd:sequence>
       <xsd:choice minOccurs="0" maxOccurs="unbounded">
         <xsd:element ref="xsf:dialogBoxMessageAction"/>
         <xsd:element ref="xsf:dialogBoxExpressionAction"/>
         <xsd:element ref="xsf:switchViewAction"/>
         <xsd:element ref="xsf:assignmentAction"/>
         <xsd:element ref="xsf:queryAction"/>
         <xsd:element name="submitAction">
           <xsd:complexType>
             <xsd:attribute name="adapter" type="xsf:xdTitle" use="required"/>
           </xsd:complexType>
         </xsd:element>
         <xsd:element ref="xsf:openNewDocumentAction"/>
         <xsd:element ref="xsf:closeDocumentAction"/>
       </xsd:choice>
       <xsd:element name="exitRuleSet" minOccurs="0">
         <xsd:complexType/>
       </xsd:element>
     </xsd:sequence>
     <xsd:attribute name="caption" type="xsd:string" use="required"/>
     <xsd:attribute name="condition" type="xsd:string" use="optional"/>
     <xsd:attribute name="isEnabled" type="xsf:xdYesNo" use="optional" default="yes"/>
   </xsd:complexType>
 </xsd:element>