Create CML Project

This page describes how you can start with Context Mapper and create your first CML model. Getting started with Context Mapper is easy, the following four steps will do:

  1. Install Context Mapper plugin
  2. Create an Eclipse project
  3. Enable the Xtext project nature
  4. Create a file with the file extension .cml

1. Install Context Mapper Plugin

The Context Mapper Eclipse plugin can be installed via the marketplace:

  1. Open the marketplace in your Eclipse with the menu entry Help -> Eclipse Marketplace…
  2. Search for “Context Mapper”
  3. Press “Install” on the Context Mapper plugin

Drag to your running Eclipse* workspace. *Requires Eclipse Marketplace Client

Alternatively, you can follow this procedure to install the plugin from update site URL directly:

  1. Open the plugin installation dialog in Eclipse with the menu entry Help -> Install New Software…
  2. Enter the following update site URL to the field Work with: on the top of the dialog:
  3. Select the two features ContextMappingDSL and ContextMappingDSL (Sources) and continue with Next.
  4. Finish the plugin installation by completing the wizard.

2. Create an Eclipse Project

In order to create a CML model, you need an Eclipse project. You can use any project type such as Java Project, Maven Project, Gradle Project or just a general Project. Use the File -> New menu or the context menu in the Project Explorer to create a project.

Note: You can also use one of your existing projects and create a CML model there. In this case, skip this and continue with the next step.

3. Enable the Xtext Project Nature

As mentioned above, it does not matter which project type you use. However, your project has to be an Xtext project, which means it requires the Xtext nature in Eclipse. There are ways to achieve this:

  • Option 1: Open the context menu on your project (right-click) and use the menu entry Configure -> Convert to Xtext Project. Enable Xtext nature on Eclipse project
  • Option 2: Just jump to step four and create a file with the extension .cml. Eclipse will ask you if you want to enable the Xtext nature. Press Yes.

4. Create .cml Model File

Once you have created your project, you can create a file with the extension .cml in order to start modeling with Context Mapper. Use the New Context Mapper DSL (CML) File wizard: Create CML file wizard (1)

Create CML file wizard (2)

Note: If you already enabled the Xtext nature in step three, the file opens and you can start modeling. Otherwise Eclipse will ask you whether you want to enable it now: Enable Xtext nature at CML file creation

In this case you have to confirm with Yes.

Ready to Model

You can now start writing CML in the Context Mapper editor. Use the following resources to get started:

Note: If you want to model across multiple *.cml files, for example to use Bounded Contexts in multiple Context Maps, consult the Imports page of our language reference.

Once you have modeled your system with CML, you may want use our generators to produce other representations or evolve the model by using Architectural Refactorings (ARs):