Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » M2M (model-to-model transformation) » [QVTO]when a type does not conform to itself?
[QVTO]when a type does not conform to itself? [message #79695] Mon, 21 April 2008 21:16 Go to next message
Eclipse UserFriend
Originally posted by: comouraf-lixo.yahoo.fr

Hi,

I'm getting the following error:

> "The type 'collections::Bag(MySpecialConnector)' does not conform to the
> type 'Bag(MySpecialConnector)' of the property 'ownedConnectors'"

originating in the line:

> ownedConnectors:=self.ownedConnector->map toMySpecialConnector();

where 'ownedConnectors' is an attribute from a superclass defined in another
metamodel (visible via code completion). The same assignement works when
called in the superclass.

Any idea on what is happening here?

Thanks,

César
Re: [QVTO]when a type does not conform to itself? [message #79710 is a reply to message #79695] Mon, 21 April 2008 21:43 Go to previous messageGo to next message
Radomil Dvorak is currently offline Radomil DvorakFriend
Messages: 249
Registered: July 2009
Senior Member
Hi César,

Just a hint that first came to my mind, in case you use unqualified type
names and
both the source and target metamodel contain 'MySpecialConnector' type.
Could you check this case?
The type name can be qualified with the package name or even modeltype
name to resolve
ambiguities.

PS: However, if it's this case, we have to report ambiguos type reference.

Regards,
/Radek


On Mon, 21 Apr 2008 23:16:38 +0200, kaiserlautern <comouraf-lixo@yahoo.fr>
wrote:

> Hi,
>
> I'm getting the following error:
>
>> "The type 'collections::Bag(MySpecialConnector)' does not conform to
>> the type 'Bag(MySpecialConnector)' of the property 'ownedConnectors'"
>
> originating in the line:
>
> > ownedConnectors:=self.ownedConnector->map toMySpecialConnector();
>
> where 'ownedConnectors' is an attribute from a superclass defined in
> another metamodel (visible via code completion). The same assignement
> works when called in the superclass.
>
> Any idea on what is happening here?
>
> Thanks,
>
> César



--
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/
Re: [QVTO]when a type does not conform to itself? [message #79726 is a reply to message #79710] Mon, 21 April 2008 22:57 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: comouraf-lixo.yahoo.fr

Hi, Radek,

I'm afraid this is not the problem, since all types are fully qualified.
Also, source mm is UML (no MySpecialConnector ;-). In any case, I reproduce
the whole mapping below. In this case, all attributes defined in the
subclass (Temp::ParameterableComponent) work fine, while ownedConnectors,
and any other attribute inherited from the superclass fail. If you have time
to check this problem, I can send you the metamodels.

Thank you again,

César

mapping UML::Class::toParameterableComponent():Temp::ParameterableCo mponent
when{ not self.ownedTemplateSignature.oclIsUndefined() }
{
init{
log(self.name);
result:=self.resolveone(Temp::ParameterableComponent);
}
name:=self.name;
formal:=self.ownedTemplateSignature.ownedParameter->map
toFormalParameter()->asOrderedSet();
innerElement:=self.ownedAttribute->map toParamProperty()->asOrderedSet();
innerElement+=self.ownedConnector->map toParamConnector()->asOrderedSet();
--ownedConnectors:=self.ownedConnector->map toAssemblyConnector();
}

"Radek Dvorak" <radek.dvorak@borland.com> a écrit dans le message de
news:op.t9zdahyihj1a1g@czprl-rdvorak2.emea.borl.net...
> Hi César,
>
> Just a hint that first came to my mind, in case you use unqualified type
> names and
> both the source and target metamodel contain 'MySpecialConnector' type.
> Could you check this case?
> The type name can be qualified with the package name or even modeltype
> name to resolve
> ambiguities.
>
> PS: However, if it's this case, we have to report ambiguos type reference.
>
> Regards,
> /Radek
>
>
> On Mon, 21 Apr 2008 23:16:38 +0200, kaiserlautern <comouraf-lixo@yahoo.fr>
> wrote:
>
>> Hi,
>>
>> I'm getting the following error:
>>
>>> "The type 'collections::Bag(MySpecialConnector)' does not conform to
>>> the type 'Bag(MySpecialConnector)' of the property 'ownedConnectors'"
>>
>> originating in the line:
>>
>> > ownedConnectors:=self.ownedConnector->map toMySpecialConnector();
>>
>> where 'ownedConnectors' is an attribute from a superclass defined in
>> another metamodel (visible via code completion). The same assignement
>> works when called in the superclass.
>>
>> Any idea on what is happening here?
>>
>> Thanks,
>>
>> César
>
>
>
> --
> Using Opera's revolutionary e-mail client: http://www.opera.com/mail/
Re: [QVTO]when a type does not conform to itself? [message #79740 is a reply to message #79726] Mon, 21 April 2008 23:09 Go to previous messageGo to next message
Radomil Dvorak is currently offline Radomil DvorakFriend
Messages: 249
Registered: July 2009
Senior Member
Sure, send the metamodels if you can please ;-)
/Radek

On Tue, 22 Apr 2008 00:57:57 +0200, kaiserlautern <comouraf-lixo@yahoo.fr>
wrote:

> Hi, Radek,
>
> I'm afraid this is not the problem, since all types are fully qualified.
> Also, source mm is UML (no MySpecialConnector ;-). In any case, I
> reproduce the whole mapping below. In this case, all attributes defined
> in the subclass (Temp::ParameterableComponent) work fine, while
> ownedConnectors, and any other attribute inherited from the superclass
> fail. If you have time to check this problem, I can send you the
> metamodels.
>
> Thank you again,
>
> César
>
> mapping
> UML::Class::toParameterableComponent():Temp::ParameterableCo mponent
> when{ not self.ownedTemplateSignature.oclIsUndefined() }
> {
> init{
> log(self.name);
> result:=self.resolveone(Temp::ParameterableComponent);
> }
> name:=self.name;
> formal:=self.ownedTemplateSignature.ownedParameter->map
> toFormalParameter()->asOrderedSet();
> innerElement:=self.ownedAttribute->map
> toParamProperty()->asOrderedSet();
> innerElement+=self.ownedConnector->map
> toParamConnector()->asOrderedSet();
> --ownedConnectors:=self.ownedConnector->map toAssemblyConnector();
> }
>
> "Radek Dvorak" <radek.dvorak@borland.com> a écrit dans le message de
> news:op.t9zdahyihj1a1g@czprl-rdvorak2.emea.borl.net...
>> Hi César,
>>
>> Just a hint that first came to my mind, in case you use unqualified
>> type names and
>> both the source and target metamodel contain 'MySpecialConnector' type.
>> Could you check this case?
>> The type name can be qualified with the package name or even modeltype
>> name to resolve
>> ambiguities.
>>
>> PS: However, if it's this case, we have to report ambiguos type
>> reference.
>>
>> Regards,
>> /Radek
>>
>>
>> On Mon, 21 Apr 2008 23:16:38 +0200, kaiserlautern
>> <comouraf-lixo@yahoo.fr> wrote:
>>
>>> Hi,
>>>
>>> I'm getting the following error:
>>>
>>>> "The type 'collections::Bag(MySpecialConnector)' does not conform to
>>>> the type 'Bag(MySpecialConnector)' of the property 'ownedConnectors'"
>>>
>>> originating in the line:
>>>
>>> > ownedConnectors:=self.ownedConnector->map toMySpecialConnector();
>>>
>>> where 'ownedConnectors' is an attribute from a superclass defined in
>>> another metamodel (visible via code completion). The same assignement
>>> works when called in the superclass.
>>>
>>> Any idea on what is happening here?
>>>
>>> Thanks,
>>>
>>> César
>>
>>
>>
>> -- Using Opera's revolutionary e-mail client: http://www.opera.com/mail/
>



--
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/
Re: [QVTO]when a type does not conform to itself? [message #630085 is a reply to message #79740] Thu, 30 September 2010 15:28 Go to previous messageGo to next message
Macca1892 is currently offline Macca1892Friend
Messages: 14
Registered: May 2010
Junior Member
Hello, I have a similar problem

"The type 'xxx::Bag(LocalVariable)' does not conform to the type 'abc::Variable' of the property 'Variable'"

varExp.Variable := exp.oclAsType(mm::VariableExpression).variable->map mapVar();

---
The mapping is very simple like this:
mapping mm::Variable::mapVar() : abc::Variable{
...
}

any suggestions?

[Updated on: Thu, 30 September 2010 15:30]

Report message to a moderator

Re: [QVTO]when a type does not conform to itself? [message #630111 is a reply to message #630085] Thu, 30 September 2010 16:21 Go to previous message
Ed Willink is currently offline Ed WillinkFriend
Messages: 6437
Registered: July 2009
Senior Member
Hi

'xxx::Bag(LocalVariable)'

is a Collection, which in OCL 2.0 and QVT 1.0 does not conform to any
non-collection.

In OCL 2.2, which is not fully supported by MDT/OCL 3.0.0 and so
probably not supported by M2M/QVTo, a Collection conforms to OclAny,
which still does not conform to a Variable.

I think the message is just telling you that you are confused about your
collections.

Regards

Ed Willink

On 30/09/2010 16:28, Macca1892 wrote:
> Hello, I have a similar problem
>
> "The type 'xxx::Bag(LocalVariable)' does not conform to the type
> 'abc::Variable' of the property 'Variable'"
>
> varExp.Variable := exp.oclAsType(sm::VariableExpression).variable->map
> mapVar();
>
> ---
> The mapping is very simple like this:
> mapping sm::Variable::mapVar() : nqc::LocalVariable{
> ..
> }
>
> any suggestions?
Previous Topic:[QVTO] Bug 254417 fix broke black box import in org.eclipse.m2m.qvt.oml_1.0.1?
Next Topic:[ATL] Bug in ATL 3.0.0 final refining mode ?
Goto Forum:
  


Current Time: Sun Aug 18 10:57:15 GMT 2019

Powered by FUDForum. Page generated in 0.02381 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top