Abstract syntax as an XML schema

The XML schema for abstract syntax is composed of complex types.

Deprecated feature:

Deprecation icon Support for custom business rule languages is deprecated in V8.8.1. This feature will be removed in a future release of the product. See Deprecated features for migration details.

You define the abstract syntax of a business rule language as an XML Schema (.xsd file). The complex types in this schema represent the constructs of the language.

The following example shows a complex type that defines a language construct named rule:

<complexType name="T-rule">
  <sequence>
     <element name="condition" type="T-condition" 
              minOccurs="1" maxOccurs="unbounded"/>
     <element name="action" type="T-action" 
              minOccurs="0" maxOccurs="unbounded"/>
  </sequence>
</complexType>

This definition means that a rule contains at least one condition and any number of actions. It assumes that the complex types named condition and action are defined elsewhere in the schema.

The abstract syntax of a language uses a strict subset of the full XML Schema syntax. A schema representing an abstract syntax consists of a list of complex type definitions, as well as some elements that represent the root elements of the language.

The following example shows an outline of an abstract syntax schema:

<?xml version="1.0"?>
<schema>
  <!-- Type definitions -->
  <complexType name="T-rule">
    ...
  </complexType>
  <complexType name="T-condition">
    ...
  </complexType>
  <complexType name="T-action">
    ...
  </complexType>
  <!-- Root element -->
  <element name="MyRule" type="T-rule"/>
</schema>

To prevent mixing names and types in a schema file, you can prefix the names of the types, for example, with T-:

<complexType name="T-condition"> ....
<element name=condition" type="T-condition">