Complex types

An abstract syntax schema comprises a number of complex types, such as choice, sequence, or terminal.

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.

Choice type

A choice type is a complex type that defines a choice between elements. A choice type is represented by a drop-down list in the rule editors.

The following example shows a choice type:

<complexType name="T-condition">
   <choice>
     <element name="simple-condition" type="T-simple-condition"/>
     <element name="exists-condition" type="T-exists-condition"/>
     <element name="not-condition" type="T-not-condition"/>
     <element name="evaluate-condition" type="T-evaluate-condition"/>
   </choice>
</complexType>

A choice type is displayed as follows in the Guided Editor:

Selecting using the guided editor

A choice type contains only one <choice> element, whose minOccurs and maxOccurs attributes are equal to 1 (the default). The body of the <choice> element can contain only elements. It cannot, for example, contain a <choice> or a <sequence> element.

Sequence type

A sequence type is a complex type that defines a sequence of elements. A sequence type represents a list of elements that is displayed if the sequence type is added to a rule.

The following example shows a sequence type:

<complexType name="T-exists-condition">
  <sequence>
    <element name="class" type="T-class"/>
    <element name="tests" type="T-test" minoccurs="0" maxoccurs="unbounded"/>
  </sequence>
</complexType>

This example sequence type displays as follows in the guided editor:

Sequence type in the guided editor

A sequence type contains only one <sequence> element. The body this <sequence> element can contain only elements.

Terminal type

A terminal type is a complex type that contains no elements. It can contain text or be empty. A terminal type that contains text is defined as a restriction of the built-in string type. The terminal type provides a list of choices, such as a list of terms or phrases.

The following example shows a terminal type that contains text:

<complexType name="T-class">
  <simpleContent>
    <restriction base="string"/>
  </simpleContent>
</complexType>

You can specify choices to define what a terminal type that contains text should list in the rule editors. You specify these choices using the choices property.

The choices are:

  • concepts: for listing vocabulary terms

  • variables: for listing the variables that are currently available in the rule