Weaving Metamodel default extension

The base metamodel is abstract, so you must have a concrete extension of it.
We have created two extensions : one default base extension and other with an example with derived features.
Those extensions are in KM3 format (depends of ATL plugin).

Default base extension

This metamodel extension is designed to weave a left and a right model/metamodel (if you want to add other models, remove comments for the reference others).

This metamodel extension allows the creation of a link with two extrimities (left and right).

Its name is "mw_base_extension.km3".
All abstract classes are extended.

KM3 (Kernel Metametamodel)

In the syntax of km3, we have this :

package mw_base_ext {
    class Model extends WModel {
       reference leftModel container subsets wovenModel : WModelRef;
       reference rightModel container subsets wovenModel : WModelRef;
       -- comments -- reference others[*] container subsets wovenModel : WModelRef;
    }

    class ElementRef extends WElementRef {
       reference modelRef: ModelRef oppositeOf ownedElementRef;
    }

    class ModelRef extends WModelRef {
       reference ownedElementRef[*] container : ElementRef oppositeOf modelRef;
    }

    class ModelRefXMI extends WModelRef {
       reference ownedElementRef[0-*] container: ElementRefXMI oppositeOf modelRef;
    }

    class ElementRefXMI extends WElementRef{
       reference modelRef: ModelRefXMI oppositeOf ownedElementRef;
    }

    class Association extends WAssociation {
    }

    class AssociationEnd extends WAssociationEnd {
    }

    class Link extends WLink {
       reference left container subsets end: WLinkEnd;
       reference right container subsets end: WLinkEnd;
    }

    class LinkEnd extends WLinkEnd {
    }
}

Supplier/consumer extension

Its name is "derived_features.km3". You can use it with default base extension. You cant' use alone (all abstract classes are not extended)

KM3 (Kernel Metametamodel)

In the syntax of km3, we have this :

package derived_features {
        class Supplier extends WLink {
       reference orders[*] container: PurchaseOrder oppositeOf linkOrder;
       reference supplier[*] container subsets orders: PurchaseOrder oppositeOf linkSupplier;
       reference consumer[*] container subsets orders: PurchaseOrder oppositeOf linkConsumer;
    }

    class PurchaseOrder extends WLinkEnd {
       reference linkOrder: Supplier oppositeOf orders;
       reference linkSupplier: Supplier oppositeOf supplier;
       reference linkConsumer: Supplier oppositeOf consumer;
    }
}