Model Extensions (MEX)

The AUTOSAR model can be extended via Model Extensions to support the type-safe editing of predefined AdminData.

Workflow

With Model Extensions, the AUTOSAR model can be extended with additional attributes, references, and child classes for existing meta classes or even with new meta classes. To use Model Extensions in the model, the according SdgDef elements need to be created, which define the meta class to extend and the additional features.

The Model Extensions defined in a SdgDef are only available in the DML after a reload of the model. This can be achieved by closing and reopening the project or by restarting the DaVinci Developer Adaptive application. To be able to directly edit the AdminData content, the preset filter must be removed in the DML Editor (see DaVinci Modeling Language Editor ).

Available Elements

Extension Definitions

  • These are SdgDef elements which define the extendsMetaClass attribute for a valid meta class of the AUTOSAR model (for example Executable).

Meta Class Definitions

  • These are SdgDef elements which do not define the extendsMetaClass attribute.

  • Can be used to define sub-classes in Extension Definitions.

Available Element Features

extendsMetaClass

  • The AUTOSAR meta class that shall be extended by this SdgClass.

attributes

  • Describes the list of attributes of the meta class to extend.

descEN

  • The description for this SdgClass.

  • Descriptions can contain Markdown content which will be recognized by the DML.

  • Note that other languages are available as well; English is the default.

  • Note that this description will not override the description of the meta class to extend and is only used for information purposes.

caption

  • Specifies if a caption is required.

  • Note that only SdgClasses that have a caption can be referenced.

  • Note that this only has an effect for Meta Class Definitions.

Available Attributes

SdgPrimitiveAttribute

  • Used to define a simple attribute for a SdgDef element (for example Integer, Boolean, String).

SdgAggregationWithVariation

  • Used to define child relations like single children and lists of sub classes defined by Meta Class Definitions.

SdgReference

  • Used to define child relations like single children and lists of references to other SdgClasses.

SdgForeignReference

  • Used to define child relations like single children and lists of references to any AUTOSAR meta classes.

Available Attribute Features

lowerMultiplicity

  • Specifies the minimal number of times an object shall occur. If this primitive attribute is not set or 0, then the object is optional.

upperMultiplicity

  • Specifies the maximum number of times an object may occur. If this primitive attribute is not set, then there is no limit with respect to the maximum occurrence. For an unspecified amount please use upperMultiplicityInfinite instead.

upperMultiplicityInfinite

  • This explicitly specifies, that the upper multiplicity is not restricted.

  • Note that the use of upperMultiplicityInfinite and upperMultiplicity is mutually exclusive.

max

  • Specifies the upper bounds for numeric values.

min

  • Specifies the lower bounds for numeric values.

maxLength

  • Specifies the maximum number of characters of textual values.

minLength

  • Specifies the minimum number of characters of textual values.

category

  • The category is a keyword that specializes the semantics of the Identifiable. It affects the expected existence of attributes and the applicability of constraints. Defines the type of a SdgPrimitiveAttribute. The following types are available:

    • INTEGER

    • FLOAT

    • STRING

    • BOOLEAN

    • ENUMERATION (enumeration values need to be defined in AdminData, see example)

    • AUTOSAR (cannot be used to represent an actual type, but to add a constraint for an existing AUTOSAR model attribute)

subSdg

  • Specifies the child SdgClass of a SdgAggregationWithVariation.

destSdg

  • Specifies the destination SdgClass of a SdgReference.

destMetaClass

  • Specifies the destination meta class of a SdgForeignReference.

descEN

  • The description for this Attribute Feature.

  • Descriptions can contain Markdown content which will be recognized by the DML.

  • Note that other languages are available as well; English is the default.

variation

  • Defines that the maximum amount of attribute values is not bound to a specific number.

All attribute feature definitions must start with a lower-case letter.

Model Extension Examples

The following examples show how to extend an Executable object with all supported extensions, as well as the DML syntax for these extensions.