Open eclipse-uml2-bot opened 1 week ago
By Kenn Hussey on May 21, 2015 09:56
(In reply to comment #0)
While trying to define a profile for OCL, and after failing to find any entries in Eclipse help, and confused by the triple *.uml files for the standard profile, I resorted to the EXSD documentation.
Triple *.uml files?
Bug 1: org.eclipse.uml2.uml.dynamic_package claims it has an Identifier: org.eclipse.uml2.uml.generated_package
and claims that
Examples: Following is an example of how a (dynamically defined) profile location can be registered:
org.eclipse.uml2.uml.generated_package also claims it has an Identifier: org.eclipse.uml2.uml.generated_package
and also claims that
Examples: Following is an example of how a (statically defined) profile location can be registered:
Yes, this was a typo; the identifier should be listed as org.eclipse.uml2.uml.dynamic_package. I will fix this.
Bug 2: The actual supplied API is:
<extension point="org.eclipse.uml2.uml.dynamic_package"> <profile uri="http://www.eclipse.org/uml2/schemas/Ecore/5" location="pathmap://UML_PROFILES/Ecore.profile.uml#_0"/>
but is not mentioned in the *.exsd.
This is the same as the first issue; once the identifier is corrected, it will be mentioned.\
Bug 3: There is no cross reference to the usage of uri_maps for pathmaps.
The pathmap URIs are just being used as example absolute URIs. The intent here isnt to recommend/require the use of pathmaps, but to show how the URI to the profile element (whether it be relative or absolute) can be registered.
Feel free to submit a separate enhancement requesting that the use of pathmaps be better documented.
Clear examples are needed demonstrating how to fully declare a static/dynamic profile and what the advantages/disadvatnges are of each approach.
There appears to be no documentation on static profiles and that on dynamic seems to omit extension points.
The best we have right now is the presentation at http://www.eclipse.org/modeling/mdt/uml2/docs/presentations/EclipseCon2008_LongTalk_NewFeaturesOfUML2.html. Feel free to submit a separate enhancement requesting that the two flavours of profile definitions be better documented.
The dynamic declarations did not work for me and confuse me. Surely contributions in a plugin are generated and so it is pretty pointless supporting non-generated content?
Uh, the dynamic registration is for profiles that don't have associated code (and thus the declaration can't be generated). An example of this is the Ecore profile in UML2.
Bug 4: http://www.eclipse.org/uml2/schemas/Ecore/X is a very unhelpful example given how special and overloaded "Ecore" is, particularly unhelpful in conjunction with errors.
The reason it was used as an example for the dynamic profile is that it exists in UML2. I agree that it isn't as appropriate as an example for the generated package extension point, so I will change that one to reference the Standard profile (now that it's statically defined).
I eventually discovered that all I needed was to define the profile, add:
(it would be nice if the UML2 genmodel managed this.)
Iff the profile is statically defined (i.e., code it generated for it), I could see the UML2 generator being extended to automatically generate an appropriate extension. Please submit an enhancement request for this. Of course, the generated extension wouldn't make use of pathmaps, because they are not required.
Bug 5: I found no clues on how the magic deterministic "_0" fragment should be maintained. And when I incorrectly bound it to the EPackage, the result was silent failures to apply the Stereotype and an error log full of "ClassCastException" entries without any additional detail.
As indicated in the documentation, location attribute should be a URI that references the Profile element, not its associated EPackage. The "_0" is just an XMI ID that's commonly assigned to the root UML element, by convention.
By Kenn Hussey on May 21, 2015 10:01
Changes to correct the documented extension point ID for dynamic profiles and change the example for static profiles have been committed/pushed to the 'master' branch in git and will be avaiable in the next build of UML2 5.1.0.
By Ed Willink on May 21, 2015 11:12
(In reply to Kenn Hussey from comment #1)
Triple *.uml files?
/org.eclipse.uml2.uml.resources/profiles/Standard.profile.uml\ /org.eclipse.uml2.uml.profile.standard/model/Standard.uml\ /org.eclipse.uml2.uml.profile.standard/model/Standard.merged.uml
The best we have right now is the presentation at http://www.eclipse.org/modeling/mdt/uml2/docs/presentations/ EclipseCon2008_LongTalk_NewFeaturesOfUML2.html. Feel free to submit a separate enhancement requesting that the two flavours of profile definitions be better documented.
I already did. It is this one. Reopening.
Bug 4: http://www.eclipse.org/uml2/schemas/Ecore/X is a very unhelpful example given how special and overloaded "Ecore" is, particularly unhelpful in conjunction with errors.
so I will change that one to reference the Standard profile (now that it's statically defined).
Only slightly better becuase the Stnadard profile suffers from a triple UML confusion.\
I eventually discovered that all I needed was to define the profile, add:
(it would be nice if the UML2 genmodel managed this.)
Also critical to have different stable Ecore/UML URIs. e.g. xxx for UML, xxx/N for Ecore and to set a blank genmodel PluginKey to avoid UML extension points being trashed.\
Iff the profile is statically defined (i.e., code it generated for it), I could see the UML2 generator being extended to automatically generate an appropriate extension. Please submit an enhancement request for this. Of course, the generated extension wouldn't make use of pathmaps, because they are not required.
I found the pathmap: invaluable for standalone testing for which it is very difficult to get the relative ../.. paths to line up between a file:/.../tests/.../bin/... test folder and a plugins/.../model profile folder.
By Kenn Hussey on May 21, 2015 12:29
(In reply to comment #3)
(In reply to Kenn Hussey from comment #1)
Triple *.uml files?
/org.eclipse.uml2.uml.resources/profiles/Standard.profile.uml /org.eclipse.uml2.uml.profile.standard/model/Standard.uml /org.eclipse.uml2.uml.profile.standard/model/Standard.merged.uml
So, the first one is the only one users/consumers need to care about; the second two are development-only artifacts used in producing the generated implementation. This is no different from the triad of models that exist for the UML metamodel itself.
The best we have right now is the presentation at http://www.eclipse.org/modeling/mdt/uml2/docs/presentations/ EclipseCon2008_LongTalk_NewFeaturesOfUML2.html. Feel free to submit a separate enhancement requesting that the two flavours of profile definitions be better documented.
I already did. It is this one. Reopening.
Perfect. Made this an enhancement for future consideration.
By Ed Willink on May 21, 2015 14:01
(In reply to Kenn Hussey from comment #4)
(In reply to comment #3)
(In reply to Kenn Hussey from comment #1)
Triple *.uml files?
/org.eclipse.uml2.uml.resources/profiles/Standard.profile.uml /org.eclipse.uml2.uml.profile.standard/model/Standard.uml /org.eclipse.uml2.uml.profile.standard/model/Standard.merged.uml
So, the first one is the only one users/consumers need to care about; the second two are development-only artifacts used in producing the generated implementation. This is no different from the triad of models that exist for the UML metamodel itself.
Cleaer to you, opaque to me.
For my OCLforUML profile, I used a .profile.uml, defined it and generated code from it, so I think I am doing a hyrid of .profile.uml and *.merged.uml. Seems to work. No idea if it's 'right'. Simple user-focussed examples needed rather than a lazy attempt to re-use special UML models as simple.
By Kenn Hussey on May 26, 2015 20:41
The changes mentioned in comment #2 are available in UML2 5.1.0 RC2.
| --- | --- | | Bugzilla Link | 467639 | | Status | REOPENED | | Importance | P3 enhancement | | Reported | May 20, 2015 02:19 EDT | | Modified | May 26, 2015 20:41 EDT | | Blocks | 204201 | | Reporter | Ed Willink |
Description
While trying to define a profile for OCL, and after failing to find any entries in Eclipse help, and confused by the triple *.uml files for the standard profile, I resorted to the EXSD documentation.
Bug 1: org.eclipse.uml2.uml.dynamic_package claims it has an Identifier: org.eclipse.uml2.uml.generated_package
and claims that
Examples: Following is an example of how a (dynamically defined) profile location can be registered: \
org.eclipse.uml2.uml.generated_package also claims it has an Identifier: org.eclipse.uml2.uml.generated_package
and also claims that
Examples: Following is an example of how a (statically defined) profile location can be registered: \
Bug 2: The actual supplied API is:
<extension\ point="org.eclipse.uml2.uml.dynamic_package">\ \
but is not mentioned in the *.exsd.
Bug 3: There is no cross reference to the usage of uri_maps for pathmaps. Clear examples are needed demonstrating how to fully declare\ a static/dynamic profile and what the advantages/disadvatnges are of each approach.
There appears to be no documentation on static profiles and that on dynamic seems to omit extension points.
The dynamic declarations did not work for me and confuse me. Surely contributions in a plugin are generated and so it is pretty pointless supporting non-generated content?
Bug 4: http://www.eclipse.org/uml2/schemas/Ecore/X is a very unhelpful example given how special and overloaded "Ecore" is,\ particularly unhelpful in conjunction with errors.
I eventually discovered that all I needed was to define the profile, add: