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 and name it model
- In the model folder 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.xml file of the new project and 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 src and name your class
- Click Finish and a class will be created with the methods to be implemented in it.
- 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.