Home » Modeling » UML2 » [Stereotype] isAppliedStereotype differs on JavaDoc and Implementation
| | | | |
Re: [Stereotype] isAppliedStereotype differs on JavaDoc and Implementation [message #477317 is a reply to message #477305] |
Fri, 02 May 2008 08:17   |
Günther Falk Messages: 39 Registered: July 2009 |
Member |
|
|
Hi James,
I followed this guide to generate a profile and to apply the profile to
a UML class diagram:
http://www.eclipse.org/gmt/oaw/doc/4.2/html/contents/uml2exa mple.html#uml2example_profiles
We assume I have a stereotype named Test in a Profile named Test.
Therefore its qualified name is Test::Test.
In my class diagram I have a class House on which I apply the Stereotype
like it is explained in the "UML2 Example".
This works fine but now:
I load the model in a java class, I pass the model to a transformation
which loads the profile with the Test Stereotype. Til now all is ok.
I access the class and do a isStereoTypeApplicable() with the Test
Stereotype. This returns false.
I'll append this example soon.
Thanks for your help
Have a nice day
Günther
James Bruck schrieb:
> Hi Günther,
>
> I'm not sure what you mean by " it seems like the stereotypes are not
> applicable to classes, but they are through definition."
> As long as you you are applying the stereotype from the same profile, the
> fact that you are applying the stereotype to different diagrams should not
> have any bearing.
>
> If your model is confidential perhaps you could trim out any information
> that is not germane to the problem and mangle the names etc. It is
> difficult to guess at why the function seems to be failing. If you are
> feeling adventurous you might download the source code and step into the
> function to see why it is failing.
>
> Cheers,
> - James.
>
>
> "Günther Falk" <guenther@onetreetechnologies.com> wrote in message
> news:fva5jd$hfm$1@build.eclipse.org...
>> Hi,
>>
>> it seems like the stereotypes are not applicable to classes,
>> but they are through definition.
>> class.isStereotypeApplicable(stereo) returns false.
>> In the editor I applicated the same stereotypes.
>>
>> Is it because I do not load it from the same diagram?
>> I load it from the original diagram/profile and apply them afterwards to
>> another classdiagram within a model.
>>
>> I'm helpless.
>>
>> Günther
>>
>>
>> Günther Falk schrieb:
>>> Hi James,
>>>
>>> Thanks for your reply.
>>>
>>> James Bruck schrieb:
>>>> Hi Günther,
>>>>
>>>> Instead of "class.isAppliedStereotype" I think it is
>>>> "class.isStereotypeApplied()", regardless, the method should return true
>>>> as you would expect it to.
>>> Yes you are right here ;)
>>>
>>>> Do you possibly have two stereotypes that have the same name?
>>>>
>>> No, They are all different.
>>>> Would it be possible to post a small profile/model that demonstrates the
>>>> issue (or possibly JUnit test).
>>>>
>>> I need some time for this. I post it this evening. I have about 3 java
>>> classes around and this is a bit confidential stuff.
>>> Thanks again for the reply
>>>
>>> Günther
>
>
|
|
|
Re: [Stereotype] isAppliedStereotype differs on JavaDoc and Implementation [message #477318 is a reply to message #477317] |
Fri, 02 May 2008 09:05   |
Günther Falk Messages: 39 Registered: July 2009 |
Member |
|
|
Hi,
after some testing with another profile which is entirely on the
classpath, the functions seems to work.
Besides of that, the same test does not work on my model.
The only difference is the way I access the models. The test has been
made on two models I accessed through classpath, on the other test I
accessed the model through a file URI.
I try to put the model also into the classpath and make some tests.
Have a nice day
Günther
Günther Falk schrieb:
> Hi James,
>
> I followed this guide to generate a profile and to apply the profile to
> a UML class diagram:
> http://www.eclipse.org/gmt/oaw/doc/4.2/html/contents/uml2exa mple.html#uml2example_profiles
>
>
> We assume I have a stereotype named Test in a Profile named Test.
> Therefore its qualified name is Test::Test.
> In my class diagram I have a class House on which I apply the Stereotype
> like it is explained in the "UML2 Example".
>
> This works fine but now:
> I load the model in a java class, I pass the model to a transformation
> which loads the profile with the Test Stereotype. Til now all is ok.
>
> I access the class and do a isStereoTypeApplicable() with the Test
> Stereotype. This returns false.
>
> I'll append this example soon.
>
> Thanks for your help
> Have a nice day
>
> Günther
>
>
> James Bruck schrieb:
>> Hi Günther,
>>
>> I'm not sure what you mean by " it seems like the stereotypes are not
>> applicable to classes, but they are through definition."
>> As long as you you are applying the stereotype from the same profile,
>> the fact that you are applying the stereotype to different diagrams
>> should not have any bearing.
>>
>> If your model is confidential perhaps you could trim out any
>> information that is not germane to the problem and mangle the names
>> etc. It is difficult to guess at why the function seems to be
>> failing. If you are feeling adventurous you might download the
>> source code and step into the function to see why it is failing.
>>
>> Cheers,
>> - James.
>>
>>
>> "Günther Falk" <guenther@onetreetechnologies.com> wrote in message
>> news:fva5jd$hfm$1@build.eclipse.org...
>>> Hi,
>>>
>>> it seems like the stereotypes are not applicable to classes,
>>> but they are through definition.
>>> class.isStereotypeApplicable(stereo) returns false.
>>> In the editor I applicated the same stereotypes.
>>>
>>> Is it because I do not load it from the same diagram?
>>> I load it from the original diagram/profile and apply them afterwards to
>>> another classdiagram within a model.
>>>
>>> I'm helpless.
>>>
>>> Günther
>>>
>>>
>>> Günther Falk schrieb:
>>>> Hi James,
>>>>
>>>> Thanks for your reply.
>>>>
>>>> James Bruck schrieb:
>>>>> Hi Günther,
>>>>>
>>>>> Instead of "class.isAppliedStereotype" I think it is
>>>>> "class.isStereotypeApplied()", regardless, the method should return
>>>>> true as you would expect it to.
>>>> Yes you are right here ;)
>>>>
>>>>> Do you possibly have two stereotypes that have the same name?
>>>>>
>>>> No, They are all different.
>>>>> Would it be possible to post a small profile/model that
>>>>> demonstrates the issue (or possibly JUnit test).
>>>>>
>>>> I need some time for this. I post it this evening. I have about 3
>>>> java classes around and this is a bit confidential stuff.
>>>> Thanks again for the reply
>>>>
>>>> Günther
>>
>>
|
|
| |
Re: [Stereotype] eRessource null and Nearest Package null [message #477322 is a reply to message #477320] |
Fri, 02 May 2008 12:37   |
Günther Falk Messages: 39 Registered: July 2009 |
Member |
|
|
Hi,
I stepped into the code of uml2 and I found my problem. I don't know how
to interpret it, but I found it ;).
My Stereotype has an attached Extension to a Metaclass.
The code of isStereotypeApplicable fails on loading the EClassifier of
the Stereotype. I looked in Details and the eRessource and the Nearest
Package if the corresponding Type is null.
Anybody could help me please?
Thx
Günther
Günther Falk schrieb:
> Hi,
>
> here is the promised example. The isAppliedFunction() works there.
> I still have no clou why it is not working on my other project.
> I've done a copy paste ;(
>
> On the other hand, the isApplicableStereotype returns always false. I
> don't know why.
>
> Have a nice day
>
> Günther
>
> Günther Falk schrieb:
>> Hi James,
>>
>> I followed this guide to generate a profile and to apply the profile
>> to a UML class diagram:
>> http://www.eclipse.org/gmt/oaw/doc/4.2/html/contents/uml2exa mple.html#uml2example_profiles
>>
>>
>> We assume I have a stereotype named Test in a Profile named Test.
>> Therefore its qualified name is Test::Test.
>> In my class diagram I have a class House on which I apply the
>> Stereotype like it is explained in the "UML2 Example".
>>
>> This works fine but now:
>> I load the model in a java class, I pass the model to a transformation
>> which loads the profile with the Test Stereotype. Til now all is ok.
>>
>> I access the class and do a isStereoTypeApplicable() with the Test
>> Stereotype. This returns false.
>>
>> I'll append this example soon.
>>
>> Thanks for your help
>> Have a nice day
>>
>> Günther
>>
>>
>> James Bruck schrieb:
>>> Hi Günther,
>>>
>>> I'm not sure what you mean by " it seems like the stereotypes are not
>>> applicable to classes, but they are through definition."
>>> As long as you you are applying the stereotype from the same profile,
>>> the fact that you are applying the stereotype to different diagrams
>>> should not have any bearing.
>>>
>>> If your model is confidential perhaps you could trim out any
>>> information that is not germane to the problem and mangle the names
>>> etc. It is difficult to guess at why the function seems to be
>>> failing. If you are feeling adventurous you might download the
>>> source code and step into the function to see why it is failing.
>>>
>>> Cheers,
>>> - James.
>>>
>>>
>>> "Günther Falk" <guenther@onetreetechnologies.com> wrote in message
>>> news:fva5jd$hfm$1@build.eclipse.org...
>>>> Hi,
>>>>
>>>> it seems like the stereotypes are not applicable to classes,
>>>> but they are through definition.
>>>> class.isStereotypeApplicable(stereo) returns false.
>>>> In the editor I applicated the same stereotypes.
>>>>
>>>> Is it because I do not load it from the same diagram?
>>>> I load it from the original diagram/profile and apply them
>>>> afterwards to
>>>> another classdiagram within a model.
>>>>
>>>> I'm helpless.
>>>>
>>>> Günther
>>>>
>>>>
>>>> Günther Falk schrieb:
>>>>> Hi James,
>>>>>
>>>>> Thanks for your reply.
>>>>>
>>>>> James Bruck schrieb:
>>>>>> Hi Günther,
>>>>>>
>>>>>> Instead of "class.isAppliedStereotype" I think it is
>>>>>> "class.isStereotypeApplied()", regardless, the method should
>>>>>> return true as you would expect it to.
>>>>> Yes you are right here ;)
>>>>>
>>>>>> Do you possibly have two stereotypes that have the same name?
>>>>>>
>>>>> No, They are all different.
>>>>>> Would it be possible to post a small profile/model that
>>>>>> demonstrates the issue (or possibly JUnit test).
>>>>>>
>>>>> I need some time for this. I post it this evening. I have about 3
>>>>> java classes around and this is a bit confidential stuff.
>>>>> Thanks again for the reply
>>>>>
>>>>> Günther
>>>
>>>
>
|
|
| |
Re: [Stereotype] eRessource null and Nearest Package null [message #477324 is a reply to message #477323] |
Fri, 02 May 2008 14:38   |
Günther Falk Messages: 39 Registered: July 2009 |
Member |
|
|
Hi,
Thanks for your reply.
I've done that:
this.resource_set = new ResourceSetImpl();
this.resource_set.getPackageRegistry().put(UMLPackage.eNS_UR I,UMLPackage.eINSTANCE);
this.resource_set.getResourceFactoryRegistry().getExtensionT oFactoryMap().put(UMLResource.FILE_EXTENSION,UMLResource.Fac tory.INSTANCE);
/*
* init uri map
*/
Map<URI,URI> uri_map = this.resource_set.getURIConverter().getURIMap();
uri_map.put(
URI.createURI(UMLResource.LIBRARIES_PATHMAP),
URI.createFileURI(this.prop.getProperty("LIBRARIES_PATHMAP")));
uri_map.put(
URI.createURI(UMLResource.METAMODELS_PATHMAP),
URI.createFileURI(this.prop.getProperty("METAMODELS_PATHMAP ")));
uri_map.put(
URI.createURI(UMLResource.PROFILES_PATHMAP),
URI.createFileURI(this.prop.getProperty("PROFILES_PATHMAP")));
The properties are loaded from a properties file at the very beginning
of the constructor. They reference to a external extracted location of
the uml2 resource jar file. Without these lines I am not able to load
anything. They look like:
PROFILES_PATHMAP=/umlresource/profiles
(I'm working under Linux)
Nevertheless the error seems to come from not finding the eResource of
the ClassImpl Type.
A to string of the object gives this info:
org.eclipse.uml2.uml.internal.impl.ClassImpl@caf6c1 (eProxyURI:
pathmap://UML_METAMODELS/UML.metamodel.uml#Class)
I'm looking around in the code but it is very complicated because of
lots of interfaces and finally it is difficult to find the implementation.
The getNearestPackage function returns also null for this type.
in the UML file where the Proxy points at, I find the following:
<packagedElement xmi:type="uml:Class" xmi:id="OpaqueExpression"
name="OpaqueExpression">
<ownedComment xmi:id="OpaqueExpression-_ownedComment.0"
annotatedElement="OpaqueExpression">
.....
Thanks again for your help
Günther
Kenn Hussey schrieb:
> Günther,
>
> If you're running your code as a stand-alone application, have you ensured
> that the required packages and "pathmaps" have been registered (e.g. as per
> the FAQ, see
> http://wiki.eclipse.org/index.php/MDT-UML2-FAQ#What.27s_requ ired_to_load_a_UML_.28.uml.29_resource_from_a_standalone_app lication.3F)?
>
> Kenn
>
> "Günther Falk" <guenther@onetreetechnologies.com> wrote in message
> news:fvf1tm$mah$1@build.eclipse.org...
>> Hi,
>>
>> I stepped into the code of uml2 and I found my problem. I don't know how
>> to interpret it, but I found it ;).
>>
>> My Stereotype has an attached Extension to a Metaclass.
>> The code of isStereotypeApplicable fails on loading the EClassifier of the
>> Stereotype. I looked in Details and the eRessource and the Nearest Package
>> if the corresponding Type is null.
>>
>> Anybody could help me please?
>>
>> Thx
>>
>> Günther
>>
>> Günther Falk schrieb:
>>> Hi,
>>>
>>> here is the promised example. The isAppliedFunction() works there.
>>> I still have no clou why it is not working on my other project.
>>> I've done a copy paste ;(
>>>
>>> On the other hand, the isApplicableStereotype returns always false. I
>>> don't know why.
>>>
>>> Have a nice day
>>>
>>> Günther
>>>
>>> Günther Falk schrieb:
>>>> Hi James,
>>>>
>>>> I followed this guide to generate a profile and to apply the profile to
>>>> a UML class diagram:
>>>> http://www.eclipse.org/gmt/oaw/doc/4.2/html/contents/uml2exa mple.html#uml2example_profiles
>>>>
>>>> We assume I have a stereotype named Test in a Profile named Test.
>>>> Therefore its qualified name is Test::Test.
>>>> In my class diagram I have a class House on which I apply the Stereotype
>>>> like it is explained in the "UML2 Example".
>>>>
>>>> This works fine but now:
>>>> I load the model in a java class, I pass the model to a transformation
>>>> which loads the profile with the Test Stereotype. Til now all is ok.
>>>>
>>>> I access the class and do a isStereoTypeApplicable() with the Test
>>>> Stereotype. This returns false.
>>>>
>>>> I'll append this example soon.
>>>>
>>>> Thanks for your help
>>>> Have a nice day
>>>>
>>>> Günther
>>>>
>>>>
>>>> James Bruck schrieb:
>>>>> Hi Günther,
>>>>>
>>>>> I'm not sure what you mean by " it seems like the stereotypes are not
>>>>> applicable to classes, but they are through definition."
>>>>> As long as you you are applying the stereotype from the same profile,
>>>>> the fact that you are applying the stereotype to different diagrams
>>>>> should not have any bearing.
>>>>>
>>>>> If your model is confidential perhaps you could trim out any
>>>>> information that is not germane to the problem and mangle the names
>>>>> etc. It is difficult to guess at why the function seems to be failing.
>>>>> If you are feeling adventurous you might download the source code and
>>>>> step into the function to see why it is failing.
>>>>>
>>>>> Cheers,
>>>>> - James.
>>>>>
>>>>>
>>>>> "Günther Falk" <guenther@onetreetechnologies.com> wrote in message
>>>>> news:fva5jd$hfm$1@build.eclipse.org...
>>>>>> Hi,
>>>>>>
>>>>>> it seems like the stereotypes are not applicable to classes,
>>>>>> but they are through definition.
>>>>>> class.isStereotypeApplicable(stereo) returns false.
>>>>>> In the editor I applicated the same stereotypes.
>>>>>>
>>>>>> Is it because I do not load it from the same diagram?
>>>>>> I load it from the original diagram/profile and apply them afterwards
>>>>>> to
>>>>>> another classdiagram within a model.
>>>>>>
>>>>>> I'm helpless.
>>>>>>
>>>>>> Günther
>>>>>>
>>>>>>
>>>>>> Günther Falk schrieb:
>>>>>>> Hi James,
>>>>>>>
>>>>>>> Thanks for your reply.
>>>>>>>
>>>>>>> James Bruck schrieb:
>>>>>>>> Hi Günther,
>>>>>>>>
>>>>>>>> Instead of "class.isAppliedStereotype" I think it is
>>>>>>>> "class.isStereotypeApplied()", regardless, the method should return
>>>>>>>> true as you would expect it to.
>>>>>>> Yes you are right here ;)
>>>>>>>
>>>>>>>> Do you possibly have two stereotypes that have the same name?
>>>>>>>>
>>>>>>> No, They are all different.
>>>>>>>> Would it be possible to post a small profile/model that demonstrates
>>>>>>>> the issue (or possibly JUnit test).
>>>>>>>>
>>>>>>> I need some time for this. I post it this evening. I have about 3
>>>>>>> java classes around and this is a bit confidential stuff.
>>>>>>> Thanks again for the reply
>>>>>>>
>>>>>>> Günther
>>>>>
>
>
|
|
| | |
Re: [Stereotype] isAppliedStereotype differs on JavaDoc and Implementation [message #477327 is a reply to message #477325] |
Fri, 02 May 2008 15:01   |
Günther Falk Messages: 39 Registered: July 2009 |
Member |
|
|
Hi James,
Thanks for the reply.
I already read this article, but it does not really contain the
information how to apply a profile on another model.
Besides I don't generate the profile automatically. I have generated it
manually with the UML Editor.
I also have a stand alone app without eclipse plugin support.
The bad things happens when I try to use the stereotypes of this
profile. There are really bad and scary things happening:
When I load the file directly, I don't get the profile application on
the package within the model.
If I access it through the Classloader.getSystemressource() and get the
URI from it it works but it does not find the corresponding eRessource.
I don't know how to manage this.
The application I want to write should not have to be deployed in
eclipse. Therefore a plugin project is out of the question.
Thanks
Günther
James Bruck schrieb:
> Hi Günther
>
> I would suggest looking at this article when working with profiles...
> http://www.eclipse.org/modeling/mdt/uml2/docs/articles/Intro duction_to_UML2_Profiles/article.html
>
> - James.
>
>
> "Günther Falk" <guenther@onetreetechnologies.com> wrote in message
> news:fvein0$5d1$1@build.eclipse.org...
>> Hi James,
>>
>> I followed this guide to generate a profile and to apply the profile to a
>> UML class diagram:
>> http://www.eclipse.org/gmt/oaw/doc/4.2/html/contents/uml2exa mple.html#uml2example_profiles
>>
>> We assume I have a stereotype named Test in a Profile named Test.
>> Therefore its qualified name is Test::Test.
>> In my class diagram I have a class House on which I apply the Stereotype
>> like it is explained in the "UML2 Example".
>>
>> This works fine but now:
>> I load the model in a java class, I pass the model to a transformation
>> which loads the profile with the Test Stereotype. Til now all is ok.
>>
>> I access the class and do a isStereoTypeApplicable() with the Test
>> Stereotype. This returns false.
>>
>> I'll append this example soon.
>>
>> Thanks for your help
>> Have a nice day
>>
>> Günther
>>
>>
>> James Bruck schrieb:
>>> Hi Günther,
>>>
>>> I'm not sure what you mean by " it seems like the stereotypes are not
>>> applicable to classes, but they are through definition."
>>> As long as you you are applying the stereotype from the same profile, the
>>> fact that you are applying the stereotype to different diagrams should
>>> not have any bearing.
>>>
>>> If your model is confidential perhaps you could trim out any information
>>> that is not germane to the problem and mangle the names etc. It is
>>> difficult to guess at why the function seems to be failing. If you are
>>> feeling adventurous you might download the source code and step into the
>>> function to see why it is failing.
>>>
>>> Cheers,
>>> - James.
>>>
>>>
>>> "Günther Falk" <guenther@onetreetechnologies.com> wrote in message
>>> news:fva5jd$hfm$1@build.eclipse.org...
>>>> Hi,
>>>>
>>>> it seems like the stereotypes are not applicable to classes,
>>>> but they are through definition.
>>>> class.isStereotypeApplicable(stereo) returns false.
>>>> In the editor I applicated the same stereotypes.
>>>>
>>>> Is it because I do not load it from the same diagram?
>>>> I load it from the original diagram/profile and apply them afterwards to
>>>> another classdiagram within a model.
>>>>
>>>> I'm helpless.
>>>>
>>>> Günther
>>>>
>>>>
>>>> Günther Falk schrieb:
>>>>> Hi James,
>>>>>
>>>>> Thanks for your reply.
>>>>>
>>>>> James Bruck schrieb:
>>>>>> Hi Günther,
>>>>>>
>>>>>> Instead of "class.isAppliedStereotype" I think it is
>>>>>> "class.isStereotypeApplied()", regardless, the method should return
>>>>>> true as you would expect it to.
>>>>> Yes you are right here ;)
>>>>>
>>>>>> Do you possibly have two stereotypes that have the same name?
>>>>>>
>>>>> No, They are all different.
>>>>>> Would it be possible to post a small profile/model that demonstrates
>>>>>> the issue (or possibly JUnit test).
>>>>>>
>>>>> I need some time for this. I post it this evening. I have about 3 java
>>>>> classes around and this is a bit confidential stuff.
>>>>> Thanks again for the reply
>>>>>
>>>>> Günther
>
|
|
|
Re: [Stereotype] eRessource null and Nearest Package null [message #477329 is a reply to message #477326] |
Fri, 02 May 2008 15:29   |
Günther Falk Messages: 39 Registered: July 2009 |
Member |
|
|
Hi James,
Thanks for the Reply.
It didn't help.
It makes things worst.
Now It does not find the profile application node at all.
Has anyone ever tried to put something with uml2 outside of eclipse?
It can't be that worst, that you loose 2 days only because of something
easy like stereotype application.
Have a nice day
Günther
James Bruck schrieb:
> Hi Günther ,
>
> The problem is with the profile test.profile.uml.
> You have a nested profile under Test called Test2.
> 1. Move your stereotypes etc. up one level under the "Test" root level
> profile.
> 2. Delete the annotation with the ecore representation that exists
> currently.
> 3. Select the Test root.
> 4. Select UML Editor > Profile > Define.
>
> Reapply your profile to your class and retry.
>
> You should be good to go.
>
> - James.
>
>
> "Günther Falk" <guenther@onetreetechnologies.com> wrote in message
> news:fvf1tm$mah$1@build.eclipse.org...
>> Hi,
>>
>> I stepped into the code of uml2 and I found my problem. I don't know how
>> to interpret it, but I found it ;).
>>
>> My Stereotype has an attached Extension to a Metaclass.
>> The code of isStereotypeApplicable fails on loading the EClassifier of the
>> Stereotype. I looked in Details and the eRessource and the Nearest Package
>> if the corresponding Type is null.
>>
>> Anybody could help me please?
>>
>> Thx
>>
>> Günther
>>
>> Günther Falk schrieb:
>>> Hi,
>>>
>>> here is the promised example. The isAppliedFunction() works there.
>>> I still have no clou why it is not working on my other project.
>>> I've done a copy paste ;(
>>>
>>> On the other hand, the isApplicableStereotype returns always false. I
>>> don't know why.
>>>
>>> Have a nice day
>>>
>>> Günther
>>>
>>> Günther Falk schrieb:
>>>> Hi James,
>>>>
>>>> I followed this guide to generate a profile and to apply the profile to
>>>> a UML class diagram:
>>>> http://www.eclipse.org/gmt/oaw/doc/4.2/html/contents/uml2exa mple.html#uml2example_profiles
>>>>
>>>> We assume I have a stereotype named Test in a Profile named Test.
>>>> Therefore its qualified name is Test::Test.
>>>> In my class diagram I have a class House on which I apply the Stereotype
>>>> like it is explained in the "UML2 Example".
>>>>
>>>> This works fine but now:
>>>> I load the model in a java class, I pass the model to a transformation
>>>> which loads the profile with the Test Stereotype. Til now all is ok.
>>>>
>>>> I access the class and do a isStereoTypeApplicable() with the Test
>>>> Stereotype. This returns false.
>>>>
>>>> I'll append this example soon.
>>>>
>>>> Thanks for your help
>>>> Have a nice day
>>>>
>>>> Günther
>>>>
>>>>
>>>> James Bruck schrieb:
>>>>> Hi Günther,
>>>>>
>>>>> I'm not sure what you mean by " it seems like the stereotypes are not
>>>>> applicable to classes, but they are through definition."
>>>>> As long as you you are applying the stereotype from the same profile,
>>>>> the fact that you are applying the stereotype to different diagrams
>>>>> should not have any bearing.
>>>>>
>>>>> If your model is confidential perhaps you could trim out any
>>>>> information that is not germane to the problem and mangle the names
>>>>> etc. It is difficult to guess at why the function seems to be failing.
>>>>> If you are feeling adventurous you might download the source code and
>>>>> step into the function to see why it is failing.
>>>>>
>>>>> Cheers,
>>>>> - James.
>>>>>
>>>>>
>>>>> "Günther Falk" <guenther@onetreetechnologies.com> wrote in message
>>>>> news:fva5jd$hfm$1@build.eclipse.org...
>>>>>> Hi,
>>>>>>
>>>>>> it seems like the stereotypes are not applicable to classes,
>>>>>> but they are through definition.
>>>>>> class.isStereotypeApplicable(stereo) returns false.
>>>>>> In the editor I applicated the same stereotypes.
>>>>>>
>>>>>> Is it because I do not load it from the same diagram?
>>>>>> I load it from the original diagram/profile and apply them afterwards
>>>>>> to
>>>>>> another classdiagram within a model.
>>>>>>
>>>>>> I'm helpless.
>>>>>>
>>>>>> Günther
>>>>>>
>>>>>>
>>>>>> Günther Falk schrieb:
>>>>>>> Hi James,
>>>>>>>
>>>>>>> Thanks for your reply.
>>>>>>>
>>>>>>> James Bruck schrieb:
>>>>>>>> Hi Günther,
>>>>>>>>
>>>>>>>> Instead of "class.isAppliedStereotype" I think it is
>>>>>>>> "class.isStereotypeApplied()", regardless, the method should return
>>>>>>>> true as you would expect it to.
>>>>>>> Yes you are right here ;)
>>>>>>>
>>>>>>>> Do you possibly have two stereotypes that have the same name?
>>>>>>>>
>>>>>>> No, They are all different.
>>>>>>>> Would it be possible to post a small profile/model that demonstrates
>>>>>>>> the issue (or possibly JUnit test).
>>>>>>>>
>>>>>>> I need some time for this. I post it this evening. I have about 3
>>>>>>> java classes around and this is a bit confidential stuff.
>>>>>>> Thanks again for the reply
>>>>>>>
>>>>>>> Günther
>>>>>
>
>
|
|
| |
Re: [Stereotype] eRessource null and Nearest Package null [message #477331 is a reply to message #477330] |
Fri, 02 May 2008 15:48   |
Günther Falk Messages: 39 Registered: July 2009 |
Member |
|
|
Hi James,
> Did you reapply your profile and stereotype?
Yes I did. I tried that 2 times.
>
> What was the error in finding the profile application?
NullPointerException ;)
The Profile Application is null. In the model there is definitely a
Profile Application Node. But It does not find it.
Thanks
Günther
>
> - James.
>
> "Günther Falk" <guenther@onetreetechnologies.com> wrote in message
> news:fvfc1d$53b$1@build.eclipse.org...
>> Hi James,
>>
>> Thanks for the Reply.
>>
>> It didn't help.
>> It makes things worst.
>> Now It does not find the profile application node at all.
>>
>> Has anyone ever tried to put something with uml2 outside of eclipse?
>> It can't be that worst, that you loose 2 days only because of something
>> easy like stereotype application.
>>
>> Have a nice day
>>
>> Günther
>>
>> James Bruck schrieb:
>>> Hi Günther ,
>>>
>>> The problem is with the profile test.profile.uml.
>>> You have a nested profile under Test called Test2.
>>> 1. Move your stereotypes etc. up one level under the "Test" root level
>>> profile.
>>> 2. Delete the annotation with the ecore representation that exists
>>> currently.
>>> 3. Select the Test root.
>>> 4. Select UML Editor > Profile > Define.
>>>
>>> Reapply your profile to your class and retry.
>>>
>>> You should be good to go.
>>>
>>> - James.
>>>
>>>
>>> "Günther Falk" <guenther@onetreetechnologies.com> wrote in message
>>> news:fvf1tm$mah$1@build.eclipse.org...
>>>> Hi,
>>>>
>>>> I stepped into the code of uml2 and I found my problem. I don't know how
>>>> to interpret it, but I found it ;).
>>>>
>>>> My Stereotype has an attached Extension to a Metaclass.
>>>> The code of isStereotypeApplicable fails on loading the EClassifier of
>>>> the Stereotype. I looked in Details and the eRessource and the Nearest
>>>> Package if the corresponding Type is null.
>>>>
>>>> Anybody could help me please?
>>>>
>>>> Thx
>>>>
>>>> Günther
>>>>
>>>> Günther Falk schrieb:
>>>>> Hi,
>>>>>
>>>>> here is the promised example. The isAppliedFunction() works there.
>>>>> I still have no clou why it is not working on my other project.
>>>>> I've done a copy paste ;(
>>>>>
>>>>> On the other hand, the isApplicableStereotype returns always false. I
>>>>> don't know why.
>>>>>
>>>>> Have a nice day
>>>>>
>>>>> Günther
>>>>>
>>>>> Günther Falk schrieb:
>>>>>> Hi James,
>>>>>>
>>>>>> I followed this guide to generate a profile and to apply the profile
>>>>>> to a UML class diagram:
>>>>>> http://www.eclipse.org/gmt/oaw/doc/4.2/html/contents/uml2exa mple.html#uml2example_profiles
>>>>>>
>>>>>> We assume I have a stereotype named Test in a Profile named Test.
>>>>>> Therefore its qualified name is Test::Test.
>>>>>> In my class diagram I have a class House on which I apply the
>>>>>> Stereotype like it is explained in the "UML2 Example".
>>>>>>
>>>>>> This works fine but now:
>>>>>> I load the model in a java class, I pass the model to a transformation
>>>>>> which loads the profile with the Test Stereotype. Til now all is ok.
>>>>>>
>>>>>> I access the class and do a isStereoTypeApplicable() with the Test
>>>>>> Stereotype. This returns false.
>>>>>>
>>>>>> I'll append this example soon.
>>>>>>
>>>>>> Thanks for your help
>>>>>> Have a nice day
>>>>>>
>>>>>> Günther
>>>>>>
>>>>>>
>>>>>> James Bruck schrieb:
>>>>>>> Hi Günther,
>>>>>>>
>>>>>>> I'm not sure what you mean by " it seems like the stereotypes are not
>>>>>>> applicable to classes, but they are through definition."
>>>>>>> As long as you you are applying the stereotype from the same profile,
>>>>>>> the fact that you are applying the stereotype to different diagrams
>>>>>>> should not have any bearing.
>>>>>>>
>>>>>>> If your model is confidential perhaps you could trim out any
>>>>>>> information that is not germane to the problem and mangle the names
>>>>>>> etc. It is difficult to guess at why the function seems to be
>>>>>>> failing. If you are feeling adventurous you might download the source
>>>>>>> code and step into the function to see why it is failing.
>>>>>>>
>>>>>>> Cheers,
>>>>>>> - James.
>>>>>>>
>>>>>>>
>>>>>>> "Günther Falk" <guenther@onetreetechnologies.com> wrote in message
>>>>>>> news:fva5jd$hfm$1@build.eclipse.org...
>>>>>>>> Hi,
>>>>>>>>
>>>>>>>> it seems like the stereotypes are not applicable to classes,
>>>>>>>> but they are through definition.
>>>>>>>> class.isStereotypeApplicable(stereo) returns false.
>>>>>>>> In the editor I applicated the same stereotypes.
>>>>>>>>
>>>>>>>> Is it because I do not load it from the same diagram?
>>>>>>>> I load it from the original diagram/profile and apply them
>>>>>>>> afterwards to
>>>>>>>> another classdiagram within a model.
>>>>>>>>
>>>>>>>> I'm helpless.
>>>>>>>>
>>>>>>>> Günther
>>>>>>>>
>>>>>>>>
>>>>>>>> Günther Falk schrieb:
>>>>>>>>> Hi James,
>>>>>>>>>
>>>>>>>>> Thanks for your reply.
>>>>>>>>>
>>>>>>>>> James Bruck schrieb:
>>>>>>>>>> Hi Günther,
>>>>>>>>>>
>>>>>>>>>> Instead of "class.isAppliedStereotype" I think it is
>>>>>>>>>> "class.isStereotypeApplied()", regardless, the method should
>>>>>>>>>> return true as you would expect it to.
>>>>>>>>> Yes you are right here ;)
>>>>>>>>>
>>>>>>>>>> Do you possibly have two stereotypes that have the same name?
>>>>>>>>>>
>>>>>>>>> No, They are all different.
>>>>>>>>>> Would it be possible to post a small profile/model that
>>>>>>>>>> demonstrates the issue (or possibly JUnit test).
>>>>>>>>>>
>>>>>>>>> I need some time for this. I post it this evening. I have about 3
>>>>>>>>> java classes around and this is a bit confidential stuff.
>>>>>>>>> Thanks again for the reply
>>>>>>>>>
>>>>>>>>> Günther
>
|
|
| | |
Re: [Stereotype] Profile Application null [message #477345 is a reply to message #477334] |
Mon, 05 May 2008 07:45   |
Günther Falk Messages: 39 Registered: July 2009 |
Member |
|
|
Hi,
Nothing helps!
Either there is a big bug or some real example or howto is missing.
With these hints there is no standalone application possible with UML 2.1.1.
I neither get why the behaviour changes, when I access the File through
the classloader than directly through the file.
In the first he finds the profile application,
in the second he doesn't.
Thanks again for your help
Günther
PS: For the future it would be really nice to have a uml2 implementation
independent from eclipse! Or could be started outside eclipse!
Günther Falk schrieb:
> Hi James,
>
> A new Version of the small example.
> I try your suggestion with the migration guide tomorrow.
> Have a nice evening and thanks again
>
> Günther
>
> Günther Falk schrieb:
>> Hi James,
>>
>>> Did you reapply your profile and stereotype?
>> Yes I did. I tried that 2 times.
>>>
>>> What was the error in finding the profile application?
>> NullPointerException ;)
>> The Profile Application is null. In the model there is definitely a
>> Profile Application Node. But It does not find it.
>>
>> Thanks
>>
>> Günther
>>>
>>> - James.
>>>
>>> "Günther Falk" <guenther@onetreetechnologies.com> wrote in message
>>> news:fvfc1d$53b$1@build.eclipse.org...
>>>> Hi James,
>>>>
>>>> Thanks for the Reply.
>>>>
>>>> It didn't help.
>>>> It makes things worst.
>>>> Now It does not find the profile application node at all.
>>>>
>>>> Has anyone ever tried to put something with uml2 outside of eclipse?
>>>> It can't be that worst, that you loose 2 days only because of
>>>> something easy like stereotype application.
>>>>
>>>> Have a nice day
>>>>
>>>> Günther
>>>>
>>>> James Bruck schrieb:
>>>>> Hi Günther ,
>>>>>
>>>>> The problem is with the profile test.profile.uml.
>>>>> You have a nested profile under Test called Test2.
>>>>> 1. Move your stereotypes etc. up one level under the "Test" root
>>>>> level profile.
>>>>> 2. Delete the annotation with the ecore representation that exists
>>>>> currently.
>>>>> 3. Select the Test root.
>>>>> 4. Select UML Editor > Profile > Define.
>>>>>
>>>>> Reapply your profile to your class and retry.
>>>>>
>>>>> You should be good to go.
>>>>>
>>>>> - James.
>>>>>
>>>>>
>>>>> "Günther Falk" <guenther@onetreetechnologies.com> wrote in message
>>>>> news:fvf1tm$mah$1@build.eclipse.org...
>>>>>> Hi,
>>>>>>
>>>>>> I stepped into the code of uml2 and I found my problem. I don't
>>>>>> know how to interpret it, but I found it ;).
>>>>>>
>>>>>> My Stereotype has an attached Extension to a Metaclass.
>>>>>> The code of isStereotypeApplicable fails on loading the
>>>>>> EClassifier of the Stereotype. I looked in Details and the
>>>>>> eRessource and the Nearest Package if the corresponding Type is null.
>>>>>>
>>>>>> Anybody could help me please?
>>>>>>
>>>>>> Thx
>>>>>>
>>>>>> Günther
>>>>>>
>>>>>> Günther Falk schrieb:
>>>>>>> Hi,
>>>>>>>
>>>>>>> here is the promised example. The isAppliedFunction() works there.
>>>>>>> I still have no clou why it is not working on my other project.
>>>>>>> I've done a copy paste ;(
>>>>>>>
>>>>>>> On the other hand, the isApplicableStereotype returns always
>>>>>>> false. I don't know why.
>>>>>>>
>>>>>>> Have a nice day
>>>>>>>
>>>>>>> Günther
>>>>>>>
>>>>>>> Günther Falk schrieb:
>>>>>>>> Hi James,
>>>>>>>>
>>>>>>>> I followed this guide to generate a profile and to apply the
>>>>>>>> profile to a UML class diagram:
>>>>>>>> http://www.eclipse.org/gmt/oaw/doc/4.2/html/contents/uml2exa mple.html#uml2example_profiles
>>>>>>>>
>>>>>>>>
>>>>>>>> We assume I have a stereotype named Test in a Profile named
>>>>>>>> Test. Therefore its qualified name is Test::Test.
>>>>>>>> In my class diagram I have a class House on which I apply the
>>>>>>>> Stereotype like it is explained in the "UML2 Example".
>>>>>>>>
>>>>>>>> This works fine but now:
>>>>>>>> I load the model in a java class, I pass the model to a
>>>>>>>> transformation which loads the profile with the Test Stereotype.
>>>>>>>> Til now all is ok.
>>>>>>>>
>>>>>>>> I access the class and do a isStereoTypeApplicable() with the
>>>>>>>> Test Stereotype. This returns false.
>>>>>>>>
>>>>>>>> I'll append this example soon.
>>>>>>>>
>>>>>>>> Thanks for your help
>>>>>>>> Have a nice day
>>>>>>>>
>>>>>>>> Günther
>>>>>>>>
>>>>>>>>
>>>>>>>> James Bruck schrieb:
>>>>>>>>> Hi Günther,
>>>>>>>>>
>>>>>>>>> I'm not sure what you mean by " it seems like the stereotypes
>>>>>>>>> are not applicable to classes, but they are through definition."
>>>>>>>>> As long as you you are applying the stereotype from the same
>>>>>>>>> profile, the fact that you are applying the stereotype to
>>>>>>>>> different diagrams should not have any bearing.
>>>>>>>>>
>>>>>>>>> If your model is confidential perhaps you could trim out any
>>>>>>>>> information that is not germane to the problem and mangle the
>>>>>>>>> names etc. It is difficult to guess at why the function seems
>>>>>>>>> to be failing. If you are feeling adventurous you might
>>>>>>>>> download the source code and step into the function to see why
>>>>>>>>> it is failing.
>>>>>>>>>
>>>>>>>>> Cheers,
>>>>>>>>> - James.
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> "Günther Falk" <guenther@onetreetechnologies.com> wrote in
>>>>>>>>> message news:fva5jd$hfm$1@build.eclipse.org...
>>>>>>>>>> Hi,
>>>>>>>>>>
>>>>>>>>>> it seems like the stereotypes are not applicable to classes,
>>>>>>>>>> but they are through definition.
>>>>>>>>>> class.isStereotypeApplicable(stereo) returns false.
>>>>>>>>>> In the editor I applicated the same stereotypes.
>>>>>>>>>>
>>>>>>>>>> Is it because I do not load it from the same diagram?
>>>>>>>>>> I load it from the original diagram/profile and apply them
>>>>>>>>>> afterwards to
>>>>>>>>>> another classdiagram within a model.
>>>>>>>>>>
>>>>>>>>>> I'm helpless.
>>>>>>>>>>
>>>>>>>>>> Günther
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> Günther Falk schrieb:
>>>>>>>>>>> Hi James,
>>>>>>>>>>>
>>>>>>>>>>> Thanks for your reply.
>>>>>>>>>>>
>>>>>>>>>>> James Bruck schrieb:
>>>>>>>>>>>> Hi Günther,
>>>>>>>>>>>>
>>>>>>>>>>>> Instead of "class.isAppliedStereotype" I think it is
>>>>>>>>>>>> "class.isStereotypeApplied()", regardless, the method should
>>>>>>>>>>>> return true as you would expect it to.
>>>>>>>>>>> Yes you are right here ;)
>>>>>>>>>>>
>>>>>>>>>>>> Do you possibly have two stereotypes that have the same name?
>>>>>>>>>>>>
>>>>>>>>>>> No, They are all different.
>>>>>>>>>>>> Would it be possible to post a small profile/model that
>>>>>>>>>>>> demonstrates the issue (or possibly JUnit test).
>>>>>>>>>>>>
>>>>>>>>>>> I need some time for this. I post it this evening. I have
>>>>>>>>>>> about 3 java classes around and this is a bit confidential
>>>>>>>>>>> stuff.
>>>>>>>>>>> Thanks again for the reply
>>>>>>>>>>>
>>>>>>>>>>> Günther
>>>
>
|
|
| | | | |
Re: [Stereotype] Profile Application null [message #477360 is a reply to message #477355] |
Tue, 06 May 2008 08:38   |
Günther Falk Messages: 39 Registered: July 2009 |
Member |
|
|
Hi Kenn,
it is working now for the classpath related load of the model. Trailing
slashes where the solution. I trie to put this into the wiki as remark ;).
Thanks a lot.
Besides of that, when I'm using the file URI it does not find a profile
application. (The second way to load the model)
Why there are two profiles loaded? (Paths?)
The FileURI is in both cases the same. This last issue is the most
important one. I want to save the profile with the transformation
classes in a jar.
I think I should look with the paths to the profile in the model or?
(Relative vs. Absolute?)
Thanks again for the help.
Have a nice day
Günther
Kenn Hussey schrieb:
> Günther,
>
> OK, I have taken a close look at your model, profile, and sample code and
> was able to get things to work as expected.
>
> Firstly, using your original code, two copies of the profile were being
> loaded - one from the src folder and one from the build folder. I change the
> MODEL constant declaration so it looked like this (note the missing src/):
> private static final String MODEL = "test/example.uml";
>
> and I uncommented the first line of the try block (and commented out the
> second one):
> URI model_uri =
> URI.createURI(ClassLoader.getSystemResource(MODEL).toURI().t oString());
>
> //URI model_uri = URI.createFileURI(new File(MODEL).getAbsolutePath());
>
> Now that only one copy of the profile resource was being loaded, I got the
> expected results:
> Got model: org.eclipse.uml2.uml.internal.impl.ModelImpl@19c4091 (name:
> MyModel, visibility: <unset>) (viewpoint: <unset>)
>
> Got Stereotype: org.eclipse.uml2.uml.internal.impl.StereotypeImpl@93bca2
> (name: Test, visibility: <unset>) (isLeaf: false, isAbstract: false)
> (isActive: false)
>
> Got package: org.eclipse.uml2.uml.internal.impl.PackageImpl@1afd9cc
> (name: Env, visibility: <unset>)
>
> Got class: org.eclipse.uml2.uml.internal.impl.ClassImpl@dc3b82 (name:
> House, visibility: <unset>) (isLeaf: false, isAbstract: false) (isActive:
> false)
>
> Stereotype is applicable: true
>
> org.eclipse.uml2.uml.internal.impl.ProfileApplicationImpl@1a5e68a
> (isStrict: false)
>
> Stereotype is applied: true
>
> Applied Stereotype is:
> org.eclipse.uml2.uml.internal.impl.StereotypeImpl@93bca2 (name: Test,
> visibility: <unset>) (isLeaf: false, isAbstract: false) (isActive: false)
>
> I used these URIs for the pathmaps:
> public static final String LIBRARIES_PATHMAP =
> " C:/Workspaces/mdt_ganymede-workspace/org.eclipse.uml2.uml.re sources/libraries/ ";
>
> public static final String METAMODELS_PATHMAP =
> " C:/Workspaces/mdt_ganymede-workspace/org.eclipse.uml2.uml.re sources/metamodels/ ";
>
> public static final String PROFILES_PATHMAP =
> " C:/Workspaces/mdt_ganymede-workspace/org.eclipse.uml2.uml.re sources/profiles/ ";
>
> Note the trailing slash on these URIs - I think they were missing in your
> original source...
>
> Kenn
>
|
|
| | | | | |
Re: [Stereotype] isAppliedStereotype differs on JavaDoc and Implementation [message #626478 is a reply to message #477305] |
Fri, 02 May 2008 08:17  |
Günther Falk Messages: 39 Registered: July 2009 |
Member |
|
|
Hi James,
I followed this guide to generate a profile and to apply the profile to
a UML class diagram:
http://www.eclipse.org/gmt/oaw/doc/4.2/html/contents/uml2exa mple.html#uml2example_profiles
We assume I have a stereotype named Test in a Profile named Test.
Therefore its qualified name is Test::Test.
In my class diagram I have a class House on which I apply the Stereotype
like it is explained in the "UML2 Example".
This works fine but now:
I load the model in a java class, I pass the model to a transformation
which loads the profile with the Test Stereotype. Til now all is ok.
I access the class and do a isStereoTypeApplicable() with the Test
Stereotype. This returns false.
I'll append this example soon.
Thanks for your help
Have a nice day
Günther
James Bruck schrieb:
> Hi Günther,
>
> I'm not sure what you mean by " it seems like the stereotypes are not
> applicable to classes, but they are through definition."
> As long as you you are applying the stereotype from the same profile, the
> fact that you are applying the stereotype to different diagrams should not
> have any bearing.
>
> If your model is confidential perhaps you could trim out any information
> that is not germane to the problem and mangle the names etc. It is
> difficult to guess at why the function seems to be failing. If you are
> feeling adventurous you might download the source code and step into the
> function to see why it is failing.
>
> Cheers,
> - James.
>
>
> "Günther Falk" <guenther@onetreetechnologies.com> wrote in message
> news:fva5jd$hfm$1@build.eclipse.org...
>> Hi,
>>
>> it seems like the stereotypes are not applicable to classes,
>> but they are through definition.
>> class.isStereotypeApplicable(stereo) returns false.
>> In the editor I applicated the same stereotypes.
>>
>> Is it because I do not load it from the same diagram?
>> I load it from the original diagram/profile and apply them afterwards to
>> another classdiagram within a model.
>>
>> I'm helpless.
>>
>> Günther
>>
>>
>> Günther Falk schrieb:
>>> Hi James,
>>>
>>> Thanks for your reply.
>>>
>>> James Bruck schrieb:
>>>> Hi Günther,
>>>>
>>>> Instead of "class.isAppliedStereotype" I think it is
>>>> "class.isStereotypeApplied()", regardless, the method should return true
>>>> as you would expect it to.
>>> Yes you are right here ;)
>>>
>>>> Do you possibly have two stereotypes that have the same name?
>>>>
>>> No, They are all different.
>>>> Would it be possible to post a small profile/model that demonstrates the
>>>> issue (or possibly JUnit test).
>>>>
>>> I need some time for this. I post it this evening. I have about 3 java
>>> classes around and this is a bit confidential stuff.
>>> Thanks again for the reply
>>>
>>> Günther
>
>
|
|
|
Re: [Stereotype] isAppliedStereotype differs on JavaDoc and Implementation [message #626479 is a reply to message #477317] |
Fri, 02 May 2008 09:05  |
Günther Falk Messages: 39 Registered: July 2009 |
Member |
|
|
Hi,
after some testing with another profile which is entirely on the
classpath, the functions seems to work.
Besides of that, the same test does not work on my model.
The only difference is the way I access the models. The test has been
made on two models I accessed through classpath, on the other test I
accessed the model through a file URI.
I try to put the model also into the classpath and make some tests.
Have a nice day
Günther
Günther Falk schrieb:
> Hi James,
>
> I followed this guide to generate a profile and to apply the profile to
> a UML class diagram:
> http://www.eclipse.org/gmt/oaw/doc/4.2/html/contents/uml2exa mple.html#uml2example_profiles
>
>
> We assume I have a stereotype named Test in a Profile named Test.
> Therefore its qualified name is Test::Test.
> In my class diagram I have a class House on which I apply the Stereotype
> like it is explained in the "UML2 Example".
>
> This works fine but now:
> I load the model in a java class, I pass the model to a transformation
> which loads the profile with the Test Stereotype. Til now all is ok.
>
> I access the class and do a isStereoTypeApplicable() with the Test
> Stereotype. This returns false.
>
> I'll append this example soon.
>
> Thanks for your help
> Have a nice day
>
> Günther
>
>
> James Bruck schrieb:
>> Hi Günther,
>>
>> I'm not sure what you mean by " it seems like the stereotypes are not
>> applicable to classes, but they are through definition."
>> As long as you you are applying the stereotype from the same profile,
>> the fact that you are applying the stereotype to different diagrams
>> should not have any bearing.
>>
>> If your model is confidential perhaps you could trim out any
>> information that is not germane to the problem and mangle the names
>> etc. It is difficult to guess at why the function seems to be
>> failing. If you are feeling adventurous you might download the
>> source code and step into the function to see why it is failing.
>>
>> Cheers,
>> - James.
>>
>>
>> "Günther Falk" <guenther@onetreetechnologies.com> wrote in message
>> news:fva5jd$hfm$1@build.eclipse.org...
>>> Hi,
>>>
>>> it seems like the stereotypes are not applicable to classes,
>>> but they are through definition.
>>> class.isStereotypeApplicable(stereo) returns false.
>>> In the editor I applicated the same stereotypes.
>>>
>>> Is it because I do not load it from the same diagram?
>>> I load it from the original diagram/profile and apply them afterwards to
>>> another classdiagram within a model.
>>>
>>> I'm helpless.
>>>
>>> Günther
>>>
>>>
>>> Günther Falk schrieb:
>>>> Hi James,
>>>>
>>>> Thanks for your reply.
>>>>
>>>> James Bruck schrieb:
>>>>> Hi Günther,
>>>>>
>>>>> Instead of "class.isAppliedStereotype" I think it is
>>>>> "class.isStereotypeApplied()", regardless, the method should return
>>>>> true as you would expect it to.
>>>> Yes you are right here ;)
>>>>
>>>>> Do you possibly have two stereotypes that have the same name?
>>>>>
>>>> No, They are all different.
>>>>> Would it be possible to post a small profile/model that
>>>>> demonstrates the issue (or possibly JUnit test).
>>>>>
>>>> I need some time for this. I post it this evening. I have about 3
>>>> java classes around and this is a bit confidential stuff.
>>>> Thanks again for the reply
>>>>
>>>> Günther
>>
>>
|
|
| |
Re: [Stereotype] eRessource null and Nearest Package null [message #626483 is a reply to message #477320] |
Fri, 02 May 2008 12:37  |
Günther Falk Messages: 39 Registered: July 2009 |
Member |
|
|
Hi,
I stepped into the code of uml2 and I found my problem. I don't know how
to interpret it, but I found it ;).
My Stereotype has an attached Extension to a Metaclass.
The code of isStereotypeApplicable fails on loading the EClassifier of
the Stereotype. I looked in Details and the eRessource and the Nearest
Package if the corresponding Type is null.
Anybody could help me please?
Thx
Günther
Günther Falk schrieb:
> Hi,
>
> here is the promised example. The isAppliedFunction() works there.
> I still have no clou why it is not working on my other project.
> I've done a copy paste ;(
>
> On the other hand, the isApplicableStereotype returns always false. I
> don't know why.
>
> Have a nice day
>
> Günther
>
> Günther Falk schrieb:
>> Hi James,
>>
>> I followed this guide to generate a profile and to apply the profile
>> to a UML class diagram:
>> http://www.eclipse.org/gmt/oaw/doc/4.2/html/contents/uml2exa mple.html#uml2example_profiles
>>
>>
>> We assume I have a stereotype named Test in a Profile named Test.
>> Therefore its qualified name is Test::Test.
>> In my class diagram I have a class House on which I apply the
>> Stereotype like it is explained in the "UML2 Example".
>>
>> This works fine but now:
>> I load the model in a java class, I pass the model to a transformation
>> which loads the profile with the Test Stereotype. Til now all is ok.
>>
>> I access the class and do a isStereoTypeApplicable() with the Test
>> Stereotype. This returns false.
>>
>> I'll append this example soon.
>>
>> Thanks for your help
>> Have a nice day
>>
>> Günther
>>
>>
>> James Bruck schrieb:
>>> Hi Günther,
>>>
>>> I'm not sure what you mean by " it seems like the stereotypes are not
>>> applicable to classes, but they are through definition."
>>> As long as you you are applying the stereotype from the same profile,
>>> the fact that you are applying the stereotype to different diagrams
>>> should not have any bearing.
>>>
>>> If your model is confidential perhaps you could trim out any
>>> information that is not germane to the problem and mangle the names
>>> etc. It is difficult to guess at why the function seems to be
>>> failing. If you are feeling adventurous you might download the
>>> source code and step into the function to see why it is failing.
>>>
>>> Cheers,
>>> - James.
>>>
>>>
>>> "Günther Falk" <guenther@onetreetechnologies.com> wrote in message
>>> news:fva5jd$hfm$1@build.eclipse.org...
>>>> Hi,
>>>>
>>>> it seems like the stereotypes are not applicable to classes,
>>>> but they are through definition.
>>>> class.isStereotypeApplicable(stereo) returns false.
>>>> In the editor I applicated the same stereotypes.
>>>>
>>>> Is it because I do not load it from the same diagram?
>>>> I load it from the original diagram/profile and apply them
>>>> afterwards to
>>>> another classdiagram within a model.
>>>>
>>>> I'm helpless.
>>>>
>>>> Günther
>>>>
>>>>
>>>> Günther Falk schrieb:
>>>>> Hi James,
>>>>>
>>>>> Thanks for your reply.
>>>>>
>>>>> James Bruck schrieb:
>>>>>> Hi Günther,
>>>>>>
>>>>>> Instead of "class.isAppliedStereotype" I think it is
>>>>>> "class.isStereotypeApplied()", regardless, the method should
>>>>>> return true as you would expect it to.
>>>>> Yes you are right here ;)
>>>>>
>>>>>> Do you possibly have two stereotypes that have the same name?
>>>>>>
>>>>> No, They are all different.
>>>>>> Would it be possible to post a small profile/model that
>>>>>> demonstrates the issue (or possibly JUnit test).
>>>>>>
>>>>> I need some time for this. I post it this evening. I have about 3
>>>>> java classes around and this is a bit confidential stuff.
>>>>> Thanks again for the reply
>>>>>
>>>>> Günther
>>>
>>>
>
|
|
| |
Re: [Stereotype] eRessource null and Nearest Package null [message #626485 is a reply to message #477323] |
Fri, 02 May 2008 14:38  |
Günther Falk Messages: 39 Registered: July 2009 |
Member |
|
|
Hi,
Thanks for your reply.
I've done that:
this.resource_set = new ResourceSetImpl();
this.resource_set.getPackageRegistry().put(UMLPackage.eNS_UR I,UMLPackage.eINSTANCE);
this.resource_set.getResourceFactoryRegistry().getExtensionT oFactoryMap().put(UMLResource.FILE_EXTENSION,UMLResource.Fac tory.INSTANCE);
/*
* init uri map
*/
Map<URI,URI> uri_map = this.resource_set.getURIConverter().getURIMap();
uri_map.put(
URI.createURI(UMLResource.LIBRARIES_PATHMAP),
URI.createFileURI(this.prop.getProperty("LIBRARIES_PATHMAP")));
uri_map.put(
URI.createURI(UMLResource.METAMODELS_PATHMAP),
URI.createFileURI(this.prop.getProperty("METAMODELS_PATHMAP ")));
uri_map.put(
URI.createURI(UMLResource.PROFILES_PATHMAP),
URI.createFileURI(this.prop.getProperty("PROFILES_PATHMAP")));
The properties are loaded from a properties file at the very beginning
of the constructor. They reference to a external extracted location of
the uml2 resource jar file. Without these lines I am not able to load
anything. They look like:
PROFILES_PATHMAP=/umlresource/profiles
(I'm working under Linux)
Nevertheless the error seems to come from not finding the eResource of
the ClassImpl Type.
A to string of the object gives this info:
org.eclipse.uml2.uml.internal.impl.ClassImpl@caf6c1 (eProxyURI:
pathmap://UML_METAMODELS/UML.metamodel.uml#Class)
I'm looking around in the code but it is very complicated because of
lots of interfaces and finally it is difficult to find the implementation.
The getNearestPackage function returns also null for this type.
in the UML file where the Proxy points at, I find the following:
<packagedElement xmi:type="uml:Class" xmi:id="OpaqueExpression"
name="OpaqueExpression">
<ownedComment xmi:id="OpaqueExpression-_ownedComment.0"
annotatedElement="OpaqueExpression">
.....
Thanks again for your help
Günther
Kenn Hussey schrieb:
> Günther,
>
> If you're running your code as a stand-alone application, have you ensured
> that the required packages and "pathmaps" have been registered (e.g. as per
> the FAQ, see
> http://wiki.eclipse.org/index.php/MDT-UML2-FAQ#What.27s_requ ired_to_load_a_UML_.28.uml.29_resource_from_a_standalone_app lication.3F)?
>
> Kenn
>
> "Günther Falk" <guenther@onetreetechnologies.com> wrote in message
> news:fvf1tm$mah$1@build.eclipse.org...
>> Hi,
>>
>> I stepped into the code of uml2 and I found my problem. I don't know how
>> to interpret it, but I found it ;).
>>
>> My Stereotype has an attached Extension to a Metaclass.
>> The code of isStereotypeApplicable fails on loading the EClassifier of the
>> Stereotype. I looked in Details and the eRessource and the Nearest Package
>> if the corresponding Type is null.
>>
>> Anybody could help me please?
>>
>> Thx
>>
>> Günther
>>
>> Günther Falk schrieb:
>>> Hi,
>>>
>>> here is the promised example. The isAppliedFunction() works there.
>>> I still have no clou why it is not working on my other project.
>>> I've done a copy paste ;(
>>>
>>> On the other hand, the isApplicableStereotype returns always false. I
>>> don't know why.
>>>
>>> Have a nice day
>>>
>>> Günther
>>>
>>> Günther Falk schrieb:
>>>> Hi James,
>>>>
>>>> I followed this guide to generate a profile and to apply the profile to
>>>> a UML class diagram:
>>>> http://www.eclipse.org/gmt/oaw/doc/4.2/html/contents/uml2exa mple.html#uml2example_profiles
>>>>
>>>> We assume I have a stereotype named Test in a Profile named Test.
>>>> Therefore its qualified name is Test::Test.
>>>> In my class diagram I have a class House on which I apply the Stereotype
>>>> like it is explained in the "UML2 Example".
>>>>
>>>> This works fine but now:
>>>> I load the model in a java class, I pass the model to a transformation
>>>> which loads the profile with the Test Stereotype. Til now all is ok.
>>>>
>>>> I access the class and do a isStereoTypeApplicable() with the Test
>>>> Stereotype. This returns false.
>>>>
>>>> I'll append this example soon.
>>>>
>>>> Thanks for your help
>>>> Have a nice day
>>>>
>>>> Günther
>>>>
>>>>
>>>> James Bruck schrieb:
>>>>> Hi Günther,
>>>>>
>>>>> I'm not sure what you mean by " it seems like the stereotypes are not
>>>>> applicable to classes, but they are through definition."
>>>>> As long as you you are applying the stereotype from the same profile,
>>>>> the fact that you are applying the stereotype to different diagrams
>>>>> should not have any bearing.
>>>>>
>>>>> If your model is confidential perhaps you could trim out any
>>>>> information that is not germane to the problem and mangle the names
>>>>> etc. It is difficult to guess at why the function seems to be failing.
>>>>> If you are feeling adventurous you might download the source code and
>>>>> step into the function to see why it is failing.
>>>>>
>>>>> Cheers,
>>>>> - James.
>>>>>
>>>>>
>>>>> "Günther Falk" <guenther@onetreetechnologies.com> wrote in message
>>>>> news:fva5jd$hfm$1@build.eclipse.org...
>>>>>> Hi,
>>>>>>
>>>>>> it seems like the stereotypes are not applicable to classes,
>>>>>> but they are through definition.
>>>>>> class.isStereotypeApplicable(stereo) returns false.
>>>>>> In the editor I applicated the same stereotypes.
>>>>>>
>>>>>> Is it because I do not load it from the same diagram?
>>>>>> I load it from the original diagram/profile and apply them afterwards
>>>>>> to
>>>>>> another classdiagram within a model.
>>>>>>
>>>>>> I'm helpless.
>>>>>>
>>>>>> Günther
>>>>>>
>>>>>>
>>>>>> Günther Falk schrieb:
>>>>>>> Hi James,
>>>>>>>
>>>>>>> Thanks for your reply.
>>>>>>>
>>>>>>> James Bruck schrieb:
>>>>>>>> Hi Günther,
>>>>>>>>
>>>>>>>> Instead of "class.isAppliedStereotype" I think it is
>>>>>>>> "class.isStereotypeApplied()", regardless, the method should return
>>>>>>>> true as you would expect it to.
>>>>>>> Yes you are right here ;)
>>>>>>>
>>>>>>>> Do you possibly have two stereotypes that have the same name?
>>>>>>>>
>>>>>>> No, They are all different.
>>>>>>>> Would it be possible to post a small profile/model that demonstrates
>>>>>>>> the issue (or possibly JUnit test).
>>>>>>>>
>>>>>>> I need some time for this. I post it this evening. I have about 3
>>>>>>> java classes around and this is a bit confidential stuff.
>>>>>>> Thanks again for the reply
>>>>>>>
>>>>>>> Günther
>>>>>
>
>
|
|
| | |
Re: [Stereotype] isAppliedStereotype differs on JavaDoc and Implementation [message #626488 is a reply to message #477325] |
Fri, 02 May 2008 15:01  |
Günther Falk Messages: 39 Registered: July 2009 |
Member |
|
|
Hi James,
Thanks for the reply.
I already read this article, but it does not really contain the
information how to apply a profile on another model.
Besides I don't generate the profile automatically. I have generated it
manually with the UML Editor.
I also have a stand alone app without eclipse plugin support.
The bad things happens when I try to use the stereotypes of this
profile. There are really bad and scary things happening:
When I load the file directly, I don't get the profile application on
the package within the model.
If I access it through the Classloader.getSystemressource() and get the
URI from it it works but it does not find the corresponding eRessource.
I don't know how to manage this.
The application I want to write should not have to be deployed in
eclipse. Therefore a plugin project is out of the question.
Thanks
Günther
James Bruck schrieb:
> Hi Günther
>
> I would suggest looking at this article when working with profiles...
> http://www.eclipse.org/modeling/mdt/uml2/docs/articles/Intro duction_to_UML2_Profiles/article.html
>
> - James.
>
>
> "Günther Falk" <guenther@onetreetechnologies.com> wrote in message
> news:fvein0$5d1$1@build.eclipse.org...
>> Hi James,
>>
>> I followed this guide to generate a profile and to apply the profile to a
>> UML class diagram:
>> http://www.eclipse.org/gmt/oaw/doc/4.2/html/contents/uml2exa mple.html#uml2example_profiles
>>
>> We assume I have a stereotype named Test in a Profile named Test.
>> Therefore its qualified name is Test::Test.
>> In my class diagram I have a class House on which I apply the Stereotype
>> like it is explained in the "UML2 Example".
>>
>> This works fine but now:
>> I load the model in a java class, I pass the model to a transformation
>> which loads the profile with the Test Stereotype. Til now all is ok.
>>
>> I access the class and do a isStereoTypeApplicable() with the Test
>> Stereotype. This returns false.
>>
>> I'll append this example soon.
>>
>> Thanks for your help
>> Have a nice day
>>
>> Günther
>>
>>
>> James Bruck schrieb:
>>> Hi Günther,
>>>
>>> I'm not sure what you mean by " it seems like the stereotypes are not
>>> applicable to classes, but they are through definition."
>>> As long as you you are applying the stereotype from the same profile, the
>>> fact that you are applying the stereotype to different diagrams should
>>> not have any bearing.
>>>
>>> If your model is confidential perhaps you could trim out any information
>>> that is not germane to the problem and mangle the names etc. It is
>>> difficult to guess at why the function seems to be failing. If you are
>>> feeling adventurous you might download the source code and step into the
>>> function to see why it is failing.
>>>
>>> Cheers,
>>> - James.
>>>
>>>
>>> "Günther Falk" <guenther@onetreetechnologies.com> wrote in message
>>> news:fva5jd$hfm$1@build.eclipse.org...
>>>> Hi,
>>>>
>>>> it seems like the stereotypes are not applicable to classes,
>>>> but they are through definition.
>>>> class.isStereotypeApplicable(stereo) returns false.
>>>> In the editor I applicated the same stereotypes.
>>>>
>>>> Is it because I do not load it from the same diagram?
>>>> I load it from the original diagram/profile and apply them afterwards to
>>>> another classdiagram within a model.
>>>>
>>>> I'm helpless.
>>>>
>>>> Günther
>>>>
>>>>
>>>> Günther Falk schrieb:
>>>>> Hi James,
>>>>>
>>>>> Thanks for your reply.
>>>>>
>>>>> James Bruck schrieb:
>>>>>> Hi Günther,
>>>>>>
>>>>>> Instead of "class.isAppliedStereotype" I think it is
>>>>>> "class.isStereotypeApplied()", regardless, the method should return
>>>>>> true as you would expect it to.
>>>>> Yes you are right here ;)
>>>>>
>>>>>> Do you possibly have two stereotypes that have the same name?
>>>>>>
>>>>> No, They are all different.
>>>>>> Would it be possible to post a small profile/model that demonstrates
>>>>>> the issue (or possibly JUnit test).
>>>>>>
>>>>> I need some time for this. I post it this evening. I have about 3 java
>>>>> classes around and this is a bit confidential stuff.
>>>>> Thanks again for the reply
>>>>>
>>>>> Günther
>
|
|
|
Re: [Stereotype] eRessource null and Nearest Package null [message #626490 is a reply to message #477326] |
Fri, 02 May 2008 15:29  |
Günther Falk Messages: 39 Registered: July 2009 |
Member |
|
|
Hi James,
Thanks for the Reply.
It didn't help.
It makes things worst.
Now It does not find the profile application node at all.
Has anyone ever tried to put something with uml2 outside of eclipse?
It can't be that worst, that you loose 2 days only because of something
easy like stereotype application.
Have a nice day
Günther
James Bruck schrieb:
> Hi Günther ,
>
> The problem is with the profile test.profile.uml.
> You have a nested profile under Test called Test2.
> 1. Move your stereotypes etc. up one level under the "Test" root level
> profile.
> 2. Delete the annotation with the ecore representation that exists
> currently.
> 3. Select the Test root.
> 4. Select UML Editor > Profile > Define.
>
> Reapply your profile to your class and retry.
>
> You should be good to go.
>
> - James.
>
>
> "Günther Falk" <guenther@onetreetechnologies.com> wrote in message
> news:fvf1tm$mah$1@build.eclipse.org...
>> Hi,
>>
>> I stepped into the code of uml2 and I found my problem. I don't know how
>> to interpret it, but I found it ;).
>>
>> My Stereotype has an attached Extension to a Metaclass.
>> The code of isStereotypeApplicable fails on loading the EClassifier of the
>> Stereotype. I looked in Details and the eRessource and the Nearest Package
>> if the corresponding Type is null.
>>
>> Anybody could help me please?
>>
>> Thx
>>
>> Günther
>>
>> Günther Falk schrieb:
>>> Hi,
>>>
>>> here is the promised example. The isAppliedFunction() works there.
>>> I still have no clou why it is not working on my other project.
>>> I've done a copy paste ;(
>>>
>>> On the other hand, the isApplicableStereotype returns always false. I
>>> don't know why.
>>>
>>> Have a nice day
>>>
>>> Günther
>>>
>>> Günther Falk schrieb:
>>>> Hi James,
>>>>
>>>> I followed this guide to generate a profile and to apply the profile to
>>>> a UML class diagram:
>>>> http://www.eclipse.org/gmt/oaw/doc/4.2/html/contents/uml2exa mple.html#uml2example_profiles
>>>>
>>>> We assume I have a stereotype named Test in a Profile named Test.
>>>> Therefore its qualified name is Test::Test.
>>>> In my class diagram I have a class House on which I apply the Stereotype
>>>> like it is explained in the "UML2 Example".
>>>>
>>>> This works fine but now:
>>>> I load the model in a java class, I pass the model to a transformation
>>>> which loads the profile with the Test Stereotype. Til now all is ok.
>>>>
>>>> I access the class and do a isStereoTypeApplicable() with the Test
>>>> Stereotype. This returns false.
>>>>
>>>> I'll append this example soon.
>>>>
>>>> Thanks for your help
>>>> Have a nice day
>>>>
>>>> Günther
>>>>
>>>>
>>>> James Bruck schrieb:
>>>>> Hi Günther,
>>>>>
>>>>> I'm not sure what you mean by " it seems like the stereotypes are not
>>>>> applicable to classes, but they are through definition."
>>>>> As long as you you are applying the stereotype from the same profile,
>>>>> the fact that you are applying the stereotype to different diagrams
>>>>> should not have any bearing.
>>>>>
>>>>> If your model is confidential perhaps you could trim out any
>>>>> information that is not germane to the problem and mangle the names
>>>>> etc. It is difficult to guess at why the function seems to be failing.
>>>>> If you are feeling adventurous you might download the source code and
>>>>> step into the function to see why it is failing.
>>>>>
>>>>> Cheers,
>>>>> - James.
>>>>>
>>>>>
>>>>> "Günther Falk" <guenther@onetreetechnologies.com> wrote in message
>>>>> news:fva5jd$hfm$1@build.eclipse.org...
>>>>>> Hi,
>>>>>>
>>>>>> it seems like the stereotypes are not applicable to classes,
>>>>>> but they are through definition.
>>>>>> class.isStereotypeApplicable(stereo) returns false.
>>>>>> In the editor I applicated the same stereotypes.
>>>>>>
>>>>>> Is it because I do not load it from the same diagram?
>>>>>> I load it from the original diagram/profile and apply them afterwards
>>>>>> to
>>>>>> another classdiagram within a model.
>>>>>>
>>>>>> I'm helpless.
>>>>>>
>>>>>> Günther
>>>>>>
>>>>>>
>>>>>> Günther Falk schrieb:
>>>>>>> Hi James,
>>>>>>>
>>>>>>> Thanks for your reply.
>>>>>>>
>>>>>>> James Bruck schrieb:
>>>>>>>> Hi Günther,
>>>>>>>>
>>>>>>>> Instead of "class.isAppliedStereotype" I think it is
>>>>>>>> "class.isStereotypeApplied()", regardless, the method should return
>>>>>>>> true as you would expect it to.
>>>>>>> Yes you are right here ;)
>>>>>>>
>>>>>>>> Do you possibly have two stereotypes that have the same name?
>>>>>>>>
>>>>>>> No, They are all different.
>>>>>>>> Would it be possible to post a small profile/model that demonstrates
>>>>>>>> the issue (or possibly JUnit test).
>>>>>>>>
>>>>>>> I need some time for this. I post it this evening. I have about 3
>>>>>>> java classes around and this is a bit confidential stuff.
>>>>>>> Thanks again for the reply
>>>>>>>
>>>>>>> Günther
>>>>>
>
>
|
|
| |
Re: [Stereotype] eRessource null and Nearest Package null [message #626492 is a reply to message #477330] |
Fri, 02 May 2008 15:48  |
Günther Falk Messages: 39 Registered: July 2009 |
Member |
|
|
Hi James,
> Did you reapply your profile and stereotype?
Yes I did. I tried that 2 times.
>
> What was the error in finding the profile application?
NullPointerException ;)
The Profile Application is null. In the model there is definitely a
Profile Application Node. But It does not find it.
Thanks
Günther
>
> - James.
>
> "Günther Falk" <guenther@onetreetechnologies.com> wrote in message
> news:fvfc1d$53b$1@build.eclipse.org...
>> Hi James,
>>
>> Thanks for the Reply.
>>
>> It didn't help.
>> It makes things worst.
>> Now It does not find the profile application node at all.
>>
>> Has anyone ever tried to put something with uml2 outside of eclipse?
>> It can't be that worst, that you loose 2 days only because of something
>> easy like stereotype application.
>>
>> Have a nice day
>>
>> Günther
>>
>> James Bruck schrieb:
>>> Hi Günther ,
>>>
>>> The problem is with the profile test.profile.uml.
>>> You have a nested profile under Test called Test2.
>>> 1. Move your stereotypes etc. up one level under the "Test" root level
>>> profile.
>>> 2. Delete the annotation with the ecore representation that exists
>>> currently.
>>> 3. Select the Test root.
>>> 4. Select UML Editor > Profile > Define.
>>>
>>> Reapply your profile to your class and retry.
>>>
>>> You should be good to go.
>>>
>>> - James.
>>>
>>>
>>> "Günther Falk" <guenther@onetreetechnologies.com> wrote in message
>>> news:fvf1tm$mah$1@build.eclipse.org...
>>>> Hi,
>>>>
>>>> I stepped into the code of uml2 and I found my problem. I don't know how
>>>> to interpret it, but I found it ;).
>>>>
>>>> My Stereotype has an attached Extension to a Metaclass.
>>>> The code of isStereotypeApplicable fails on loading the EClassifier of
>>>> the Stereotype. I looked in Details and the eRessource and the Nearest
>>>> Package if the corresponding Type is null.
>>>>
>>>> Anybody could help me please?
>>>>
>>>> Thx
>>>>
>>>> Günther
>>>>
>>>> Günther Falk schrieb:
>>>>> Hi,
>>>>>
>>>>> here is the promised example. The isAppliedFunction() works there.
>>>>> I still have no clou why it is not working on my other project.
>>>>> I've done a copy paste ;(
>>>>>
>>>>> On the other hand, the isApplicableStereotype returns always false. I
>>>>> don't know why.
>>>>>
>>>>> Have a nice day
>>>>>
>>>>> Günther
>>>>>
>>>>> Günther Falk schrieb:
>>>>>> Hi James,
>>>>>>
>>>>>> I followed this guide to generate a profile and to apply the profile
>>>>>> to a UML class diagram:
>>>>>> http://www.eclipse.org/gmt/oaw/doc/4.2/html/contents/uml2exa mple.html#uml2example_profiles
>>>>>>
>>>>>> We assume I have a stereotype named Test in a Profile named Test.
>>>>>> Therefore its qualified name is Test::Test.
>>>>>> In my class diagram I have a class House on which I apply the
>>>>>> Stereotype like it is explained in the "UML2 Example".
>>>>>>
>>>>>> This works fine but now:
>>>>>> I load the model in a java class, I pass the model to a transformation
>>>>>> which loads the profile with the Test Stereotype. Til now all is ok.
>>>>>>
>>>>>> I access the class and do a isStereoTypeApplicable() with the Test
>>>>>> Stereotype. This returns false.
>>>>>>
>>>>>> I'll append this example soon.
>>>>>>
>>>>>> Thanks for your help
>>>>>> Have a nice day
>>>>>>
>>>>>> Günther
>>>>>>
>>>>>>
>>>>>> James Bruck schrieb:
>>>>>>> Hi Günther,
>>>>>>>
>>>>>>> I'm not sure what you mean by " it seems like the stereotypes are not
>>>>>>> applicable to classes, but they are through definition."
>>>>>>> As long as you you are applying the stereotype from the same profile,
>>>>>>> the fact that you are applying the stereotype to different diagrams
>>>>>>> should not have any bearing.
>>>>>>>
>>>>>>> If your model is confidential perhaps you could trim out any
>>>>>>> information that is not germane to the problem and mangle the names
>>>>>>> etc. It is difficult to guess at why the function seems to be
>>>>>>> failing. If you are feeling adventurous you might download the source
>>>>>>> code and step into the function to see why it is failing.
>>>>>>>
>>>>>>> Cheers,
>>>>>>> - James.
>>>>>>>
>>>>>>>
>>>>>>> "Günther Falk" <guenther@onetreetechnologies.com> wrote in message
>>>>>>> news:fva5jd$hfm$1@build.eclipse.org...
>>>>>>>> Hi,
>>>>>>>>
>>>>>>>> it seems like the stereotypes are not applicable to classes,
>>>>>>>> but they are through definition.
>>>>>>>> class.isStereotypeApplicable(stereo) returns false.
>>>>>>>> In the editor I applicated the same stereotypes.
>>>>>>>>
>>>>>>>> Is it because I do not load it from the same diagram?
>>>>>>>> I load it from the original diagram/profile and apply them
>>>>>>>> afterwards to
>>>>>>>> another classdiagram within a model.
>>>>>>>>
>>>>>>>> I'm helpless.
>>>>>>>>
>>>>>>>> Günther
>>>>>>>>
>>>>>>>>
>>>>>>>> Günther Falk schrieb:
>>>>>>>>> Hi James,
>>>>>>>>>
>>>>>>>>> Thanks for your reply.
>>>>>>>>>
>>>>>>>>> James Bruck schrieb:
>>>>>>>>>> Hi Günther,
>>>>>>>>>>
>>>>>>>>>> Instead of "class.isAppliedStereotype" I think it is
>>>>>>>>>> "class.isStereotypeApplied()", regardless, the method should
>>>>>>>>>> return true as you would expect it to.
>>>>>>>>> Yes you are right here ;)
>>>>>>>>>
>>>>>>>>>> Do you possibly have two stereotypes that have the same name?
>>>>>>>>>>
>>>>>>>>> No, They are all different.
>>>>>>>>>> Would it be possible to post a small profile/model that
>>>>>>>>>> demonstrates the issue (or possibly JUnit test).
>>>>>>>>>>
>>>>>>>>> I need some time for this. I post it this evening. I have about 3
>>>>>>>>> java classes around and this is a bit confidential stuff.
>>>>>>>>> Thanks again for the reply
>>>>>>>>>
>>>>>>>>> Günther
>
|
|
| | |
Re: [Stereotype] Profile Application null [message #626523 is a reply to message #477334] |
Mon, 05 May 2008 07:45  |
Günther Falk Messages: 39 Registered: July 2009 |
Member |
|
|
Hi,
Nothing helps!
Either there is a big bug or some real example or howto is missing.
With these hints there is no standalone application possible with UML 2.1.1.
I neither get why the behaviour changes, when I access the File through
the classloader than directly through the file.
In the first he finds the profile application,
in the second he doesn't.
Thanks again for your help
Günther
PS: For the future it would be really nice to have a uml2 implementation
independent from eclipse! Or could be started outside eclipse!
Günther Falk schrieb:
> Hi James,
>
> A new Version of the small example.
> I try your suggestion with the migration guide tomorrow.
> Have a nice evening and thanks again
>
> Günther
>
> Günther Falk schrieb:
>> Hi James,
>>
>>> Did you reapply your profile and stereotype?
>> Yes I did. I tried that 2 times.
>>>
>>> What was the error in finding the profile application?
>> NullPointerException ;)
>> The Profile Application is null. In the model there is definitely a
>> Profile Application Node. But It does not find it.
>>
>> Thanks
>>
>> Günther
>>>
>>> - James.
>>>
>>> "Günther Falk" <guenther@onetreetechnologies.com> wrote in message
>>> news:fvfc1d$53b$1@build.eclipse.org...
>>>> Hi James,
>>>>
>>>> Thanks for the Reply.
>>>>
>>>> It didn't help.
>>>> It makes things worst.
>>>> Now It does not find the profile application node at all.
>>>>
>>>> Has anyone ever tried to put something with uml2 outside of eclipse?
>>>> It can't be that worst, that you loose 2 days only because of
>>>> something easy like stereotype application.
>>>>
>>>> Have a nice day
>>>>
>>>> Günther
>>>>
>>>> James Bruck schrieb:
>>>>> Hi Günther ,
>>>>>
>>>>> The problem is with the profile test.profile.uml.
>>>>> You have a nested profile under Test called Test2.
>>>>> 1. Move your stereotypes etc. up one level under the "Test" root
>>>>> level profile.
>>>>> 2. Delete the annotation with the ecore representation that exists
>>>>> currently.
>>>>> 3. Select the Test root.
>>>>> 4. Select UML Editor > Profile > Define.
>>>>>
>>>>> Reapply your profile to your class and retry.
>>>>>
>>>>> You should be good to go.
>>>>>
>>>>> - James.
>>>>>
>>>>>
>>>>> "Günther Falk" <guenther@onetreetechnologies.com> wrote in message
>>>>> news:fvf1tm$mah$1@build.eclipse.org...
>>>>>> Hi,
>>>>>>
>>>>>> I stepped into the code of uml2 and I found my problem. I don't
>>>>>> know how to interpret it, but I found it ;).
>>>>>>
>>>>>> My Stereotype has an attached Extension to a Metaclass.
>>>>>> The code of isStereotypeApplicable fails on loading the
>>>>>> EClassifier of the Stereotype. I looked in Details and the
>>>>>> eRessource and the Nearest Package if the corresponding Type is null.
>>>>>>
>>>>>> Anybody could help me please?
>>>>>>
>>>>>> Thx
>>>>>>
>>>>>> Günther
>>>>>>
>>>>>> Günther Falk schrieb:
>>>>>>> Hi,
>>>>>>>
>>>>>>> here is the promised example. The isAppliedFunction() works there.
>>>>>>> I still have no clou why it is not working on my other project.
>>>>>>> I've done a copy paste ;(
>>>>>>>
>>>>>>> On the other hand, the isApplicableStereotype returns always
>>>>>>> false. I don't know why.
>>>>>>>
>>>>>>> Have a nice day
>>>>>>>
>>>>>>> Günther
>>>>>>>
>>>>>>> Günther Falk schrieb:
>>>>>>>> Hi James,
>>>>>>>>
>>>>>>>> I followed this guide to generate a profile and to apply the
>>>>>>>> profile to a UML class diagram:
>>>>>>>> http://www.eclipse.org/gmt/oaw/doc/4.2/html/contents/uml2exa mple.html#uml2example_profiles
>>>>>>>>
>>>>>>>>
>>>>>>>> We assume I have a stereotype named Test in a Profile named
>>>>>>>> Test. Therefore its qualified name is Test::Test.
>>>>>>>> In my class diagram I have a class House on which I apply the
>>>>>>>> Stereotype like it is explained in the "UML2 Example".
>>>>>>>>
>>>>>>>> This works fine but now:
>>>>>>>> I load the model in a java class, I pass the model to a
>>>>>>>> transformation which loads the profile with the Test Stereotype.
>>>>>>>> Til now all is ok.
>>>>>>>>
>>>>>>>> I access the class and do a isStereoTypeApplicable() with the
>>>>>>>> Test Stereotype. This returns false.
>>>>>>>>
>>>>>>>> I'll append this example soon.
>>>>>>>>
>>>>>>>> Thanks for your help
>>>>>>>> Have a nice day
>>>>>>>>
>>>>>>>> Günther
>>>>>>>>
>>>>>>>>
>>>>>>>> James Bruck schrieb:
>>>>>>>>> Hi Günther,
>>>>>>>>>
>>>>>>>>> I'm not sure what you mean by " it seems like the stereotypes
>>>>>>>>> are not applicable to classes, but they are through definition."
>>>>>>>>> As long as you you are applying the stereotype from the same
>>>>>>>>> profile, the fact that you are applying the stereotype to
>>>>>>>>> different diagrams should not have any bearing.
>>>>>>>>>
>>>>>>>>> If your model is confidential perhaps you could trim out any
>>>>>>>>> information that is not germane to the problem and mangle the
>>>>>>>>> names etc. It is difficult to guess at why the function seems
>>>>>>>>> to be failing. If you are feeling adventurous you might
>>>>>>>>> download the source code and step into the function to see why
>>>>>>>>> it is failing.
>>>>>>>>>
>>>>>>>>> Cheers,
>>>>>>>>> - James.
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> "Günther Falk" <guenther@onetreetechnologies.com> wrote in
>>>>>>>>> message news:fva5jd$hfm$1@build.eclipse.org...
>>>>>>>>>> Hi,
>>>>>>>>>>
>>>>>>>>>> it seems like the stereotypes are not applicable to classes,
>>>>>>>>>> but they are through definition.
>>>>>>>>>> class.isStereotypeApplicable(stereo) returns false.
>>>>>>>>>> In the editor I applicated the same stereotypes.
>>>>>>>>>>
>>>>>>>>>> Is it because I do not load it from the same diagram?
>>>>>>>>>> I load it from the original diagram/profile and apply them
>>>>>>>>>> afterwards to
>>>>>>>>>> another classdiagram within a model.
>>>>>>>>>>
>>>>>>>>>> I'm helpless.
>>>>>>>>>>
>>>>>>>>>> Günther
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> Günther Falk schrieb:
>>>>>>>>>>> Hi James,
>>>>>>>>>>>
>>>>>>>>>>> Thanks for your reply.
>>>>>>>>>>>
>>>>>>>>>>> James Bruck schrieb:
>>>>>>>>>>>> Hi Günther,
>>>>>>>>>>>>
>>>>>>>>>>>> Instead of "class.isAppliedStereotype" I think it is
>>>>>>>>>>>> "class.isStereotypeApplied()", regardless, the method should
>>>>>>>>>>>> return true as you would expect it to.
>>>>>>>>>>> Yes you are right here ;)
>>>>>>>>>>>
>>>>>>>>>>>> Do you possibly have two stereotypes that have the same name?
>>>>>>>>>>>>
>>>>>>>>>>> No, They are all different.
>>>>>>>>>>>> Would it be possible to post a small profile/model that
>>>>>>>>>>>> demonstrates the issue (or possibly JUnit test).
>>>>>>>>>>>>
>>>>>>>>>>> I need some time for this. I post it this evening. I have
>>>>>>>>>>> about 3 java classes around and this is a bit confidential
>>>>>>>>>>> stuff.
>>>>>>>>>>> Thanks again for the reply
>>>>>>>>>>>
>>>>>>>>>>> Günther
>>>
>
|
|
| | | | |
Re: [Stereotype] Profile Application null [message #626539 is a reply to message #477355] |
Tue, 06 May 2008 08:38  |
Günther Falk Messages: 39 Registered: July 2009 |
Member |
|
|
Hi Kenn,
it is working now for the classpath related load of the model. Trailing
slashes where the solution. I trie to put this into the wiki as remark ;).
Thanks a lot.
Besides of that, when I'm using the file URI it does not find a profile
application. (The second way to load the model)
Why there are two profiles loaded? (Paths?)
The FileURI is in both cases the same. This last issue is the most
important one. I want to save the profile with the transformation
classes in a jar.
I think I should look with the paths to the profile in the model or?
(Relative vs. Absolute?)
Thanks again for the help.
Have a nice day
Günther
Kenn Hussey schrieb:
> Günther,
>
> OK, I have taken a close look at your model, profile, and sample code and
> was able to get things to work as expected.
>
> Firstly, using your original code, two copies of the profile were being
> loaded - one from the src folder and one from the build folder. I change the
> MODEL constant declaration so it looked like this (note the missing src/):
> private static final String MODEL = "test/example.uml";
>
> and I uncommented the first line of the try block (and commented out the
> second one):
> URI model_uri =
> URI.createURI(ClassLoader.getSystemResource(MODEL).toURI().t oString());
>
> //URI model_uri = URI.createFileURI(new File(MODEL).getAbsolutePath());
>
> Now that only one copy of the profile resource was being loaded, I got the
> expected results:
> Got model: org.eclipse.uml2.uml.internal.impl.ModelImpl@19c4091 (name:
> MyModel, visibility: <unset>) (viewpoint: <unset>)
>
> Got Stereotype: org.eclipse.uml2.uml.internal.impl.StereotypeImpl@93bca2
> (name: Test, visibility: <unset>) (isLeaf: false, isAbstract: false)
> (isActive: false)
>
> Got package: org.eclipse.uml2.uml.internal.impl.PackageImpl@1afd9cc
> (name: Env, visibility: <unset>)
>
> Got class: org.eclipse.uml2.uml.internal.impl.ClassImpl@dc3b82 (name:
> House, visibility: <unset>) (isLeaf: false, isAbstract: false) (isActive:
> false)
>
> Stereotype is applicable: true
>
> org.eclipse.uml2.uml.internal.impl.ProfileApplicationImpl@1a5e68a
> (isStrict: false)
>
> Stereotype is applied: true
>
> Applied Stereotype is:
> org.eclipse.uml2.uml.internal.impl.StereotypeImpl@93bca2 (name: Test,
> visibility: <unset>) (isLeaf: false, isAbstract: false) (isActive: false)
>
> I used these URIs for the pathmaps:
> public static final String LIBRARIES_PATHMAP =
> " C:/Workspaces/mdt_ganymede-workspace/org.eclipse.uml2.uml.re sources/libraries/ ";
>
> public static final String METAMODELS_PATHMAP =
> " C:/Workspaces/mdt_ganymede-workspace/org.eclipse.uml2.uml.re sources/metamodels/ ";
>
> public static final String PROFILES_PATHMAP =
> " C:/Workspaces/mdt_ganymede-workspace/org.eclipse.uml2.uml.re sources/profiles/ ";
>
> Note the trailing slash on these URIs - I think they were missing in your
> original source...
>
> Kenn
>
|
|
| |
Goto Forum:
Current Time: Sat Dec 02 06:56:21 GMT 2023
Powered by FUDForum. Page generated in 0.05086 seconds
|