Skip Headers
Oracle® Database Rules Manager and Expression Filter Developer's Guide
11g Release 1 (11.1)

B31088-01
Go to Documentation Home
Home
Go to Book List
Book List
Go to Table of Contents
Contents
Go to Index
Index
Go to Master Index
Master Index
Go to Feedback page
Contact Us

Go to previous page
Previous
Go to next page
Next
PDF · Mobi · ePub

F XML Schemas

The following XML Schemas for the rule class properties and the rule conditions can be used to build authoring tools for rule management:

Rule Class Properties

<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
            xmlns:xdb="http://xmlns.oracle.com/xdb"
            xmlns:rlmp="http://www.oracle.com/rlmgr/rsetprop.xsd"
            elementFormDefault="qualified"
            targetNamespace="http://www.oracle.com/rlmgr/rsetprop.xsd">
<xsd:element name="simple" type="rlmp:SimpleRuleSetProp"/>
<xsd:element name="composite" type="rlmp:CompositeRuleSetProp">
  <xsd:unique name="objtype">
    <xsd:selector xpath="./*"/>
    <xsd:field xpath="@type"/>
  </xsd:unique>
</xsd:element>

<!-- Properties of a rule class with simple events -->
<xsd:complexType name="SimpleRuleSetProp">
  <xsd:complexContent>
    <xsd:restriction base="xsd:anyType"> <!-- empty element -->
      <xsd:attribute name="ordering" type="xsd:string"/>
      <xsd:attribute name="storage" type="xsd:string"/>
      <xsd:attribute name="autocommit">
        <xsd:simpleType>
          <xsd:restriction base="xsd:string">
            <xsd:enumeration value="yes"/>
            <xsd:enumeration value="no"/>
          </xsd:restriction>
        </xsd:simpleType>
      </xsd:attribute>
      <xsd:attribute name="dmlevents">
        <xsd:simpleType>
          <xsd:restriction base="xsd:string">
            <xsd:enumeration value="I"/>
            <xsd:enumeration value="IU"/>
            <xsd:enumeration value="IUD"/>
          </xsd:restriction>
        </xsd:simpleType>
      </xsd:attribute>
      <xsd:attribute name="cnfevents">
        <xsd:simpleType>
          <xsd:restriction base="xsd:string">
            <xsd:enumeration value="I"/>
            <xsd:enumeration value="IU"/>
            <xsd:enumeration value="IUD"/>
          </xsd:restriction>
        </xsd:simpleType>
      </xsd:attribute>
      <xsd:attribute name="consumption">
        <xsd:simpleType>
          <xsd:restriction base="xsd:string">
            <xsd:enumeration value="exclusive"/>
           <xsd:enumeration value="shared"/>
           <xsd:enumeration value="rule"/>
         </xsd:restriction>
       </xsd:simpleType>
     </xsd:attribute>
   </xsd:restriction>
  </xsd:complexContent>
</xsd:complexType>
<xsd:group name="ObjectOrCollectionProp">
   <xsd:choice>
     <xsd:element name="object" type="rlmp:PrimEventProp"
                minOccurs="0" maxOccurs="1"/>
     <xsd:element name="collection" type="rlmp:CollectionProp" 
                minOccurs="0" maxOccurs="1"/>
  </xsd:choice>
</xsd:group>

<!-- Properties of a rule class with composite events -->
<xsd:complexType name="CompositeRuleSetProp">
  <xsd:sequence>
    <xsd:group ref="rlmp:ObjectOrCollectionProp" minOccurs="0"
                 maxOccurs="unbounded"/>
  </xsd:sequence>
  <xsd:attribute name="ordering" type="xsd:string"/>
  <xsd:attribute name="storage" type="xsd:string"/>
  <xsd:attribute name="autocommit">
    <xsd:simpleType>
      <xsd:restriction base="xsd:string">
        <xsd:enumeration value="yes"/>
        <xsd:enumeration value="no"/>
      </xsd:restriction>
    </xsd:simpleType>
  </xsd:attribute>
  <xsd:attribute name="equal" type="xsd:string"/>
  <xsd:attribute name="consumption">
    <xsd:simpleType>
      <xsd:restriction base="xsd:string">
        <xsd:enumeration value="exclusive"/>
        <xsd:enumeration value="shared"/>
      </xsd:restriction>
    </xsd:simpleType>
  </xsd:attribute>
  <xsd:attribute name="duration">
    <xsd:simpleType>
      <xsd:restriction base="xsd:string">
        <xsd:pattern value="call"/>
        <xsd:pattern value="([1-9]|[1-9][0-9]|[1-9][0-9]{2}|[1-9][0-9]{3})
                                                   (minutes|hours|days)"/>
      </xsd:restriction>
    </xsd:simpleType>
  </xsd:attribute>
</xsd:complexType>

<!-- Primitive event properties with a composite event/rule class -->
<xsd:complexType name="PrimEventProp">
  <xsd:complexContent>
    <xsd:restriction base="xsd:anyType">
      <xsd:attribute name="type" type="xsd:string" use="required"/>
      <xsd:attribute name="consumption">
        <xsd:simpleType>
          <xsd:restriction base="xsd:string">
            <xsd:enumeration value="exclusive"/>
            <xsd:enumeration value="shared"/>
          </xsd:restriction>
        </xsd:simpleType>
      </xsd:attribute>
    <xsd:attribute name="duration">
      <xsd:simpleType>
        <xsd:restriction base="xsd:string">
          <xsd:pattern value="transaction"/>
          <xsd:pattern value="session"/>
          <xsd:pattern value="([1-9]|[1-9][0-9]|[1-9][0-9]{2}|[1-9][0-9]{3})
                                                     (minutes|hours|days)"/>
        </xsd:restriction>
      </xsd:simpleType>
     </xsd:attribute>
    </xsd:restriction>
   </xsd:complexContent>
  </xsd:complexType>
  <xsd:complexType name="CollectionProp">
    <xsd:complexContent>
      <xsd:restriction base="xsd:anyType">
        <xsd:attribute name="type" type="xsd:string" use="required"/>
        <xsd:attribute name="groupby" type="xsd:string"/>
        <xsd:attribute name="compute" type="xsd:string"/>
      </xsd:restriction
    </xsd:complexContent>
  </xsd:complexType>
