Home > Data Model Assistant

Define Advanced Constraints

In this section, we will present how to enrich the model with extended functionalities that XML Schema does not natively support.

Foreign key constraints

Previously, we have learned how to implement the primary keys for all table type elements in our schema. A reference to a table (foreign key) is defined using an advanced constraint.

As an example, we want to ensure that every pub_id entry in table Titles refers to a pub_id entry in table Publishers

See also:

In the data structure tree, select the pub_id attribute under the Titles element, then the Advanced Constraints section:

At this step, we may specify:

Dynamic constraints

EBX.Platform provides additional constraints that are not specified in XML Schema, i.e. dynamic constraints. A dynamic constraint is declared on an element, and references another one, semantically linking the two.

As an example, we want to ensure that, in the Royalties table, the lo_range value is always lower than the hi_range value.

We define a dynamic constraint on the lo_range element, referencing the hi_range element:

Note:

Resource constraint

Sometimes, it may be useful to declare an external resource in the model. For instance, an image or HTML resource can enhance the look and feel of an instance screen in EBX.Manager.

In our sample model, we add to the Titles table a field called front_picture , which refers to an image, e.g. the front page of the book.

See also:

We input the properties of the resource constraint:

Home > Data Model Assistant