Home » Modeling » OCL » ocl standard lib primitive types
ocl standard lib primitive types [message #36314] |
Sat, 01 September 2007 06:22  |
Eclipse User |
|
|
|
Originally posted by: krzysztof_kaczmarski.o2.pl
Hi All,
(I also send cc to mdt.uml2 beacause I don't really know who is the
right addressee of this problem)
In my uml models I use primitive types from oclstdlib.uml package
because I need them to be equipped with operations (+, -, /, =, etc).
When I load such a model and navigate in my procedure an element with
such type I get something like this:
org.eclipse.ocl.uml.impl.PrimitiveTypeImpl@151e824 (eProxyURI:
oclstdlib.uml#_alYNtqjQEdu4LJng8Rasow)
But then if I ask for owned elements (including operations) I get
empty result which can be also seen in debugger where 'operations' are
null for this type.
However when I do:
getOCLStandardLibrary().getInteger()
I receive:
org.eclipse.ocl.uml.impl.PrimitiveTypeImpl@1af8502 (name: Integer,
visibility: <unset>) (isLeaf: false, visibility: public, isAbstract:
false)
with all needed operations inside.
I suppose I load my models in a bad way so PrimitiveTypes loose their
operations. But what should I do actually to preserve them?
Thanks in advance,
Krzysztof Kaczmarski
|
|
|
Re: ocl standard lib primitive types [message #36702 is a reply to message #36314] |
Tue, 11 September 2007 16:23   |
Eclipse User |
|
|
|
Originally posted by: cdamus.ca.ibm.com
Hi, Krzysztof,
Your primitive type in the first case (found by navigating the UML model)
has no operations because it is an unresolved proxy. The proxy URI looks
odd: it is a relative reference to "oclstdlib.uml" instead of an absolute
reference of the form
platform:/plugin/org.eclipse.ocl.uml/model/oclstdlib.uml.
You'll need to figure out why this is being persisted with a relative URI.
HTH,
Christian
Krzysztof Kaczmarski wrote:
> Hi All,
> (I also send cc to mdt.uml2 beacause I don't really know who is the
> right addressee of this problem)
>
> In my uml models I use primitive types from oclstdlib.uml package
> because I need them to be equipped with operations (+, -, /, =, etc).
> When I load such a model and navigate in my procedure an element with
> such type I get something like this:
> org.eclipse.ocl.uml.impl.PrimitiveTypeImpl@151e824 (eProxyURI:
> oclstdlib.uml#_alYNtqjQEdu4LJng8Rasow)
>
> But then if I ask for owned elements (including operations) I get
> empty result which can be also seen in debugger where 'operations' are
> null for this type.
>
> However when I do:
> getOCLStandardLibrary().getInteger()
>
> I receive:
> org.eclipse.ocl.uml.impl.PrimitiveTypeImpl@1af8502 (name: Integer,
> visibility: <unset>) (isLeaf: false, visibility: public, isAbstract:
> false)
>
> with all needed operations inside.
>
> I suppose I load my models in a bad way so PrimitiveTypes loose their
> operations. But what should I do actually to preserve them?
>
> Thanks in advance,
> Krzysztof Kaczmarski
|
|
|
Re: ocl standard lib primitive types [message #37808 is a reply to message #36702] |
Mon, 24 September 2007 06:44   |
Eclipse User |
|
|
|
Originally posted by: krzysztof_kaczmarski.o2.pl
Hi Christian,
I think this is a relative URI because I use oclstdlib.uml manually in
my project. I see no way to use it as an absolute reference to the
plugin resource.
I would be very thankful if you could explain me in few words how to
create a UML model using UML example editor and incorporate these OCL
simple types there.
Thanks,
Krzysztof
Christian W. Damus wrote:
> Hi, Krzysztof,
>
> Your primitive type in the first case (found by navigating the UML model)
> has no operations because it is an unresolved proxy. The proxy URI looks
> odd: it is a relative reference to "oclstdlib.uml" instead of an absolute
> reference of the form
> platform:/plugin/org.eclipse.ocl.uml/model/oclstdlib.uml.
>
> You'll need to figure out why this is being persisted with a relative URI.
>
> HTH,
>
> Christian
>
>
> Krzysztof Kaczmarski wrote:
>
>> Hi All,
>> (I also send cc to mdt.uml2 beacause I don't really know who is the
>> right addressee of this problem)
>>
>> In my uml models I use primitive types from oclstdlib.uml package
>> because I need them to be equipped with operations (+, -, /, =, etc).
>> When I load such a model and navigate in my procedure an element with
>> such type I get something like this:
>> org.eclipse.ocl.uml.impl.PrimitiveTypeImpl@151e824 (eProxyURI:
>> oclstdlib.uml#_alYNtqjQEdu4LJng8Rasow)
>>
>> But then if I ask for owned elements (including operations) I get
>> empty result which can be also seen in debugger where 'operations' are
>> null for this type.
>>
>> However when I do:
>> getOCLStandardLibrary().getInteger()
>>
>> I receive:
>> org.eclipse.ocl.uml.impl.PrimitiveTypeImpl@1af8502 (name: Integer,
>> visibility: <unset>) (isLeaf: false, visibility: public, isAbstract:
>> false)
>>
>> with all needed operations inside.
>>
>> I suppose I load my models in a bad way so PrimitiveTypes loose their
>> operations. But what should I do actually to preserve them?
>>
>> Thanks in advance,
>> Krzysztof Kaczmarski
>
|
|
|
Re: ocl standard lib primitive types [message #37907 is a reply to message #37808] |
Mon, 24 September 2007 09:59   |
Eclipse User |
|
|
|
Originally posted by: cdamus.ca.ibm.com
Hi, Krzysztof,
Better than words, I can give you a tool that provides an example. Install
the org.eclipse.emf.ocl.examples.interpreter plug-in from the OCL Examples
build: this is the interactive console example. In your UML Editor,
select a classifier and choose the "Open OCL Console" action in the context
menu. Make sure that the "Modeling level" button in the console's action
bar is set to M1 and that the "Target metamodel" button is set to UML.
In the bottom panel of the console, enter an OCL constraint expression that
uses String or Integer or some other primitive type (or an attribute in
your model of that type). Check that the upper panel indicates successful
parsing, then use the Save action in the console's action bar to save to
XMI. See what the HREFs for the primitive types look like in the resulting
document, and have a look in the sample code (esp. the OCLResource class)
to see how it works.
HTH,
Christian
Krzysztof Kaczmarski wrote:
> Hi Christian,
>
> I think this is a relative URI because I use oclstdlib.uml manually in
> my project. I see no way to use it as an absolute reference to the
> plugin resource.
>
> I would be very thankful if you could explain me in few words how to
> create a UML model using UML example editor and incorporate these OCL
> simple types there.
>
> Thanks,
> Krzysztof
>
>
>
> Christian W. Damus wrote:
>> Hi, Krzysztof,
>>
>> Your primitive type in the first case (found by navigating the UML model)
>> has no operations because it is an unresolved proxy. The proxy URI looks
>> odd: it is a relative reference to "oclstdlib.uml" instead of an
>> absolute reference of the form
>> platform:/plugin/org.eclipse.ocl.uml/model/oclstdlib.uml.
>>
>> You'll need to figure out why this is being persisted with a relative
>> URI.
>>
>> HTH,
>>
>> Christian
>>
>>
>> Krzysztof Kaczmarski wrote:
>>
>>> Hi All,
>>> (I also send cc to mdt.uml2 beacause I don't really know who is the
>>> right addressee of this problem)
>>>
>>> In my uml models I use primitive types from oclstdlib.uml package
>>> because I need them to be equipped with operations (+, -, /, =, etc).
>>> When I load such a model and navigate in my procedure an element with
>>> such type I get something like this:
>>> org.eclipse.ocl.uml.impl.PrimitiveTypeImpl@151e824 (eProxyURI:
>>> oclstdlib.uml#_alYNtqjQEdu4LJng8Rasow)
>>>
>>> But then if I ask for owned elements (including operations) I get
>>> empty result which can be also seen in debugger where 'operations' are
>>> null for this type.
>>>
>>> However when I do:
>>> getOCLStandardLibrary().getInteger()
>>>
>>> I receive:
>>> org.eclipse.ocl.uml.impl.PrimitiveTypeImpl@1af8502 (name: Integer,
>>> visibility: <unset>) (isLeaf: false, visibility: public, isAbstract:
>>> false)
>>>
>>> with all needed operations inside.
>>>
>>> I suppose I load my models in a bad way so PrimitiveTypes loose their
>>> operations. But what should I do actually to preserve them?
>>>
>>> Thanks in advance,
>>> Krzysztof Kaczmarski
>>
|
|
|
Re: ocl standard lib primitive types [message #38253 is a reply to message #37907] |
Tue, 25 September 2007 02:05   |
Eclipse User |
|
|
|
Originally posted by: krzysztof_kaczmarski.o2.pl
Hi Christian,
I run the example and serialized an expression. I can see in the XMI
file that PrimitiveType really refers to ocl plugin's standard library:
<type xsi:type="ocl.uml:PrimitiveType"
href=" http://www.eclipse.org/ocl/1.1.0/oclstdlib.uml#_alYNtqjQEdu4 LJng8Rasow"/>
I can also see that there is "ocl.uml" namespace definition in the
file's header which is also referring to the ocl-uml plugin.
I read the code of OCLResource. It is a kind of XMIResourceImpl. I
understand that all what happens there is required for proper
expression's serialization.
But I don't get your point. Are you suggesting that I should extend
UMLResource and follow OCLResource in how it works?
I suppose that what I need is to use OCL standard library (taken from
ocl-uml plugin) instead of UML standard library taken from UML plugin.
When I serialize UML models I use method taken from UML Article Example:
ResourceSet RESOURCE_SET = new ResourceSetImpl();
Resource resource = RESOURCE_SET.createResource(fileURI);
Again, how can I force UML resource to use absolute reference to OCL
standard library? I see no answer here.
Cheers,
Krzysztof
Christian W. Damus wrote:
> Hi, Krzysztof,
>
> Better than words, I can give you a tool that provides an example. Install
> the org.eclipse.emf.ocl.examples.interpreter plug-in from the OCL Examples
> build: this is the interactive console example. In your UML Editor,
> select a classifier and choose the "Open OCL Console" action in the context
> menu. Make sure that the "Modeling level" button in the console's action
> bar is set to M1 and that the "Target metamodel" button is set to UML.
>
> In the bottom panel of the console, enter an OCL constraint expression that
> uses String or Integer or some other primitive type (or an attribute in
> your model of that type). Check that the upper panel indicates successful
> parsing, then use the Save action in the console's action bar to save to
> XMI. See what the HREFs for the primitive types look like in the resulting
> document, and have a look in the sample code (esp. the OCLResource class)
> to see how it works.
>
> HTH,
>
> Christian
>
>
> Krzysztof Kaczmarski wrote:
>
>> Hi Christian,
>>
>> I think this is a relative URI because I use oclstdlib.uml manually in
>> my project. I see no way to use it as an absolute reference to the
>> plugin resource.
>>
>> I would be very thankful if you could explain me in few words how to
>> create a UML model using UML example editor and incorporate these OCL
>> simple types there.
>>
>> Thanks,
>> Krzysztof
>>
>>
>>
>> Christian W. Damus wrote:
>>> Hi, Krzysztof,
>>>
>>> Your primitive type in the first case (found by navigating the UML model)
>>> has no operations because it is an unresolved proxy. The proxy URI looks
>>> odd: it is a relative reference to "oclstdlib.uml" instead of an
>>> absolute reference of the form
>>> platform:/plugin/org.eclipse.ocl.uml/model/oclstdlib.uml.
>>>
>>> You'll need to figure out why this is being persisted with a relative
>>> URI.
>>>
>>> HTH,
>>>
>>> Christian
>>>
>>>
>>> Krzysztof Kaczmarski wrote:
>>>
>>>> Hi All,
>>>> (I also send cc to mdt.uml2 beacause I don't really know who is the
>>>> right addressee of this problem)
>>>>
>>>> In my uml models I use primitive types from oclstdlib.uml package
>>>> because I need them to be equipped with operations (+, -, /, =, etc).
>>>> When I load such a model and navigate in my procedure an element with
>>>> such type I get something like this:
>>>> org.eclipse.ocl.uml.impl.PrimitiveTypeImpl@151e824 (eProxyURI:
>>>> oclstdlib.uml#_alYNtqjQEdu4LJng8Rasow)
>>>>
>>>> But then if I ask for owned elements (including operations) I get
>>>> empty result which can be also seen in debugger where 'operations' are
>>>> null for this type.
>>>>
>>>> However when I do:
>>>> getOCLStandardLibrary().getInteger()
>>>>
>>>> I receive:
>>>> org.eclipse.ocl.uml.impl.PrimitiveTypeImpl@1af8502 (name: Integer,
>>>> visibility: <unset>) (isLeaf: false, visibility: public, isAbstract:
>>>> false)
>>>>
>>>> with all needed operations inside.
>>>>
>>>> I suppose I load my models in a bad way so PrimitiveTypes loose their
>>>> operations. But what should I do actually to preserve them?
>>>>
>>>> Thanks in advance,
>>>> Krzysztof Kaczmarski
>
|
|
|
Re: ocl standard lib primitive types [message #38351 is a reply to message #36702] |
Tue, 25 September 2007 09:13   |
Eclipse User |
|
|
|
Originally posted by: krzysztof_kaczmarski.o2.pl
Hi Christian,
I managed to create a UML model with absolute reference path to
oclstdlib.uml by using getOCLStandardLibrary() from UMLEnvironment and
then serializing the model to a file.
When I load the model in UML Editor it looks rather odd. The type is
only described by "Primitive Type". If I look inside I see
<type xmi:type="ocl.uml:PrimitiveType"
href=" http://www.eclipse.org/ocl/1.1.0/oclstdlib.uml#_U68BFmthEdyj koeaSymL0A"/>
So I suppose it is ok now.
Now I load the model and navigate to the property of that type and see
the type is empty unresolved proxy as you said with eProxyURI set to
some sensible values I suppose.
How can I force MDT to resolve the proxy so I can see all the type's
informations instead of nulls ?
Thanks again,
Krzysztof
Christian W. Damus wrote:
> Hi, Krzysztof,
>
> Your primitive type in the first case (found by navigating the UML model)
> has no operations because it is an unresolved proxy. The proxy URI looks
> odd: it is a relative reference to "oclstdlib.uml" instead of an absolute
> reference of the form
> platform:/plugin/org.eclipse.ocl.uml/model/oclstdlib.uml.
>
> You'll need to figure out why this is being persisted with a relative URI.
>
> HTH,
>
> Christian
>
>
> Krzysztof Kaczmarski wrote:
>
>> Hi All,
>> (I also send cc to mdt.uml2 beacause I don't really know who is the
>> right addressee of this problem)
>>
>> In my uml models I use primitive types from oclstdlib.uml package
>> because I need them to be equipped with operations (+, -, /, =, etc).
>> When I load such a model and navigate in my procedure an element with
>> such type I get something like this:
>> org.eclipse.ocl.uml.impl.PrimitiveTypeImpl@151e824 (eProxyURI:
>> oclstdlib.uml#_alYNtqjQEdu4LJng8Rasow)
>>
>> But then if I ask for owned elements (including operations) I get
>> empty result which can be also seen in debugger where 'operations' are
>> null for this type.
>>
>> However when I do:
>> getOCLStandardLibrary().getInteger()
>>
>> I receive:
>> org.eclipse.ocl.uml.impl.PrimitiveTypeImpl@1af8502 (name: Integer,
>> visibility: <unset>) (isLeaf: false, visibility: public, isAbstract:
>> false)
>>
>> with all needed operations inside.
>>
>> I suppose I load my models in a bad way so PrimitiveTypes loose their
>> operations. But what should I do actually to preserve them?
>>
>> Thanks in advance,
>> Krzysztof Kaczmarski
>
|
|
| |
Re: ocl standard lib primitive types [message #38482 is a reply to message #38253] |
Tue, 25 September 2007 09:54   |
Eclipse User |
|
|
|
Originally posted by: cdamus.ca.ibm.com
Hi, Krzysztof,
Sorry, I don't think I understood what you were looking for the first time.
You shouldn't need to extend the UML resource implementation for what you
are doing. If you want to use types defined in the oclstdlib.uml model in
your UML model in the UML editor, then you should only need to use the
"Load Resource..." action in the context menu and specify the
http://www.eclipse.org/ocl/1.1.0/oclstdlib.uml
URI. As I indicated in my reply to your other post, this URI is registered
on EMF's URI mappings extension point, so the UML editor should be able to
load it.
Then, you will be able to browse its contents and select its types in the
properties of your UML attributes etc.
HTH,
Christian
Krzysztof Kaczmarski wrote:
> Hi Christian,
>
> I run the example and serialized an expression. I can see in the XMI
> file that PrimitiveType really refers to ocl plugin's standard library:
> <type xsi:type="ocl.uml:PrimitiveType"
>
href=" http://www.eclipse.org/ocl/1.1.0/oclstdlib.uml#_alYNtqjQEdu4 LJng8Rasow"/>
>
> I can also see that there is "ocl.uml" namespace definition in the
> file's header which is also referring to the ocl-uml plugin.
>
> I read the code of OCLResource. It is a kind of XMIResourceImpl. I
> understand that all what happens there is required for proper
> expression's serialization.
>
> But I don't get your point. Are you suggesting that I should extend
> UMLResource and follow OCLResource in how it works?
>
> I suppose that what I need is to use OCL standard library (taken from
> ocl-uml plugin) instead of UML standard library taken from UML plugin.
> When I serialize UML models I use method taken from UML Article Example:
> ResourceSet RESOURCE_SET = new ResourceSetImpl();
> Resource resource = RESOURCE_SET.createResource(fileURI);
>
> Again, how can I force UML resource to use absolute reference to OCL
> standard library? I see no answer here.
>
> Cheers,
> Krzysztof
-----8<-----
|
|
|
Re: ocl standard lib primitive types [message #38548 is a reply to message #38449] |
Tue, 25 September 2007 10:36   |
Eclipse User |
|
|
|
Originally posted by: krzysztof_kaczmarski.o2.pl
Hi Christian,
I am trying both: Eclipse instance and standalone application for
automated testing.
I did:
Map<URI, URI> map = RESOURCE_SET.getURIConverter().getURIMap();
map.put(URI.createURI("http://www.eclipse.org/ocl/1.1.0/oclstdlib.uml"),
URI.createPlatformResourceURI("eclipse.ocl.uml/model/oclstdlib.uml ",
true));
but it didn't work out. What should be the argument for
createPlatformResourceURI ?
Thanks,
Krzysztof
Christian W. Damus wrote:
> Hi, Krzysztof,
>
> Are you doing all of this within the Eclipse platform, or in a stand-alone
> application? The org.eclipse.ocl.uml plug-in defines a URI mapping on
> EMF's extension point that maps the http: URI of your type reference to the
> platform:/plugin URI of the resource's deployed location.
>
> If you are not in an Eclipse instance, then you will have to set up this
> mapping yourself in the URIConverter of your ResourceSet.
>
> Cheers,
>
> Christian
>
>
> Krzysztof Kaczmarski wrote:
>
>> Hi Christian,
>>
>> I managed to create a UML model with absolute reference path to
>> oclstdlib.uml by using getOCLStandardLibrary() from UMLEnvironment and
>> then serializing the model to a file.
>>
>> When I load the model in UML Editor it looks rather odd. The type is
>> only described by "Primitive Type". If I look inside I see
>> <type xmi:type="ocl.uml:PrimitiveType"
>>
> href=" http://www.eclipse.org/ocl/1.1.0/oclstdlib.uml#_U68BFmthEdyj koeaSymL0A"/>
>> So I suppose it is ok now.
>>
>> Now I load the model and navigate to the property of that type and see
>> the type is empty unresolved proxy as you said with eProxyURI set to
>> some sensible values I suppose.
>>
>> How can I force MDT to resolve the proxy so I can see all the type's
>> informations instead of nulls ?
>>
>> Thanks again,
>> Krzysztof
>>
>
> ------8<------
|
|
|
Re: ocl standard lib primitive types [message #38614 is a reply to message #38548] |
Tue, 25 September 2007 10:43   |
Eclipse User |
|
|
|
Originally posted by: cdamus.ca.ibm.com
Hi, Krzysztof,
You want to do
URI.createPlatformPluginURI("org.eclipse.ocl.uml/model/oclstdlib.uml ")
but you shouldn't need to in an Eclipse instance because the mapping is
already supplied for you, and it's not helpful outside of Eclipse where the
platform: scheme is not implemented. In that context, you need to provide
a jar:file: URI on the JAR bundle. have a look at how the AllTests class
in the org.eclipse.ocl.standalone.tests plug-in sets up these mappings
(only available in the CVS repository).
Cheers,
Christian
Krzysztof Kaczmarski wrote:
> Hi Christian,
>
> I am trying both: Eclipse instance and standalone application for
> automated testing.
>
> I did:
>
> Map<URI, URI> map = RESOURCE_SET.getURIConverter().getURIMap();
> map.put(URI.createURI("http://www.eclipse.org/ocl/1.1.0/oclstdlib.uml"),
> URI.createPlatformResourceURI("eclipse.ocl.uml/model/oclstdlib.uml ",
> true));
>
> but it didn't work out. What should be the argument for
> createPlatformResourceURI ?
>
> Thanks,
> Krzysztof
<snip>
|
|
|
Re: ocl standard lib primitive types [message #38647 is a reply to message #38614] |
Tue, 25 September 2007 10:50   |
Eclipse User |
|
|
|
Originally posted by: krzysztof_kaczmarski.o2.pl
Thank you Christian.
KK
Christian W. Damus wrote:
> Hi, Krzysztof,
>
> You want to do
>
> URI.createPlatformPluginURI("org.eclipse.ocl.uml/model/oclstdlib.uml ")
>
> but you shouldn't need to in an Eclipse instance because the mapping is
> already supplied for you, and it's not helpful outside of Eclipse where the
> platform: scheme is not implemented. In that context, you need to provide
> a jar:file: URI on the JAR bundle. have a look at how the AllTests class
> in the org.eclipse.ocl.standalone.tests plug-in sets up these mappings
> (only available in the CVS repository).
>
> Cheers,
>
> Christian
>
>
> Krzysztof Kaczmarski wrote:
>
>> Hi Christian,
>>
>> I am trying both: Eclipse instance and standalone application for
>> automated testing.
>>
>> I did:
>>
>> Map<URI, URI> map = RESOURCE_SET.getURIConverter().getURIMap();
>> map.put(URI.createURI("http://www.eclipse.org/ocl/1.1.0/oclstdlib.uml"),
>> URI.createPlatformResourceURI("eclipse.ocl.uml/model/oclstdlib.uml ",
>> true));
>>
>> but it didn't work out. What should be the argument for
>> createPlatformResourceURI ?
>>
>> Thanks,
>> Krzysztof
>
> <snip>
|
|
|
Re: ocl standard lib primitive types [message #39476 is a reply to message #38614] |
Fri, 28 September 2007 14:53   |
Eclipse User |
|
|
|
Originally posted by: krzysztof_kaczmarski.o2.pl
Hi Christian,
I am sorry to bother you again. Now I run my application only as an
Eclipse plug-in. (standalone run is too complicated for now)
I run Eclipse with all plug-ins (plus mine) enabled. In my plug-in I
load the model with an element that has type set to OCL Primitive Type
(Integer) and it appears again only as an empty proxy. It is not
resolved automatically.
(other types appear normally)
What else can I do?
Cheers,
Krzysztof
Christian W. Damus wrote:
> Hi, Krzysztof,
>
> You want to do
>
> URI.createPlatformPluginURI("org.eclipse.ocl.uml/model/oclstdlib.uml ")
>
> but you shouldn't need to in an Eclipse instance because the mapping is
> already supplied for you, and it's not helpful outside of Eclipse where the
> platform: scheme is not implemented. In that context, you need to provide
> a jar:file: URI on the JAR bundle. have a look at how the AllTests class
> in the org.eclipse.ocl.standalone.tests plug-in sets up these mappings
> (only available in the CVS repository).
>
> Cheers,
>
> Christian
>
>
> Krzysztof Kaczmarski wrote:
>
>> Hi Christian,
>>
>> I am trying both: Eclipse instance and standalone application for
>> automated testing.
>>
>> I did:
>>
>> Map<URI, URI> map = RESOURCE_SET.getURIConverter().getURIMap();
>> map.put(URI.createURI("http://www.eclipse.org/ocl/1.1.0/oclstdlib.uml"),
>> URI.createPlatformResourceURI("eclipse.ocl.uml/model/oclstdlib.uml ",
>> true));
>>
>> but it didn't work out. What should be the argument for
>> createPlatformResourceURI ?
>>
>> Thanks,
>> Krzysztof
>
> <snip>
|
|
|
Re: ocl standard lib primitive types [message #39506 is a reply to message #39476] |
Fri, 28 September 2007 15:12   |
Eclipse User |
|
|
|
Originally posted by: krzysztof_kaczmarski.o2.pl
One more thing.
When I open this model uml file in Eclipse and navigate to this
element It is again displayed only as "Primitive Type". It has no
name. It looks like UML Editor cannot access its properties.
Maybe it is just an empty proxy there too ?
Cheers,
Krzysztof
Ps. I checked path to the type in XMI file again and it correctly
points to absolute destination.
Krzysztof Kaczmarski wrote:
> Hi Christian,
>
> I am sorry to bother you again. Now I run my application only as an
> Eclipse plug-in. (standalone run is too complicated for now)
> I run Eclipse with all plug-ins (plus mine) enabled. In my plug-in I
> load the model with an element that has type set to OCL Primitive Type
> (Integer) and it appears again only as an empty proxy. It is not
> resolved automatically.
> (other types appear normally)
> What else can I do?
>
> Cheers,
> Krzysztof
>
>
>
> Christian W. Damus wrote:
>> Hi, Krzysztof,
>>
>> You want to do
>>
>> URI.createPlatformPluginURI("org.eclipse.ocl.uml/model/oclstdlib.uml ")
>>
>> but you shouldn't need to in an Eclipse instance because the mapping is
>> already supplied for you, and it's not helpful outside of Eclipse
>> where the
>> platform: scheme is not implemented. In that context, you need to
>> provide
>> a jar:file: URI on the JAR bundle. have a look at how the AllTests class
>> in the org.eclipse.ocl.standalone.tests plug-in sets up these mappings
>> (only available in the CVS repository).
>>
>> Cheers,
>>
>> Christian
>>
>>
>> Krzysztof Kaczmarski wrote:
>>
>>> Hi Christian,
>>>
>>> I am trying both: Eclipse instance and standalone application for
>>> automated testing.
>>>
>>> I did:
>>>
>>> Map<URI, URI> map = RESOURCE_SET.getURIConverter().getURIMap();
>>> map.put(URI.createURI("http://www.eclipse.org/ocl/1.1.0/oclstdlib.uml"),
>>> URI.createPlatformResourceURI("eclipse.ocl.uml/model/oclstdlib.uml ",
>>> true));
>>>
>>> but it didn't work out. What should be the argument for
>>> createPlatformResourceURI ?
>>>
>>> Thanks,
>>> Krzysztof
>>
>> <snip>
|
|
|
Re: ocl standard lib primitive types [message #39568 is a reply to message #39506] |
Sat, 29 September 2007 01:27   |
Eclipse User |
|
|
|
Originally posted by: krzysztof_kaczmarski.o2.pl
I also checked that URIConverter.URI_MAP contains following keys:
pathmap://UML_METAMODELS/,
pathmap://UML_PROFILES/,
pathmap://UML_LIBRARIES/,
http://www.eclipse.org/ocl/1.1.0/oclstdlib.ecore,
http://www.eclipse.org/ocl/1.1.0/oclstdlib.uml
and following values:
platform:/plugin/org.eclipse.uml2.uml.resources/metamodels/,
platform:/plugin/org.eclipse.uml2.uml.resources/profiles/,
platform:/plugin/org.eclipse.uml2.uml.resources/libraries/,
platform:/plugin/org.eclipse.ocl.ecore/model/oclstdlib.ecore ,
platform:/plugin/org.eclipse.ocl.uml/model/oclstdlib.uml
which seems to be ok, so why this automatic proxy resolver is not working?
Regards,
KK
Krzysztof Kaczmarski wrote:
> One more thing.
> When I open this model uml file in Eclipse and navigate to this element
> It is again displayed only as "Primitive Type". It has no name. It looks
> like UML Editor cannot access its properties.
> Maybe it is just an empty proxy there too ?
>
> Cheers,
> Krzysztof
>
> Ps. I checked path to the type in XMI file again and it correctly points
> to absolute destination.
>
>
> Krzysztof Kaczmarski wrote:
>> Hi Christian,
>>
>> I am sorry to bother you again. Now I run my application only as an
>> Eclipse plug-in. (standalone run is too complicated for now)
>> I run Eclipse with all plug-ins (plus mine) enabled. In my plug-in I
>> load the model with an element that has type set to OCL Primitive Type
>> (Integer) and it appears again only as an empty proxy. It is not
>> resolved automatically.
>> (other types appear normally)
>> What else can I do?
>>
>> Cheers,
>> Krzysztof
>>
>>
>>
>> Christian W. Damus wrote:
>>> Hi, Krzysztof,
>>>
>>> You want to do
>>>
>>> URI.createPlatformPluginURI("org.eclipse.ocl.uml/model/oclstdlib.uml ")
>>>
>>> but you shouldn't need to in an Eclipse instance because the mapping is
>>> already supplied for you, and it's not helpful outside of Eclipse
>>> where the
>>> platform: scheme is not implemented. In that context, you need to
>>> provide
>>> a jar:file: URI on the JAR bundle. have a look at how the AllTests
>>> class
>>> in the org.eclipse.ocl.standalone.tests plug-in sets up these mappings
>>> (only available in the CVS repository).
>>>
>>> Cheers,
>>>
>>> Christian
>>>
>>>
>>> Krzysztof Kaczmarski wrote:
>>>
>>>> Hi Christian,
>>>>
>>>> I am trying both: Eclipse instance and standalone application for
>>>> automated testing.
>>>>
>>>> I did:
>>>>
>>>> Map<URI, URI> map = RESOURCE_SET.getURIConverter().getURIMap();
>>>> map.put(URI.createURI("http://www.eclipse.org/ocl/1.1.0/oclstdlib.uml"),
>>>>
>>>> URI.createPlatformResourceURI("eclipse.ocl.uml/model/oclstdlib.uml ",
>>>> true));
>>>>
>>>> but it didn't work out. What should be the argument for
>>>> createPlatformResourceURI ?
>>>>
>>>> Thanks,
>>>> Krzysztof
>>>
>>> <snip>
|
|
|
Re: ocl standard lib primitive types [message #39631 is a reply to message #39568] |
Mon, 01 October 2007 09:33   |
Eclipse User |
|
|
|
Originally posted by: cdamus.ca.ibm.com
Hi, Krzysztof,
Yes, this is puzzling.
Would you be able to attach a small test project that demonstrates your
problem? You might include an Ant-based launcher that provides an
Eclipse-free class path such as is done in the launchers/ folder in the
org.eclipse.ocl.standalone.tests project in MDT OCL. I would like to debug
it to see what is going wrong. Hopefully it is a bug in OCL that I can
fix, but I don't have any more ideas about what it could be.
Thanks,
Christian
Krzysztof Kaczmarski wrote:
> I also checked that URIConverter.URI_MAP contains following keys:
> pathmap://UML_METAMODELS/,
> pathmap://UML_PROFILES/,
> pathmap://UML_LIBRARIES/,
> http://www.eclipse.org/ocl/1.1.0/oclstdlib.ecore,
> http://www.eclipse.org/ocl/1.1.0/oclstdlib.uml
>
> and following values:
> platform:/plugin/org.eclipse.uml2.uml.resources/metamodels/,
> platform:/plugin/org.eclipse.uml2.uml.resources/profiles/,
> platform:/plugin/org.eclipse.uml2.uml.resources/libraries/,
> platform:/plugin/org.eclipse.ocl.ecore/model/oclstdlib.ecore ,
> platform:/plugin/org.eclipse.ocl.uml/model/oclstdlib.uml
>
> which seems to be ok, so why this automatic proxy resolver is not working?
>
> Regards,
> KK
-----8<-----
|
|
|
Re: ocl standard lib primitive types [message #39905 is a reply to message #39631] |
Tue, 02 October 2007 15:33  |
Eclipse User |
|
|
|
Originally posted by: krzysztof_kaczmarski.o2.pl
Hi, Christian,
while preparing a demo for you I think I found source of the problem.
I was surprised that a demo plug-in was working correctly!
Looking for differences, I discovered a very slight change to the uml
model file. In my main sample model OCL Primitive Type was used
without being imported into a package.
This is the reason why proxy was not resolved automatically.
Thanks for your effort to answer my questions anyway.
Cheers,
Krzysztof
Christian W. Damus wrote:
> Hi, Krzysztof,
>
> Yes, this is puzzling.
>
> Would you be able to attach a small test project that demonstrates your
> problem? You might include an Ant-based launcher that provides an
> Eclipse-free class path such as is done in the launchers/ folder in the
> org.eclipse.ocl.standalone.tests project in MDT OCL. I would like to debug
> it to see what is going wrong. Hopefully it is a bug in OCL that I can
> fix, but I don't have any more ideas about what it could be.
>
> Thanks,
>
> Christian
>
>
> Krzysztof Kaczmarski wrote:
>
>> I also checked that URIConverter.URI_MAP contains following keys:
>> pathmap://UML_METAMODELS/,
>> pathmap://UML_PROFILES/,
>> pathmap://UML_LIBRARIES/,
>> http://www.eclipse.org/ocl/1.1.0/oclstdlib.ecore,
>> http://www.eclipse.org/ocl/1.1.0/oclstdlib.uml
>>
>> and following values:
>> platform:/plugin/org.eclipse.uml2.uml.resources/metamodels/,
>> platform:/plugin/org.eclipse.uml2.uml.resources/profiles/,
>> platform:/plugin/org.eclipse.uml2.uml.resources/libraries/,
>> platform:/plugin/org.eclipse.ocl.ecore/model/oclstdlib.ecore ,
>> platform:/plugin/org.eclipse.ocl.uml/model/oclstdlib.uml
>>
>> which seems to be ok, so why this automatic proxy resolver is not working?
>>
>> Regards,
>> KK
>
> -----8<-----
|
|
|
Goto Forum:
Current Time: Thu Apr 17 23:28:07 EDT 2025
Powered by FUDForum. Page generated in 0.07325 seconds
|