</xsd:schema>

Rule Condition

<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
            xmlns:xdb="http://xmlns.oracle.com/xdb"
            xmlns:rlmc="http://www.oracle.com/rlmgr/rulecond.xsd"
            elementFormDefault="qualified"
            targetNamespace="http://www.oracle.com/rlmgr/rulecond.xsd">

      <xsd:element name="condition">
        <xsd:complexType mixed="true">
          <xsd:choice>
            <xsd:element name="and" type="rlmc:AndType"
                                    minOccurs="0" maxOccurs="1"/>
            <xsd:element name="any" type="rlmc:AnyType"
                                    minOccurs="0" maxOccurs="1"/>
            <xsd:element name="object" type="rlmc:ObjectCondType"
                                    minOccurs="0" maxOccurs="1"/>
          </xsd:choice>
        </xsd:complexType >
        <xsd:unique name="objNamesAny">
          <xsd:selector xpath=".//object"/>
          <xsd:field xpath="@name"/>
        </xsd:unique>
      </xsd:element>
      <xsd:group name="ObjectOrCollectionCondition">
        <xsd:choice>
          <xsd:element name="object" type="rlmc:ObjectCondType" 
                       minOccurs="1" maxOccurs="1"/>
          <xsd:element name="collection" type="rlmc:CollectionCondType"
                       minOccurs="1" maxOccurs="1"/>
        </xsd:choice>
      </xsd:group>

      <xsd:complexType name="AndType">
        <xsd:sequence>
          <xsd:group ref="rlmc:ObjectOrCollectionCondition"
                       minOccurs="1" maxOccurs="unbounded"/>
          <xsd:choice>
            <xsd:element name="not" type="rlmc:NotCondType"
                       minOccurs="0" maxOccurs="1"/>

            <xsd:element name="notany" type="rlmc:NotAnyCondType"
                       minOccurs="0" maxOccurs="1"/>

          </xsd:choice>
        </xsd:sequence>
        <xsd:attribute name="join" type="xsd:string"/>
        <xsd:attribute name="equal" type="xsd:string"/>
        <xsd:attribute name="having" type="xsd:string"/>
        <xsd:attribute name="sequence">
          <xsd:simpleType>
            <xsd:restriction base="xsd:string">
              <xsd:enumeration value="yes"/>
              <xsd:enumeration value="no"/>
            </xsd:restriction>
          </xsd:simpleType>
        </xsd:attribute>
      </xsd:complexType>

      <xsd:complexType name="NotCondType">
        <xsd:sequence>
          <xsd:element name="object" type="rlmc:ObjectCondType"
                       minOccurs="0" maxOccurs="1"/>
        </xsd:sequence>
        <xsd:attribute name="by" type="xsd:string"/>
        <xsd:attribute name="join" type="xsd:string"/>
      </xsd:complexType>

      <xsd:complexType name="NotAnyCondType">
        <xsd:sequence>
          <xsd:element name="object" type="rlmc:ObjectCondType" minOccurs="1"
                       maxOccurs="unbounded"/>
        </xsd:sequence>
        <xsd:attribute name="count" type="xsd:positiveInteger"/>
        <xsd:attribute name="by" type="xsd:string"/>
        <xsd:attribute name="join" type="xsd:string"/>
      </xsd:complexType>

      <xsd:complexType name="AnyType">
        <xsd:sequence>
          <xsd:element name="object" type="rlmc:ObjectCondType" minOccurs="1"
                       maxOccurs="unbounded"/>
        </xsd:sequence>
        <xsd:attribute name="count" type="xsd:positiveInteger"/>
        <xsd:attribute name="join" type="xsd:string"/>
        <xsd:attribute name="equal" type="xsd:string"/>
        <xsd:attribute name="sequence">
          <xsd:simpleType>
            <xsd:restriction base="xsd:string">
              <xsd:enumeration value="yes"/>
              <xsd:enumeration value="no"/>
            </xsd:restriction>
          </xsd:simpleType>
        </xsd:attribute>
      </xsd:complexType>
      <xsd:complexType name="ObjectCondType">
        <xsd:simpleContent>
          <xsd:extension base="xsd:string">
            <xsd:attribute name="name" type="xsd:string" use="required"/>
           <xsd:attribute name="ref" type="xsd:string"/>
          </xsd:extension>
        </xsd:simpleContent>
      </xsd:complexType>
 
      <xsd:complexType name="CollectionCondType">
        <xsd:simpleContent>
          <xsd:extension base="xsd:string">
            <xsd:attribute name="name" type="xsd:string" use="required"/>
            <xsd:attribute name="groupby" type="xsd:string" use="required"/> 
            <xsd:attribute name="having" type="xsd:string"/>
            <xsd:attribute name="compute" type="xsd:string"/>
            <xsd:attribute name="windowsize" type="xsd:string"/>
            <xsd:attribute name="windowlen" type="xsd:string"/>
          </xsd:extension>
        </xsd:simpleContent>
      </xsd:complexType>
   </xsd:schema>