Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » QVT-OML » handling of abstract types
handling of abstract types [message #1508490] Fri, 12 December 2014 13:06 Go to next message
Daniele Pala is currently offline Daniele PalaFriend
Messages: 9
Registered: September 2011
Junior Member
Hello, I'm working with an XSD-derived model, where I have the following complexType:

<xs:complexType name="IntervalType">
<xs:sequence>
<xs:element ref="xcal:dtstart" minOccurs="0"/>
<xs:element ref="xcal:duration" minOccurs="0"/>
<xs:element ref="xcal:uid" minOccurs="0"/>
<xs:element ref="strm:streamPayloadBase" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>

I'm trying, in QVTO, to assign to "streamPayloadBase", which is abstract:

<xs:complexType name="StreamPayloadBaseType" abstract="true">
<xs:annotation>
<xs:documentation>Abstract class to convey a payload for a stream. When a Stream is transformed to or from a WS-Calendar Interval, the contents of the Stream Payload defined element are transformed into the contents of a WS-Calendar artifactBase.</xs:documentation>
</xs:annotation>
</xs:complexType>

I'm using this syntax:

object IntervalType{
streamPayloadBase += OrderedSet {
object SignalPayloadType {}
}
};

where "SignalPayloadType" is a concrete child of "StreamPayloadBaseType". However, I cannot do this, since I get the error:

"Property 'streamPayloadBase' is read-only"

How can I solve this problem?

Thanks a lot,
Daniele Pala
Re: handling of abstract types [message #1508548 is a reply to message #1508490] Fri, 12 December 2014 14:04 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 5476
Registered: July 2009
Senior Member
Hi

It may be appropriate to start with XSD for external compatibility, but
as soon as you convert to Ecore you can join the grown ups and use models.

It would appear that your Ecore model has a readonly attribute
prohibiting the change. You may investigate whether this is an XSD to
Ecore conversion anomally, or just correct it. You should then be good
to go.

Without a *.ecore to look at it's hard to comment further.

Regards

Ed Willink


On 12/12/2014 13:06, Daniele Pala wrote:
> Hello, I'm working with an XSD-derived model, where I have the following
> complexType:
>
> <xs:complexType name="IntervalType">
> <xs:sequence>
> <xs:element ref="xcal:dtstart" minOccurs="0"/>
> <xs:element ref="xcal:duration" minOccurs="0"/>
> <xs:element ref="xcal:uid" minOccurs="0"/>
> <xs:element ref="strm:streamPayloadBase"
> maxOccurs="unbounded"/>
> </xs:sequence>
> </xs:complexType>
>
> I'm trying, in QVTO, to assign to "streamPayloadBase", which is abstract:
>
> <xs:complexType name="StreamPayloadBaseType" abstract="true">
> <xs:annotation>
> <xs:documentation>Abstract class to convey a payload for a
> stream. When a Stream is transformed to or from a WS-Calendar Interval,
> the contents of the Stream Payload defined element are transformed into
> the contents of a WS-Calendar artifactBase.</xs:documentation>
> </xs:annotation>
> </xs:complexType>
>
> I'm using this syntax:
>
> object IntervalType{
> streamPayloadBase += OrderedSet {
> object SignalPayloadType {}
> }
> };
>
> where "SignalPayloadType" is a concrete child of
> "StreamPayloadBaseType". However, I cannot do this, since I get the error:
>
> "Property 'streamPayloadBase' is read-only"
>
> How can I solve this problem?
>
> Thanks a lot,
> Daniele Pala
>
Re: handling of abstract types [message #1514817 is a reply to message #1508548] Wed, 17 December 2014 16:33 Go to previous messageGo to next message
Daniele Pala is currently offline Daniele PalaFriend
Messages: 9
Registered: September 2011
Junior Member
Thanks for your reply. Actually I found that, along with 'streamPayloadBase' which is read-only, there is a property 'streamPayloadBaseGroup', which is a sequence of 'EFeatureMapEntry'...but probably I must use a backbox operation to deal with this EFeatureMap stuff, right?

Best regards,
Daniele Pala
Re: handling of abstract types [message #1514829 is a reply to message #1508548] Wed, 17 December 2014 16:40 Go to previous message
Daniele Pala is currently offline Daniele PalaFriend
Messages: 9
Registered: September 2011
Junior Member
The fact that 'streamPayloadBase' is read-only is correct however, since only its 'concrete childs' must be settable...like SignalPayloadType...probably this can only be done via EFeatureMaps Sad

Daniele
Previous Topic:Including UML primitive types in result of transformation
Next Topic:Compilation errors found when running a transformation inside the jboss container
Goto Forum:
  


Current Time: Thu Nov 23 22:32:40 GMT 2017

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

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