[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.modeling.gmt.amw] Re: WLinkEnd type

Hi,

this feature is not supported directly in the definition of the weaving metamodel (for instance, by using OCL constraints). This way, the metamodel does not contain platform-dependent information.

However, the extension points of AMW allow the implementation of such constraints in the weaving panel. You need to implement an extension to the "item provider" extension-point (see the extension points reference in the developer guide).

In the extension, you just implement your own constraints in the setChildrenConstraints() method.

The "MatchModelItemProvider" class is an example of how to implement a new provider and how to create specific constraints (http://dev.eclipse.org/viewcvs/indextech.cgi/org.eclipse.gmt/AMW/org.eclipse.weaver.extension/src/org/eclipse/weaver/extension/providers/MatchModelItemProvider.java?view=markup)

Regards,

Marcos.


Aram Hovsepyan wrote:
                Hi,

        Is is possible to put constraints on the type of the WLinkEnd for the
weaving metamodel?
        For instance, I have this:

class Merge extends WLink
{
        reference left container : ClassLinkEnd;
        reference right container : ClassLinkEnd;
}

class ClassLinkEnd extends WLinkEnd
{
}

However, I want to enforce that ClassLinkEnd should be of type UML::Class
for instance (my input metamodel is UML.ecore).

        thnx in advance.