[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.modeling.m2m] Re: [ATL] Ecore metamodel EReference multiplicity -2

As far as I have experimented, the multiplicity value of -2 causes a strange effect in ATL that we can only create one instance/object for that relation and this object can be user created(myML!instancename...etc) or it can be a matching. but for more than one it doesn't work.

so with this multiplicity value, we can have one instance for each type. Lets see if someone opposes my observations...
thankx,


-aamir-





Ed Merks wrote:
Aamir,

Note that this corresponds to ETypedElement's

      /**
       * A value indicating that there is an unspecified {@link
    #getUpperBound upper bound}.
       * @see #getUpperBound()
       */
      int UNSPECIFIED_MULTIPLICITY = -2;

Also note that isMany is computed by FeatureMapUtil.isMany because the multiplicity depends on the multiplicity of the target feature.


Aamir wrote:
Hi All,

I have a simple problem. I have an Ecore metamodel with Upper Bound multiplicity of an EReference as -2 (lower bound is 0). With this, i try to map the ATL rules, But its not working.
But if I change the Upper Bound to -1 then it works!!! what to do? Is it implemented in ATL or not? Is there any other way to do so?


Here is the code:
rule root {
   from u : UML2!Model
   to     v : myML!DocumentRoot (component<-u.getCmpt(u)
}

rule component {
from u : UML2!Component
to v : myML!ComponentType(vendor<-'sophia.inria.fr', library<-'myModel',
name<-u.name,
version<-'1.0')
}


waiting for the reply n thanks in advance,
-aamir-