Skip to main content

Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

Capra/CustomTraceabilityMetaModel

< Capra
Revision as of 16:24, 8 May 2019 by Ec.splashstudio.com (Talk | contribs) (Added Capra category)

Adding a custom Traceability Metamodel

To define your own traceability metamodel follow the steps below:

  • Create a Java project and name it org.eclipse.capra.MyTraceabilityMetaModel
  • 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 “tests

TraceMetamodelDefinition.png

  • 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 org.eclipse.capra.configuration.traceabilityMetaModel
  • Click Finish.

AddTraceExtension.png

  • 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 TraceabilityMetaModelAdapter will be created.

NewTMAdapter.png

  • 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

SelectTraceabilityMetaModelExtensionPointClass.png

AddNewTraceAdapterClass.png

  • 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.

Back to the top