|
Hi Kenn,
I changed the code as you said, but
I am still getting the same java.lang.IllegalArgumentException
Pls tell me if there is something
else I need to change.
Regards Praveen.
Praveen,
It doesn't look like your sample will work
because you aren't using the 'uri' variable when you populate the map.
That is, I'd have expected to see something like:
uriMap.put(URI.createURI(UML2Resource.LIBRARIES_PATHMAP),
uri.appendSegment("libraries").appendSegment(""));
Kenn
Hi Kenn,
I followed the instructions
given on the site, and have added the pathmap variables. But I am still
getting the same error.
The code looks like this
-
URI uri =
URI.createURI("jar:file:/D:/Apps/Installers/SoftWare/Java/IDE/ExtraPlugins/eclipse/plugins/org.eclipse.uml2.uml.resources_2.0.1.v200609210850.jar!/"); uriMap.put(URI.createURI(UML2Resource.LIBRARIES_PATHMAP),
URI.createFileURI("libraries").appendSegment("")); uriMap.put(URI.createURI(UML2Resource.METAMODELS_PATHMAP),
URI.createFileURI("metamodels").appendSegment("")); uriMap.put(URI.createURI(UML2Resource.PROFILES_PATHMAP),
URI.createFileURI("profiles").appendSegment(""));
Pls let me know how to fix this
and apply the stereotype on an element.
Thanks Praveen.
Praveen,
Kenn
Hi Kenn,
I am attaching my code to
apply the stereotype, profile and the model.
The 'B' stereotype that I
am trying to apply is a specialization of 'A' and A is applicable on
package.
Please let me know if you
find any problems.
Thanks
Praveen.
Praveen,
Something is definitely not right... Are
you sure you've "defined" the profile? Stereotypes from profiles that
have not been defined cannot be applied...
A key difference between the
getAppliedStereotypes() and isApplied(Stereotype) queries is that the
former filters the results based on the result of
getApplicableStereotypes(). One reason for the discrepancy here could
be that references from the profile to the UML metamodel can't be
resolved. If your application running as a stand-alone Java
application? Have you ensured that the pathmaps are registered (as
outlined in the FAQ)?
If you want to send us your model and
profile, we could try to take a closer look...
Kenn
Hi,
I have a UML2 model and
I am trying to apply a profile on one of the elements using the UML2
API element.apply(Stereotype). When I use the API I get an
IllegalArguementException.
I checked the
stereotype and it extends the applicable metaclass and is not
currently applied on the element. Has anybody faced this problem
before?
A different stereotype called feature is already applied on
the element. The API gives me the following values which is strange.
If the applicable stereotype count is zero, then how can a
stereotype be applied on the element?
modelPkg.getAppliedStereotypes().size() =
0 modelPkg.getApplicableStereotypes().size() =
0 modelPkg.isApplied(feature) = true
Thanks
Praveen.
|