Structure of Metamodel Components

Each metamodels in ModelAnt is represented by a wrapping component, organized as follows:

  • the component is named after the metamodel it wraps.
  • these components are located in /modelant/metamodel/<component name> directory
  • each component sub-directory holds:
    • any metamodel files in XMI 1.1/1.2 and XMI.DIFF format
    • meta.xml file in the format of ANT antlib definition
    • additional files and scripts, that will not be included in the component’s ant.doc
  • meta.xml
    • imports modelant-core module using:
      <typedef resource="net/mdatools/modelant/core/antlib.xml"/>
    • defines <component name>.load.metamodel macro, which loads the metamodel files into the metadata repository (MDR).
    • defines <component name>.instantiate macro, which creates an extent for models
    • any other macro defined must have <component name>. prefix
  • No other components, macros or scripts should refer the wrapped files explicitly, but the .load.metamodel macro.
  • The component directory is zipped in modelant-<component name>.jar
  • Use the component’s macros in scripts by:
    <typedef resource="<component name>/meta.xml"/>

Examples:

  • the UML 1.3 meta-model is stored in metamodel/uml13 directory
  • load the UML 1.3 macros using:
     <typedef resource="uml13/meta.xml"/>
  • the UML 1.3 macros are:
    • uml13.load.metamodel
    • uml13.instantiate

Leave a Reply

Your email address will not be published. Required fields are marked *

Time limit is exhausted. Please reload CAPTCHA.