Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » UML2 » org.eclipse.ocl.uml.impl.BagTypeImpl not contained in the resource
org.eclipse.ocl.uml.impl.BagTypeImpl not contained in the resource [message #475588] Mon, 03 September 2007 07:04 Go to next message
Krzysztof Kaczmarski is currently offline Krzysztof KaczmarskiFriend
Messages: 88
Registered: July 2009
Member
Hi All,

(Forgive me sending a copy to OCL news since I don't know who could
help here.)

I continue to discover problems with OCL types and their integration
with UML models. Perhaps someone could help me with this:

when I change "UML getting started" example to use OCL collection type
I cannot serialize the model correctly to a file. I receive IOException:

The object 'org.eclipse.ocl.uml.impl.BagTypeImpl@88e2dd (name:
<unset>, visibility: <unset>) (isLeaf: false, visibility: public,
isAbstract: false) (startPosition: -1, endPosition: -1,
typeStartPosition: -1, typeEndPosition: -1)' is not contained in a
resource.

An example use in the code looks like this:
sequence.createVariable( "TEST_VAR",
org.eclipse.ocl.uml.UMLFactory.eINSTANCE.createBagType());

What could be the possible problem here?
ocl, ocl.ecore and ocl.uml are included in the classpath.
Maybe this is somehow connected to the previous problem I asked about
concerning reading OCL primitive tyeps from oclstdlib.uml.

