Origin ecore/engineering.yml 1:1
Uri engineering://nasdanika/modules/html/modules/ecore

With ecore module you can generate documentation for Ecore models.


Traceability from documentation to model sources stored in a version control system, e.g. Git, can be added if needed - remote location and commit.


Documenting models

Models are documented in Markdown using model annotations.

There are the following ways to document the model:

  • (GenModel) annotation, documentation details. With this method you have to set “Suppress GenModel Annotations” to false in the GenModel editor (true by default).
  • urn:org.nasdanika annotation:
    • documentation-reference - location of a resource (file, URL) containing markdown documentation for an element. The location is resolved relative to the model (.ecore file) location.
    • load-doc - Load documentation if different from the general documentation.
    • load-doc-reference - location of a resource (file, URL) containing markdown load documentation for an element. The location is resolved relative to the model (.ecore file) location.

Resource references in Markdown fenced blocks (images and diagrams) are resolved relative to the .ecore file location for documentation embedded into the model (GenModel and documentation-reference) and relative to documentation resources for referenced documentation. This is achieved by adding

It works AS-IS when all generation steps are performed on the same machine. If you decide to separate generation steps, e.g. generate action models and publish them to a binary repository and generate Web sites from them later, then you will need to package image and diagram resources together with the action model and modify the markers. One simple way to do it is to package the action model together with the .ecore model - in this case you’ll just need to relativize marker locations.

Referencing EClassifiers

You can reference EClassifiers available in the model resource set using ${classifier/<classifier name>[@<package namespace URI>]} token.


  • ${classifier/Activity} - Activity classifier in the same EPackage. Classifiers in the same EPackage can also be addressed by adding .html to the classifier name, e.g. [Activity](Activity.html).
  • ${classifier/Activity@urn:org.nasdanika.flow} - Activity classifier in EPackage with urn:org.nasdanika.flow namespace URI.

During generation you will need to pass EPackage path computer to org.nasdanika.html.ecore.EcoreActionSupplierAdapterFactory constructor. See TestNasdanikaDocEngineeringGen.generateEcoreActionModel() for an example.


To link EClassifier instance class names to their javadocs you’ll need to pass a Javadoc resolver to EcoreActionSupplierAdapterFactory constructor. See TestNasdanikaDocEngineeringGen.generateEcoreActionModel() above for an example.

To create links to Javadoc in makrdown you may use <fully replacement tokens.

For example, org.nasdanika.common.Context would be replaced with org.nasdanika.common.Context.

You will need to add a Javadoc resolver to the generation context as exemplified here.

Generation steps

To use add ecore dependency to pom.xml, e.g.


Then write generation logic following the below examples:

Generate action model

If you are generating documentation for cross-referencing models, you may need to copy the models so their physical relative location on disk matches their relative logical location in Eclipse (project name). For example, Ncore physical location relative to the Git root directory is core/ncore, but its logical (project) name in Eclipse is org.nasdanika.ncore. Therefore, in order for the flow model to reference Ncore classes the Ncore model is copied from core/ncore to org.nasdanika.ncore in a Maven target directory. The flow model is copied in a similar way.

Generate resource model

Once you have generated action models, mount them to a root action model (defined in actions.yml in the examples above) and generate a resource model using a page template - defined in page-template.yml in the examples.

Root action model

  uri: nasdanika:test/action/s1/s2
  text: Nasdanika
  tooltip: Root action
    - app-action:
        icon: fa fa-book
        text: Documentation
        id: doc
        location: temp://ed0288b8-422b-424e-9267-f41412a71a68/80addd49-0149-4f97-aa53-26f6d1dff5f1/index.html 
        tooltip: Documentation
          content-text: TODO  
          - app-action-reference: "../../../../../../../target/model-doc/actions/ncore.genmodel.xml#/"
          - app-action-reference: "../../../../../../../target/model-doc/actions/exec.genmodel.xml#/"
          - app-action-reference: "../../../../../../../target/model-doc/actions/flow.genmodel.xml#/"

Page template

  cdn: true
  theme: Cerulean
  name: Application Page Template
  language: EN
      fluid: true

  1. This and detection of broken links are features of Nasdanika Application Framework, which is used to generate HTML sites from action models generated from Ecore models by this module.