Customizing the syntax

You customize the syntax by including or redefining an existing abstract syntax schema.

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.

When you define a business rule language, you can reuse the types that have been defined for another language, such as the BAL, or you can redefine them.

Including an existing abstract syntax schema

To reuse existing abstract syntax types, you include another abstract syntax schema when defining the abstract syntax of your business rule language.

To include another abstract syntax schema, you use the XML <include> statement:

<include schemaLocation="SchemaName.xsd"/>

This statement includes the referenced schema as though it has been inserted at the include statement position. You can thus use the types defined in the included schema as if they were defined in your schema.

The schema files included in the abstract syntax schema file of your business rule language must be accessible from the class path of your application.

The concrete syntax, in the form of property files, of the included language is also loaded when the included schema is loaded. You can redefine any property attached to any of the included types.

You can change the wording of any part of a rule, by redefining the text property of the corresponding element. For example, if you want to rephrase the binding of a variable in the definitions part of a rule to define <variable> as <value> instead of set <variable> to <value>, you can import the file bindings.xsd and redefine the text property of the T-binding element as follows:

<T-binding>.text = define <variable> as <binding-type> <test> ;

Redefining an existing abstract syntax schema

You can also redefine the types that have been defined for another language. To redefine types, you use the XML <redefine> statement:

<redefine schemaLocation="SchemaName.xsd">
  <...>
</redefine>

This statement includes the referenced schema as though it has been inserted with an include statement position. In addition, you can redefine any type within this statement. You can add or remove elements from a choice type or a sequence type.

As with an include statement, the schema files included in the abstract syntax schema file of your business rule language must be accessible from the class path of your application.

When redefining a choice, you must list all the elements that were previously defined on this choice, and then add your own elements.

The XML schema syntax for redefining an element named element-name is:

<complexType name="element-name">
   <complexContent>
      <extension base="element-name">
   ...list the sub elements of your redefined element...
      </extension>
   </complexContent>
</complexType>

As with the include statement, the concrete syntax property files of the redefined language are also loaded when the schema is loaded. You can redefine any property attached to any of the redefined types.