Home > Data Model Assistant

Define Simple Constraints

In this section, we will see how to enrich the model with simple constraints natively supported by XML Schema.

See the simple constraints supported by EBX.Platform for more informations.

For this section and the following chapters, we use the example of a publications model.

The publications model consists of four tables:

Here is a brief description of each table:

We will add to the publishers table the following attributes and constraints:

Let’s start with the pub_id attribute. In the data structure tree, select the pub_id attribute, then the Simple Constraints section:

To specify that the pub_id attribute is mandatory, the value of its minOccurs property has to be set to 1 or higher. The mandatory property can also be specified while creating the attribute. On the opposite, an attribute is declared optional if its minOccurs property is not set, or if it is set to 0.

At this step, we specify that the pub_id attribute has to contain at most 4 characters and must follow a specific pattern:

Note: Depending on the type of the element, some other constraints may be available, e.g. it is possible to define restrictions on integers such as the minimum or the maximum allowed value.

Home > Data Model Assistant