Skip to content

Domain Specific Languages

DSLs are the basis of the web modeler. Without a DSL you cannot do anything useful with the web modeler. The web developer has some predefined DSLs to your service. An account administrator can select DSLs to be used by her organization with the help of the Active DSLs View.

An organization can also come up with its own DSLs. Those can be either completely separate from the predefined DSLs or they extend those. When you create a DSL you can add the following things. In the domain of modeling languages one speaks of defining a so-called “meta model” when someone defines such things. Every created definition is called a “concept” of the DSL.

Thing/Concept Purpose
Element Definition An element definition defines the type of a model element.
Option Definition An option definition defines an option that a model element can have.
Link Definition A link definition defines how elements are getting linked to each other.

For every concept you define, you have to set a name and a code. The name is what a user of the web modeler sees when working with models. The name of an element definition is for instance the type of a model element. The code is what is being used in code generators, to identify the type of a model element, option or link. The code cannot be modified once the concept has been saved, otherwise code generators wouldn’t work anymore after such a modification. The name can be modified at any time, though.

Whitespaces in Names

It is perfectly fine to use whitespaces for the names of concepts. Those names are meant to be read by human beings. This makes DSLs more comprehensible compared to textual DSLs, where there typically is a limitation for such names (= keywords).

In addition to the aforementioned definitions, you can define rules and constraints for a DSL. These rules and constraints determine whether a model is valid or not. In the world of textual DSLs one would talk about “syntax rules”. The web modeler makes use of the rules and constratins while you edit a model.

It is possible that rules and constraints change over time. When this happens, it is possible that existing models become syntactically incorrect. You can use the Module Validation View to validate your organization’s modules. That view supports you to rectify incorrect modules by providing appropriate links to the Element Wizard View to fix the model elements.

Rules

A rule can be defined for an option definition or a link definition. It defines, which model elements can own an option/link (= owner rule) and which can be the target of a link (= target rule). If an option definition doesn’t have any owner rule defined, then the option can be set for any model element, regardless of its type. And if a link definition doesn’t have any target rule defined, then the link can point to any model element, regardless of its type.

Multiple Rules

When there is constellation where more than one rule has to be applied to the model, the rules are combined with OR semantics.

Constraints

While rules are a kind of “positive” thing (they define what is allowed), constraints have the opposite purpose. Defining constraints limits the number of constellations where an option or a link can be set. A constraint is bound to an option definition or a link definition.

Multiple Constraints

When there is constellation where more than one constraint has to be applied to the model, the constraints are combined with AND semantics.

There are 4 different kinds of constraints:

Constraint Type Description
for an element The related option/link can only be used for an element, when that element has a link to a specific other element.
for a source element The related option/link can only be used for an element when that element has a link that leads from a specific other element to the element.
for a target rule The related option/link can only be used for an element, when that element has a link to another element by means of a specific target rule.
for an option The related option/link can only be used for an element, when that element has an option set to a specific value.

There are more rules and constraint types planned. Here are a few examples:

  • define more rules to determine the set of possible elements that can be set for a link