Concrete syntax

You define concrete syntax in a .properties file. This file defines how language elements of the abstract syntax are displayed and edited.

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.

The concrete syntax is a property file that defines how language elements of the abstract syntax are displayed and edited.

You define the concrete syntax of a language by assigning text properties to the types and elements that are defined in the abstract syntax. Some properties are specific to a particular type or element, and others can be assigned to more than one type or element. The concrete syntax also has global properties that are not assigned to any types.

You set these properties using the standard Java™ property file syntax, in a file with the extension .properties. This file must have the same name as the abstract syntax file and must be kept in the same directory.

You set a property in the concrete syntax property file as follows:

<T-condition>.newline = true

This setting means that the common property newline is set to literal for the choice type condition, and when a condition is created in a rule it is automatically preceded by a newline character.

The following examples show some concrete syntax properties defined for the condition choice type:

<T-condition>.newline = true
<T-condition>.emptyText = <select a condition>
<T-condition>.toolTip = Add a Condition
<T-condition>.label = condition

You can assign properties directly to an element in a sequence or a choice type, instead of assigning it to the type itself. In this case, the properties assigned to the element take precedence over the properties assigned to the type.

An element is identified in the property file as:

<complexTypeName>.<elementName>

Take the following abstract syntax as an example:

<complexType name="T-condition">
   <sequence>
      <element name="class" type="class">
      <element name="binding" type="binding">
      <element name="tests" type="test-list">
   </sequence >
</complexType>

If you define the newline property on the <T-test-list> type, all sequences of type <T-test-list> have the newline property. You can redefine this property locally in the <T-condition>sequence type as follows:

<T-condition>.<T-tests>.newline = false

In this case, the tests element in a condition has no newline property.

When the value of a property is enclosed in double quotes "...", the quotes are ignored, and the full string between the quotes is taken to be the value of the property. You can thus use quotes to include leading or trailing spaces in a string:

<T-example>.text = "    <...>    "

If you want to start or end the text with double quotes, you must include them within double quotes as follows:

<T-example>.text = "" <...> ""