Skip to main content
Jump to: navigation, search

SCA/Components/SCA MMExtension

Revision as of 12:59, 25 March 2009 by (Talk | contribs) (New page: This page explains, step by step, how to extend the SCA meta model. == Create a new plugin == # Create a new plugin: '''File > New > Project...''', then select '''Plug-in Project''' (Fig...)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

This page explains, step by step, how to extend the SCA meta model.

Create a new plugin

  1. Create a new plugin: File > New > Project..., then select Plug-in Project (Figure 1). Click Next. Set the project name (Figure 2).
  2. Create a directory named “model” (Figure 3).

Create an SCA meta model extension

  1. Create a new Ecore model (Figure 4).
  2. Open the ecore model.
  3. Load the SCA meta model (right click > Load Resource...). Click Browse Registered Package, select the SCA/OSOA meta model (Figure 5).
  4. Select the EPackage of your meta model. Set the Name, NSPrefix and the NSURI.
  5. Add a new EClass named DocumentRoot (Figure 6). This EClass must extend the DocumentRoot of the SCA meta model.
  6. Add a new EAnnotation (source = http:///org/eclipse/emf/ecore/util/ExtendedMetaData).
  7. Add two DetailEntry:
    • name → empty Value.
    • kind → mixed.
  8. Then, under the DocumentRoot add a new EReference. Set the name, the cardinality (min:0, max: -2), and the containment (true).
  9. Add a new EAnnotation with the following DetailEntry:
    • kind → element
    • name → (for instance implementation.fractal or binding.jbi)
    • namespace → ##targetNamespace
    • affiliation → (scaType = binding, interface or implementation).

Create a new SCA Element

  1. Select the EPackage and create a new EClass. Set the name (for instance FractalImplementation) and the ESuper Type (Implementation, Interface or Binding).
  2. Create a new EAnnotation (Figure 7), with the following DetailEntry:
    • name → SCA Type name
    • kind → elementOnly
  3. Then, add the attributes and references for the new SCA element.

Generate the meta model code

  1. Create a new genmodel: File>New>Other>EMF Model (Figure 8).
  2. Click the Next button. Set the genmodel name, click the Next button. Select Ecore model as Model Importer (Figure 9), click the Next button.
  3. Select the ecore file defined in the previous section (Figure 10), then click the Next button. Select which package to generate (Figure 11) and the referenced generator models (sca, sca.policy and sca.instance). Click the Finish button.
  4. That's all, you can generate the code.

Back to the top