|
Re: Problem applying stereotype [message #556541 is a reply to message #556478] |
Wed, 01 September 2010 16:34 |
|
Hi, 123star,
You are attempting to (repeatedly) create the RtFeature stereotype in
the HLAM profile. This has several problems:
- profiles are read-only from the perspective of the models that
apply them
- you wouldn't want to define the same stereotype multiple times,
anyways
- your new RtFeature stereotypes have no attributes and extend
no metaclasses, so you can't apply them to any elements
- you aren't creating a new Ecore definition of the profile that
would allow you to apply the newly-created RtFeature stereotypes
If the HLAM profile already has an RtFeature stereotype and it has an
Ecore definition, then you need only to accessing the existing
stereotype using the Profile::getOwnedStereotype(String) API instead of
createOwnedStereotype.
HTH,
Christian
On 01/09/10 10:03 AM, 123star wrote:
> Hi,
>
> I have a problem applying a stereotype to a Port, here's my code:
>
> // port is the original Port
> // portCopy is the copy of port
>
> Profile prof =
> port.getModel().getAppliedProfile("MARTE::MARTE_DesignModel::HLAM ");
>
> Stereotype stereo = prof.createOwnedStereotype("RtFeature", true);
>
> portCopy.applyStereotype(prof.createOwnedStereotype("RtFeature ", true));
>
> applyStereotype throws an IllegalArgument exception, what I'm doing wrong?
>
> Thanks in advance
|
|
|
Powered by
FUDForum. Page generated in 0.03704 seconds