Regards,
Krzysztof Kaczmarski
Re: org.eclipse.ocl.uml.impl.BagTypeImpl not contained in the resource [message #475770 is a reply to message #475588] Wed, 05 September 2007 13:30 Go to previous messageGo to next message
james bruck is currently offline james bruckFriend
Messages: 1724
Registered: July 2009
Senior Member
Hi Krzysztof ,

This sounds like an OCL issue. Christian should be back from vacation next
week.

- James.

"Krzysztof Kaczmarski" <krzysztof_kaczmarski@o2.pl> wrote in message
news:fbgbld$4fr$1@build.eclipse.org...
> Hi All,
>
> (Forgive me sending a copy to OCL news since I don't know who could
> help here.)
>
> I continue to discover problems with OCL types and their integration
> with UML models. Perhaps someone could help me with this:
>
> when I change "UML getting started" example to use OCL collection type
> I cannot serialize the model correctly to a file. I receive IOException:
>
> The object 'org.eclipse.ocl.uml.impl.BagTypeImpl@88e2dd (name:
> <unset>, visibility: <unset>) (isLeaf: false, visibility: public,
> isAbstract: false) (startPosition: -1, endPosition: -1,
> typeStartPosition: -1, typeEndPosition: -1)' is not contained in a
> resource.
>
> An example use in the code looks like this:
> sequence.createVariable( "TEST_VAR",
> org.eclipse.ocl.uml.UMLFactory.eINSTANCE.createBagType());
>
> What could be the possible problem here?
> ocl, ocl.ecore and ocl.uml are included in the classpath.
> Maybe this is somehow connected to the previous problem I asked about
> concerning reading OCL primitive tyeps from oclstdlib.uml.
>
> Regards,
> Krzysztof Kaczmarski
Re: org.eclipse.ocl.uml.impl.BagTypeImpl not contained in the resource [message #475853 is a reply to message #475588] Tue, 11 September 2007 20:26 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: cdamus.ca.ibm.com

Hi, Krzysztof,

OCL handles collection types by implicitly instanting template datatypes
whenever it needs a particular collection type (such as "Bag(Apple)") for
the first time.

The problem is, that OCL offers no guidance as to where to persist these
implicitly created types for serialization. The easiest way in an XMI
serialization is just to add them as additional root elements of your
resource. Unless you find some meaningful place in some resource to save
the BagType instance, EMF will not be able to determine a URI for it to
save a reference from your Variable instance.

HTH,

Christian


Krzysztof Kaczmarski wrote:

> Hi All,
>
> (Forgive me sending a copy to OCL news since I don't know who could
> help here.)
>
> I continue to discover problems with OCL types and their integration
> with UML models. Perhaps someone could help me with this:
>
> when I change "UML getting started" example to use OCL collection type
> I cannot serialize the model correctly to a file. I receive IOException:
>
> The object 'org.eclipse.ocl.uml.impl.BagTypeImpl@88e2dd (name:
> <unset>, visibility: <unset>) (isLeaf: false, visibility: public,
> isAbstract: false) (startPosition: -1, endPosition: -1,
> typeStartPosition: -1, typeEndPosition: -1)' is not contained in a
> resource.
>
> An example use in the code looks like this:
> sequence.createVariable( "TEST_VAR",
> org.eclipse.ocl.uml.UMLFactory.eINSTANCE.createBagType());
>
> What could be the possible problem here?
> ocl, ocl.ecore and ocl.uml are included in the classpath.
> Maybe this is somehow connected to the previous problem I asked about
> concerning reading OCL primitive tyeps from oclstdlib.uml.
>
> Regards,
> Krzysztof Kaczmarski
Re: org.eclipse.ocl.uml.impl.BagTypeImpl not contained in the resource [message #476205 is a reply to message #475853] Tue, 25 September 2007 06:51 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7670
Registered: July 2009
Senior Member
Christian W. Damus wrote:
> The problem is, that OCL offers no guidance as to where to persist these
> implicitly created types for serialization. The easiest way in an XMI
> serialization is just to add them as additional root elements of your
> resource. Unless you find some meaningful place in some resource to save
> the BagType instance, EMF will not be able to determine a URI for it to
> save a reference from your Variable instance.
>

The solution adopted by QVT is that the type must be defined in some
transformation package and that A::Bag(Integer) is the same type as
B::Bag(Integer).

Regards

Ed Willink
Re: org.eclipse.ocl.uml.impl.BagTypeImpl not contained in the resource [message #476207 is a reply to message #476205] Tue, 25 September 2007 07:53 Go to previous messageGo to next message
Krzysztof Kaczmarski is currently offline Krzysztof KaczmarskiFriend
Messages: 88
Registered: July 2009
Member
Hi,

as a OCL-UML newbie I am not really sure what are you talking about guys:)

Should I do something like this:

1. Create appropriate type by
CollectionType collType = UMLFactory.eINSTANCE.createBagType();

2. When serializing the model first serialize the type?
res.getContents().add(0, collType);

3. Then serialize the model.

Thanks,
KK

Ed Willink wrote:
> Christian W. Damus wrote:
>> The problem is, that OCL offers no guidance as to where to persist these
>> implicitly created types for serialization. The easiest way in an XMI
>> serialization is just to add them as additional root elements of your
>> resource. Unless you find some meaningful place in some resource to save
>> the BagType instance, EMF will not be able to determine a URI for it to
>> save a reference from your Variable instance.
>>
>
> The solution adopted by QVT is that the type must be defined in some
> transformation package and that A::Bag(Integer) is the same type as
> B::Bag(Integer).
>
> Regards
>
> Ed Willink
>
Re: org.eclipse.ocl.uml.impl.BagTypeImpl not contained in the resource [message #476212 is a reply to message #476207] Tue, 25 September 2007 13:31 Go to previous message
Eclipse UserFriend
Originally posted by: cdamus.ca.ibm.com

Hi, Krzysztof,

No, you don't want to be creating your own instances of these collection
types because the parser creates them, itself, on demand and pools them.

The default implementation of the OCL Environment API will store these
collection types (and others) in a bunch of packages in a resource that it
creates to gather them all. Have a look at the TypeResolver interface and
its hierarchy, in particular AbstractTypeResolver. After you have parsed
your constraint(s), you can get the packages in this resource and, as Ed
suggested, store them in some separate transformation-specific resource or
wherever you need them.

You just need to be sure that the exact instances referenced by your OCL AST
model are persisted somewhere that EMF can get a URI for them and
deserialize them later.

HTH,

Christian


Krzysztof Kaczmarski wrote:

> Hi,
>
> as a OCL-UML newbie I am not really sure what are you talking about guys:)
>
> Should I do something like this:
>
> 1. Create appropriate type by
> CollectionType collType = UMLFactory.eINSTANCE.createBagType();
>
> 2. When serializing the model first serialize the type?
> res.getContents().add(0, collType);
>
> 3. Then serialize the model.
>
> Thanks,
> KK
>
> Ed Willink wrote:
>> Christian W. Damus wrote:
>>> The problem is, that OCL offers no guidance as to where to persist these
>>> implicitly created types for serialization. The easiest way in an XMI
>>> serialization is just to add them as additional root elements of your
>>> resource. Unless you find some meaningful place in some resource to
>>> save the BagType instance, EMF will not be able to determine a URI for
>>> it to save a reference from your Variable instance.
>>>
>>
>> The solution adopted by QVT is that the type must be defined in some
>> transformation package and that A::Bag(Integer) is the same type as
>> B::Bag(Integer).
>>
>> Regards
>>
>> Ed Willink
>>
Re: org.eclipse.ocl.uml.impl.BagTypeImpl not contained in the resource [message #624722 is a reply to message #475588] Wed, 05 September 2007 13:30 Go to previous message
james bruck is currently offline james bruckFriend
Messages: 1724
Registered: July 2009
Senior Member
Hi Krzysztof ,

This sounds like an OCL issue. Christian should be back from vacation next
week.

- James.

"Krzysztof Kaczmarski" <krzysztof_kaczmarski@o2.pl> wrote in message
news:fbgbld$4fr$1@build.eclipse.org...
> Hi All,
>
> (Forgive me sending a copy to OCL news since I don't know who could
> help here.)
>
> I continue to discover problems with OCL types and their integration
> with UML models. Perhaps someone could help me with this:
>
> when I change "UML getting started" example to use OCL collection type
> I cannot serialize the model correctly to a file. I receive IOException:
>
> The object 'org.eclipse.ocl.uml.impl.BagTypeImpl@88e2dd (name:
> <unset>, visibility: <unset>) (isLeaf: false, visibility: public,
> isAbstract: false) (startPosition: -1, endPosition: -1,
> typeStartPosition: -1, typeEndPosition: -1)' is not contained in a
> resource.
>
> An example use in the code looks like this:
> sequence.createVariable( "TEST_VAR",
> org.eclipse.ocl.uml.UMLFactory.eINSTANCE.createBagType());
>
> What could be the possible problem here?
> ocl, ocl.ecore and ocl.uml are included in the classpath.
> Maybe this is somehow connected to the previous problem I asked about
> concerning reading OCL primitive tyeps from oclstdlib.uml.
>
> Regards,
> Krzysztof Kaczmarski
Re: org.eclipse.ocl.uml.impl.BagTypeImpl not contained in the resource [message #624744 is a reply to message #475588] Tue, 11 September 2007 20:26 Go to previous message
Eclipse UserFriend
Originally posted by: cdamus.ca.ibm.com

Hi, Krzysztof,

OCL handles collection types by implicitly instanting template datatypes
whenever it needs a particular collection type (such as "Bag(Apple)") for
the first time.

The problem is, that OCL offers no guidance as to where to persist these
implicitly created types for serialization. The easiest way in an XMI
serialization is just to add them as additional root elements of your
resource. Unless you find some meaningful place in some resource to save
the BagType instance, EMF will not be able to determine a URI for it to
save a reference from your Variable instance.

HTH,

Christian


Krzysztof Kaczmarski wrote:

> Hi All,
>
> (Forgive me sending a copy to OCL news since I don't know who could
> help here.)
>
> I continue to discover problems with OCL types and their integration
> with UML models. Perhaps someone could help me with this:
>
> when I change "UML getting started" example to use OCL collection type
> I cannot serialize the model correctly to a file. I receive IOException:
>
> The object 'org.eclipse.ocl.uml.impl.BagTypeImpl@88e2dd (name:
> <unset>, visibility: <unset>) (isLeaf: false, visibility: public,
> isAbstract: false) (startPosition: -1, endPosition: -1,
> typeStartPosition: -1, typeEndPosition: -1)' is not contained in a
> resource.
>
> An example use in the code looks like this:
> sequence.createVariable( "TEST_VAR",
> org.eclipse.ocl.uml.UMLFactory.eINSTANCE.createBagType());
>
> What could be the possible problem here?
> ocl, ocl.ecore and ocl.uml are included in the classpath.
> Maybe this is somehow connected to the previous problem I asked about
> concerning reading OCL primitive tyeps from oclstdlib.uml.
>
> Regards,
> Krzysztof Kaczmarski
Re: org.eclipse.ocl.uml.impl.BagTypeImpl not contained in the resource [message #624995 is a reply to message #475853] Tue, 25 September 2007 06:51 Go to previous message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7670
Registered: July 2009
Senior Member
Christian W. Damus wrote:
> The problem is, that OCL offers no guidance as to where to persist these
> implicitly created types for serialization. The easiest way in an XMI
> serialization is just to add them as additional root elements of your
> resource. Unless you find some meaningful place in some resource to save
> the BagType instance, EMF will not be able to determine a URI for it to
> save a reference from your Variable instance.
>

The solution adopted by QVT is that the type must be defined in some
transformation package and that A::Bag(Integer) is the same type as
B::Bag(Integer).

Regards

Ed Willink
Re: org.eclipse.ocl.uml.impl.BagTypeImpl not contained in the resource [message #624996 is a reply to message #476205] Tue, 25 September 2007 07:53 Go to previous message
Krzysztof Kaczmarski is currently offline Krzysztof KaczmarskiFriend
Messages: 88
Registered: July 2009
Member
Hi,

as a OCL-UML newbie I am not really sure what are you talking about guys:)

Should I do something like this:

1. Create appropriate type by
CollectionType collType = UMLFactory.eINSTANCE.createBagType();

2. When serializing the model first serialize the type?
res.getContents().add(0, collType);

3. Then serialize the model.

Thanks,
KK

Ed Willink wrote:
> Christian W. Damus wrote:
>> The problem is, that OCL offers no guidance as to where to persist these
>> implicitly created types for serialization. The easiest way in an XMI
>> serialization is just to add them as additional root elements of your
>> resource. Unless you find some meaningful place in some resource to save
>> the BagType instance, EMF will not be able to determine a URI for it to
>> save a reference from your Variable instance.
>>
>
> The solution adopted by QVT is that the type must be defined in some
> transformation package and that A::Bag(Integer) is the same type as
> B::Bag(Integer).
>
> Regards
>
> Ed Willink
>
Re: org.eclipse.ocl.uml.impl.BagTypeImpl not contained in the resource [message #625000 is a reply to message #476207] Tue, 25 September 2007 13:31 Go to previous message
Eclipse UserFriend
Originally posted by: cdamus.ca.ibm.com

Hi, Krzysztof,

No, you don't want to be creating your own instances of these collection
types because the parser creates them, itself, on demand and pools them.

The default implementation of the OCL Environment API will store these
collection types (and others) in a bunch of packages in a resource that it
creates to gather them all. Have a look at the TypeResolver interface and
its hierarchy, in particular AbstractTypeResolver. After you have parsed
your constraint(s), you can get the packages in this resource and, as Ed
suggested, store them in some separate transformation-specific resource or
wherever you need them.

You just need to be sure that the exact instances referenced by your OCL AST
model are persisted somewhere that EMF can get a URI for them and
deserialize them later.

HTH,

Christian


Krzysztof Kaczmarski wrote:

> Hi,
>
> as a OCL-UML newbie I am not really sure what are you talking about guys:)
>
> Should I do something like this:
>
> 1. Create appropriate type by
> CollectionType collType = UMLFactory.eINSTANCE.createBagType();
>
> 2. When serializing the model first serialize the type?
> res.getContents().add(0, collType);
>
> 3. Then serialize the model.
>
> Thanks,
> KK
>
> Ed Willink wrote:
>> Christian W. Damus wrote:
>>> The problem is, that OCL offers no guidance as to where to persist these
>>> implicitly created types for serialization. The easiest way in an XMI
>>> serialization is just to add them as additional root elements of your
>>> resource. Unless you find some meaningful place in some resource to
>>> save the BagType instance, EMF will not be able to determine a URI for
>>> it to save a reference from your Variable instance.
>>>
>>
>> The solution adopted by QVT is that the type must be defined in some
>> transformation package and that A::Bag(Integer) is the same type as
>> B::Bag(Integer).
>>
>> Regards
>>
>> Ed Willink
>>
Previous Topic:package and ownedMembers
Next Topic:constraint ocl
Goto Forum:
  


Current Time: Thu Sep 19 20:38:57 GMT 2024

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

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

Back to the top