rule Element
Defines an action invoked after an event has occurred in the form.
Type
Child Elements
Attributes
caption |
|
Yes |
Contains the name of the rule as it appears in the user interface. |
string |
xsd:string
|
|
|
|
|
condition |
|
No |
Defines the XPath expression, evaluated as a Boolean value, that determines whether the associated action will be invoked. |
string |
xsd:string
|
|
|
|
|
isEnabled |
|
No |
Specifies whether the rule is enabled for the form. The default value is "yes". |
|
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>
|
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>
|