Adding a custom Traceability Metamodel
To define your own traceability metamodel follow the steps below:
- Create a Java project and name it
- Create a new folder in your new project and name it
- In the
modelfolder create a new file and name it
MyTraceabilityMetaModel.xcore. A pop up window will appear asking if you want to add the Xtext nature to the project. Click “Yes”.
- Define your traceability metamodel as required. In our example, we add two types of traceability links i.e “
implements” and “
- Open the
plugin.xmlfile of the project you just created. This is where you need to register a new metamodel adapter for your traceability metamodel.
- Click on the “Extension Points” tab.
- Un-check the check box that says “Show only extension points from the required plugins”
- In the text box for the “Extension point filter” type “traceability” and select
- Click Finish.
- Another pop up window will appear asking if you want to add the project org.eclipse.capra.core to the list of plugin dependencies. Click Yes.
- Right click on the newly added extension, and click on “New” then
TraceabilityMetaModelAdapter. A new
TraceabilityMetaModelAdapterwill be created.
- Click on the newly created
TraceabilityMetaModelAdapter. On the right hand side, we need to provide a class for this extension in which we will implement all the required interfaces.
- Click on “Class” and a pop up window for creating a new class will appear. Make sure the folder is
srcand name your class.
- Click Finish and a class will be created. This class will contain stub implementations of the methods defined in
- Implement all the methods according to your new custom metamodel. Note that information about what each method does and its parameters can be obtained by hovering the mouse over the respective method name. This will show the JavaDoc of the methods as defined in