[ATL] Ecore metamodel EReference multiplicity -2 [message #84212] |
Tue, 10 June 2008 19:54 |
Eclipse User |
|
|
|
Originally posted by: amehmood.sophia.inria.fr
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-
|
|
|
Re: [ATL] Ecore metamodel EReference multiplicity -2 [message #84226 is a reply to message #84212] |
Tue, 10 June 2008 21:39 |
Eclipse User |
|
|
|
Originally posted by: merks.ca.ibm.com
This is a multi-part message in MIME format.
--------------090607030707010804030105
Content-Type: text/plain; charset=ISO-8859-15; format=flowed
Content-Transfer-Encoding: 7bit
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-
>
--------------090607030707010804030105
Content-Type: text/html; charset=ISO-8859-15
Content-Transfer-Encoding: 8bit
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-15"
http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Aamir,<br>
<br>
Note that this corresponds to ETypedElement's<br>
<blockquote>
|
|
|
Re: [ATL] Ecore metamodel EReference multiplicity -2 [message #84447 is a reply to message #84226] |
Thu, 12 June 2008 20:53 |
Eclipse User |
|
|
|
Originally posted by: amehmood.sophia.inria.fr
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-
>>
>
|
|
|
Powered by
FUDForum. Page generated in 0.04276 seconds