Search code examples
javaxsdeclipse-emfbpmn

EMF Extending existing model


I have a large EMF model, more specifically a BPMN2.0 model from MDT project. There is a requirement for our software, that we have to support oracle JDeveloper BPMN2 export format, which is almost corresponding the BPMN2.0 schemat, but have it's own extension. Here is an example:

<startEvent isInterrupting="false" name="Start" id="startEvent0">
        <ns2:OracleExtensions>
            <ns2:GraphicsAttributes>
                <ns2:Position y="225" x="100"/>
                <ns2:Size height="21" width="21"/>
            </ns2:GraphicsAttributes>
            <ns2:FeatureSet>
                <ns2:BooleanFeature value="false" name="sync"/>
                <ns2:BooleanFeature value="false" name="catchAllErrors"/>
                <ns2:BooleanFeature value="false" name="catchAllSystemExceptions"/>
                <ns2:StringFeature value="" name="associatedProcess"/>
                <ns2:StringFeature value="" name="associatedNode"/>
                <ns2:StringFeature value="" name="initiator"/>
                <ns2:StringFeature value="operation" name="definedOperationName"/>
                <ns2:StringFeature value="PROCESS_DEFAULT" name="generatesEvents"/>
                <ns2:StringFeature value="USE_PROCESS_PERMISSION" name="sealType"/>
            </ns2:FeatureSet>
            <ns2:Participant/>
        </ns2:OracleExtensions>
        <outputSet/>
        <messageEventDefinition/>
    </startEvent>

There is an XSD schema for ns2, so i've easily generated the correspinding eCore model. The problem i'm trying to solve for a two days - is how to 'plug' the OracleExtensions model into an existant BPMN2.0 eCore model the right way. The goal i'm trying to achive is to edit the model with the BPMN2.0 modeler plugin, and to provide an exended properties to edit the oracle-specific features.

Any suggestions are very welcome!


Solution

  • This sounds like a task for EMF Facet:

    The problem when you develop a tool is that you can never imagine all the possible extensions that the final user will really want. That's why EMF Facet proposes a solution to extend existing Ecore metamodels without having to modify them.

    The idea is to provide non-intrusive mechanisms to add new features (types, attributes, operations and references) to a metamodel and to customize the existing features by adding extra properties (icons, labels, etc.)