Skip to main content

ElementClasses

An ElementClass describes the role and properties of a class of elements.

  • The ElementClass can declare Attributes, properties with simple data types.
  • Between ElementClasses you can have References, which always have an owner and a target.
model/elementClasses/Script.xml
<elementClass name="Script">
<group name="org.normalizedsystems.scripts" ontology="demo"/>
<role name="element"/>
<attributes>
<attribute name="name">
<isIdentifier>true</isIdentifier>
<dataType name="Name" ontology="demo"/>
</attribute>
<attribute name="command">
<dataType name="Text" ontology="demo"/>
</attribute>
<attribute name="helpText">
<dataType name="Text" ontology="demo"/>
</attribute>
</attributes>
</elementClass>

Attributes

  • isRequired: Adds checks to make sure the attribute is always defined.
  • isIdentity: Uses this attribute to identify instances of the ElementClass (see identity).
  • isDerived: For attributes that are not defined in the model files, but are derived from other properties. You can provide the values for these attributes with a ModelLoadingListener that attaches to the EnrichModel step.

Data Types

  • DataTypes are defined inside the Ontology where they are used.
  • Data types are linked to a PrimitiveType, e.g. String, Boolean, Integer, Double...
  • PrimitiveType BigString is the same as String, but visualized differently.
  • String DataTypes can define a Format, like CamelCase, PascalCase etc.
Custom formats

Formats are defined as a DataResource. New formats can be introduced with an expansion-resource.

Element Groups

Each ElementClass references an ElementGroup, which is part of the same ontology. The ElementGroup defines a package for all of its ElementClasses.