Share via


rule Element

Defines an action invoked after an event has occurred in the form.

Type

  xsd:complexType

Child Elements

Element Description
assignmentAction Defines an action to set the value of a field.
closeDocumentAction Defines a form close action.
dialogBoxExpressionAction Defines an XPath expression to be displayed in a dialog box.
dialogBoxMessageAction Defines a literal message to be displayed in a dialog box.
exitRuleSet An element which, if present at the end of the rule, stops further rule processing of the entire ruleSet when the rule is executed.
openNewDocumentAction Defines a form create action.
queryAction Defines a data connection query action.
submitAction Defines a form submit action.
switchViewAction Defines a view switch action.

Attributes

Attribute Type Required Description Possible Values
caption
  xsd:string
Yes Contains the name of the rule as it appears in the user interface. string
  xsd:string
condition
  xsd:string
No Defines the XPath expression, evaluated as a Boolean value, that determines whether the associated action will be invoked. string
  xsd:string
isEnabled
  xdYesNo
No Specifies whether the rule is enabled for the form. The default value is "yes".
  • yes
  • no
  xdYesNo

Definition

  <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:attribute>
          </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>
    <xsd:attribute name="condition" type="xsd:string" use="optional"></xsd:attribute>
    <xsd:attribute name="isEnabled" type="xsf:xdYesNo" use="optional" default="yes"></xsd:attribute>
  </xsd:complexType>
</xsd:element>

Remarks

Example

The following is an example of the rule element:

  <xsf:ruleSets>
 <xsf:ruleSet name="RuleSet1">
  <xsf:rule caption="Receipts" condition="my:expense> 75">
   <xsf:dialogBoxMessageAction>Don't forget receipts!</xsf:dialogBoxMessageAction>
    <xsf:openNewDocumentAction solution="urn:approvalForm"/>
    <xsf:exitRuleSet/>
  </xsf:rule>
  <xsf:rule caption="Always Submit" isEnabled="no">
   <xsf:submitAction adapter="Expense Database"/>
  </xsf:rule>
 </xsf:ruleSet>

<xsf:ruleSet name="RuleSet2"> <xsf:rule caption="Look up contact"> <xsf:queryAction adapter="Contacts"/> </xsf:rule> </xsf:ruleSet> </xsf:ruleSets>