Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » UML2 » strange behavior when defining a profile
strange behavior when defining a profile [message #469706] Mon, 29 January 2007 07:21 Go to next message
Rafael Chaves is currently offline Rafael ChavesFriend
Messages: 362
Registered: July 2009
Senior Member
When I define the following profile named 'sample_profile':

<?xml version="1.0" encoding="UTF-8"?>
<uml:Profile xmi:version="2.1"
xmlns:xmi="http://schema.omg.org/spec/XMI/2.1"
xmlns:uml="http://www.eclipse.org/uml2/2.0.0/UML"
xmi:id="_O3cisK9mEduaoJ8VsHbaPQ" name="sample_profile">
<packagedElement xmi:type="uml:Stereotype"
xmi:id="_P7ic8K9mEduaoJ8VsHbaPQ" name="sample_stereotype">
<ownedAttribute xmi:id="_Xjqr8K9mEduaoJ8VsHbaPQ" name="myProperty">
<type xmi:type="uml:PrimitiveType"
href="pathmap://UML_METAMODELS/UML.metamodel.uml#Integer"/>
</ownedAttribute>
</packagedElement>
</uml:Profile>

It results in a EPackage instance that describes the UML metamodel.
Also, if I try to apply this profile to any models I build, the model is
persisted in a way that stereotype applications are lost. The reason
seems to be that the XMI for such a model refers to stereotypes coming
from 'sample_profile' as if they were coming from 'uml':

<xmi:XMI xmi:version="2.1" (...)>
<uml:Model xmi:id="_2YHtEK9lEdu8D5FNufO7zw" name="sample_model">
(...)
</uml:Model>
<uml:sample_stereotype (...) />
</xmi:XMI>

Instead, I would expect the stereotype applications to appear as:

<sample_profile:sample_stereotype (...) />

The trigger to this problem seems to be that I am referring to a type
from the uml package (integer). If I remove the reference, the problem
goes away.

Am I doing anything wrong to cause this, or is this a bug?

Thanks,

Rafael
Re: strange behavior when defining a profile [message #469712 is a reply to message #469706] Mon, 29 January 2007 16:46 Go to previous messageGo to next message
Kenn Hussey is currently offline Kenn HusseyFriend
Messages: 1620
Registered: July 2009
Senior Member
Rafael,

The reason for this behavior is that you have directly referenced a
primitive type (Integer) from the metamodel instead of from the primitive
types library (only metaclasses from the metamodel should be directly
referenced). With the current profile definition algorithm, metadata from
packages other than the profile being defined are copied into the definition
of the profile. This won't necessarily be the case once we fix
https://bugs.eclipse.org/bugs/show_bug.cgi?id=163556. Please update that bug
or open a new one so that we'll remember to cover your use case. Thanks!

Kenn

"Rafael Chaves" <chaves@inf.ufsc.nospam.br> wrote in message
news:epk79s$ith$1@utils.eclipse.org...
> When I define the following profile named 'sample_profile':
>
> <?xml version="1.0" encoding="UTF-8"?>
> <uml:Profile xmi:version="2.1"
> xmlns:xmi="http://schema.omg.org/spec/XMI/2.1"
> xmlns:uml="http://www.eclipse.org/uml2/2.0.0/UML"
> xmi:id="_O3cisK9mEduaoJ8VsHbaPQ" name="sample_profile">
> <packagedElement xmi:type="uml:Stereotype"
> xmi:id="_P7ic8K9mEduaoJ8VsHbaPQ" name="sample_stereotype">
> <ownedAttribute xmi:id="_Xjqr8K9mEduaoJ8VsHbaPQ" name="myProperty">
> <type xmi:type="uml:PrimitiveType"
> href="pathmap://UML_METAMODELS/UML.metamodel.uml#Integer"/>
> </ownedAttribute>
> </packagedElement>
> </uml:Profile>
>
> It results in a EPackage instance that describes the UML metamodel. Also,
> if I try to apply this profile to any models I build, the model is
> persisted in a way that stereotype applications are lost. The reason seems
> to be that the XMI for such a model refers to stereotypes coming from
> 'sample_profile' as if they were coming from 'uml':
>
> <xmi:XMI xmi:version="2.1" (...)>
> <uml:Model xmi:id="_2YHtEK9lEdu8D5FNufO7zw" name="sample_model">
> (...)
> </uml:Model>
> <uml:sample_stereotype (...) />
> </xmi:XMI>
>
> Instead, I would expect the stereotype applications to appear as:
>
> <sample_profile:sample_stereotype (...) />
>
> The trigger to this problem seems to be that I am referring to a type from
> the uml package (integer). If I remove the reference, the problem goes
> away.
>
> Am I doing anything wrong to cause this, or is this a bug?
>
> Thanks,
>
> Rafael
Re: strange behavior when defining a profile [message #469714 is a reply to message #469712] Mon, 29 January 2007 18:44 Go to previous messageGo to next message
Rafael Chaves is currently offline Rafael ChavesFriend
Messages: 362
Registered: July 2009
Senior Member
Thanks, Kenn, I opened bug 172030:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=172030

> The reason for this behavior is that you have directly referenced a
> primitive type (Integer) from the metamodel instead of from the
> primitive types library (only metaclasses from the metamodel
> should be directly referenced)

Is there a place where one can learn about rules like that?

In the specific case, should my profile be importing UMLPrimitiveTypes
instead (and references to uml::Integer be changed to
UMLPrimitiveTypes::Integer)?

Thanks,

Rafael

Kenn Hussey wrote:
> Rafael,
>
> The reason for this behavior is that you have directly referenced a
> primitive type (Integer) from the metamodel instead of from the primitive
> types library (only metaclasses from the metamodel should be directly
> referenced). With the current profile definition algorithm, metadata from
> packages other than the profile being defined are copied into the definition
> of the profile. This won't necessarily be the case once we fix
> https://bugs.eclipse.org/bugs/show_bug.cgi?id=163556. Please update that bug
> or open a new one so that we'll remember to cover your use case. Thanks!
>
> Kenn
>
> "Rafael Chaves" <chaves@inf.ufsc.nospam.br> wrote in message
> news:epk79s$ith$1@utils.eclipse.org...
>> When I define the following profile named 'sample_profile':
>>
>> <?xml version="1.0" encoding="UTF-8"?>
>> <uml:Profile xmi:version="2.1"
>> xmlns:xmi="http://schema.omg.org/spec/XMI/2.1"
>> xmlns:uml="http://www.eclipse.org/uml2/2.0.0/UML"
>> xmi:id="_O3cisK9mEduaoJ8VsHbaPQ" name="sample_profile">
>> <packagedElement xmi:type="uml:Stereotype"
>> xmi:id="_P7ic8K9mEduaoJ8VsHbaPQ" name="sample_stereotype">
>> <ownedAttribute xmi:id="_Xjqr8K9mEduaoJ8VsHbaPQ" name="myProperty">
>> <type xmi:type="uml:PrimitiveType"
>> href="pathmap://UML_METAMODELS/UML.metamodel.uml#Integer"/>
>> </ownedAttribute>
>> </packagedElement>
>> </uml:Profile>
>>
>> It results in a EPackage instance that describes the UML metamodel. Also,
>> if I try to apply this profile to any models I build, the model is
>> persisted in a way that stereotype applications are lost. The reason seems
>> to be that the XMI for such a model refers to stereotypes coming from
>> 'sample_profile' as if they were coming from 'uml':
>>
>> <xmi:XMI xmi:version="2.1" (...)>
>> <uml:Model xmi:id="_2YHtEK9lEdu8D5FNufO7zw" name="sample_model">
>> (...)
>> </uml:Model>
>> <uml:sample_stereotype (...) />
>> </xmi:XMI>
>>
>> Instead, I would expect the stereotype applications to appear as:
>>
>> <sample_profile:sample_stereotype (...) />
>>
>> The trigger to this problem seems to be that I am referring to a type from
>> the uml package (integer). If I remove the reference, the problem goes
>> away.
>>
>> Am I doing anything wrong to cause this, or is this a bug?
>>
>> Thanks,
>>
>> Rafael
>
>
Re: strange behavior when defining a profile [message #470059 is a reply to message #469714] Mon, 05 February 2007 19:54 Go to previous messageGo to next message
Kenn Hussey is currently offline Kenn HusseyFriend
Messages: 1620
Registered: July 2009
Senior Member
Rafael,

The "expected" way to use primitive types is described in the articles
available at http://wiki.eclipse.org/index.php/MDT-UML2#Articles. Strictly
speaking, there's nothing wrong with a profile referencing a primitive type
defined in another model or profile...

Kenn

"Rafael Chaves" <chaves@inf.ufsc.nospam.br> wrote in message
news:eplf98$bv0$1@utils.eclipse.org...
> Thanks, Kenn, I opened bug 172030:
> https://bugs.eclipse.org/bugs/show_bug.cgi?id=172030
>
> > The reason for this behavior is that you have directly referenced a
> > primitive type (Integer) from the metamodel instead of from the
> > primitive types library (only metaclasses from the metamodel
> > should be directly referenced)
>
> Is there a place where one can learn about rules like that?
>
> In the specific case, should my profile be importing UMLPrimitiveTypes
> instead (and references to uml::Integer be changed to
> UMLPrimitiveTypes::Integer)?
>
> Thanks,
>
> Rafael
>
> Kenn Hussey wrote:
>> Rafael,
>>
>> The reason for this behavior is that you have directly referenced a
>> primitive type (Integer) from the metamodel instead of from the primitive
>> types library (only metaclasses from the metamodel should be directly
>> referenced). With the current profile definition algorithm, metadata from
>> packages other than the profile being defined are copied into the
>> definition of the profile. This won't necessarily be the case once we fix
>> https://bugs.eclipse.org/bugs/show_bug.cgi?id=163556. Please update that
>> bug or open a new one so that we'll remember to cover your use case.
>> Thanks!
>>
>> Kenn
>>
>> "Rafael Chaves" <chaves@inf.ufsc.nospam.br> wrote in message
>> news:epk79s$ith$1@utils.eclipse.org...
>>> When I define the following profile named 'sample_profile':
>>>
>>> <?xml version="1.0" encoding="UTF-8"?>
>>> <uml:Profile xmi:version="2.1"
>>> xmlns:xmi="http://schema.omg.org/spec/XMI/2.1"
>>> xmlns:uml="http://www.eclipse.org/uml2/2.0.0/UML"
>>> xmi:id="_O3cisK9mEduaoJ8VsHbaPQ" name="sample_profile">
>>> <packagedElement xmi:type="uml:Stereotype"
>>> xmi:id="_P7ic8K9mEduaoJ8VsHbaPQ" name="sample_stereotype">
>>> <ownedAttribute xmi:id="_Xjqr8K9mEduaoJ8VsHbaPQ" name="myProperty">
>>> <type xmi:type="uml:PrimitiveType"
>>> href="pathmap://UML_METAMODELS/UML.metamodel.uml#Integer"/>
>>> </ownedAttribute>
>>> </packagedElement>
>>> </uml:Profile>
>>>
>>> It results in a EPackage instance that describes the UML metamodel.
>>> Also, if I try to apply this profile to any models I build, the model is
>>> persisted in a way that stereotype applications are lost. The reason
>>> seems to be that the XMI for such a model refers to stereotypes coming
>>> from 'sample_profile' as if they were coming from 'uml':
>>>
>>> <xmi:XMI xmi:version="2.1" (...)>
>>> <uml:Model xmi:id="_2YHtEK9lEdu8D5FNufO7zw" name="sample_model">
>>> (...)
>>> </uml:Model>
>>> <uml:sample_stereotype (...) />
>>> </xmi:XMI>
>>>
>>> Instead, I would expect the stereotype applications to appear as:
>>>
>>> <sample_profile:sample_stereotype (...) />
>>>
>>> The trigger to this problem seems to be that I am referring to a type
>>> from the uml package (integer). If I remove the reference, the problem
>>> goes away.
>>>
>>> Am I doing anything wrong to cause this, or is this a bug?
>>>
>>> Thanks,
>>>
>>> Rafael
>>
Re: strange behavior when defining a profile [message #470088 is a reply to message #470059] Mon, 05 February 2007 23:36 Go to previous message
Rafael Chaves is currently offline Rafael ChavesFriend
Messages: 362
Registered: July 2009
Senior Member
> The "expected" way to use primitive types is described in the articles
> available at http://wiki.eclipse.org/index.php/MDT-UML2#Articles.

It seems I am doing it properly now.

> Strictly
> speaking, there's nothing wrong with a profile referencing a primitive
> type defined in another model or profile...

Yes, I understand that. The problem in this specific case was that the
primitive types in "uml" were private and I hadn't noticed it.

Thanks!

Rafael

Kenn Hussey wrote:
> Rafael,
>
> The "expected" way to use primitive types is described in the articles
> available at http://wiki.eclipse.org/index.php/MDT-UML2#Articles. Strictly
> speaking, there's nothing wrong with a profile referencing a primitive type
> defined in another model or profile...
>
> Kenn
>
> "Rafael Chaves" <chaves@inf.ufsc.nospam.br> wrote in message
> news:eplf98$bv0$1@utils.eclipse.org...
>> Thanks, Kenn, I opened bug 172030:
>> https://bugs.eclipse.org/bugs/show_bug.cgi?id=172030
>>
>>> The reason for this behavior is that you have directly referenced a
>>> primitive type (Integer) from the metamodel instead of from the
>>> primitive types library (only metaclasses from the metamodel
>>> should be directly referenced)
>> Is there a place where one can learn about rules like that?
>>
>> In the specific case, should my profile be importing UMLPrimitiveTypes
>> instead (and references to uml::Integer be changed to
>> UMLPrimitiveTypes::Integer)?
>>
>> Thanks,
>>
>> Rafael
>>
>> Kenn Hussey wrote:
>>> Rafael,
>>>
>>> The reason for this behavior is that you have directly referenced a
>>> primitive type (Integer) from the metamodel instead of from the primitive
>>> types library (only metaclasses from the metamodel should be directly
>>> referenced). With the current profile definition algorithm, metadata from
>>> packages other than the profile being defined are copied into the
>>> definition of the profile. This won't necessarily be the case once we fix
>>> https://bugs.eclipse.org/bugs/show_bug.cgi?id=163556. Please update that
>>> bug or open a new one so that we'll remember to cover your use case.
>>> Thanks!
>>>
>>> Kenn
>>>
>>> "Rafael Chaves" <chaves@inf.ufsc.nospam.br> wrote in message
>>> news:epk79s$ith$1@utils.eclipse.org...
>>>> When I define the following profile named 'sample_profile':
>>>>
>>>> <?xml version="1.0" encoding="UTF-8"?>
>>>> <uml:Profile xmi:version="2.1"
>>>> xmlns:xmi="http://schema.omg.org/spec/XMI/2.1"
>>>> xmlns:uml="http://www.eclipse.org/uml2/2.0.0/UML"
>>>> xmi:id="_O3cisK9mEduaoJ8VsHbaPQ" name="sample_profile">
>>>> <packagedElement xmi:type="uml:Stereotype"
>>>> xmi:id="_P7ic8K9mEduaoJ8VsHbaPQ" name="sample_stereotype">
>>>> <ownedAttribute xmi:id="_Xjqr8K9mEduaoJ8VsHbaPQ" name="myProperty">
>>>> <type xmi:type="uml:PrimitiveType"
>>>> href="pathmap://UML_METAMODELS/UML.metamodel.uml#Integer"/>
>>>> </ownedAttribute>
>>>> </packagedElement>
>>>> </uml:Profile>
>>>>
>>>> It results in a EPackage instance that describes the UML metamodel.
>>>> Also, if I try to apply this profile to any models I build, the model is
>>>> persisted in a way that stereotype applications are lost. The reason
>>>> seems to be that the XMI for such a model refers to stereotypes coming
>>>> from 'sample_profile' as if they were coming from 'uml':
>>>>
>>>> <xmi:XMI xmi:version="2.1" (...)>
>>>> <uml:Model xmi:id="_2YHtEK9lEdu8D5FNufO7zw" name="sample_model">
>>>> (...)
>>>> </uml:Model>
>>>> <uml:sample_stereotype (...) />
>>>> </xmi:XMI>
>>>>
>>>> Instead, I would expect the stereotype applications to appear as:
>>>>
>>>> <sample_profile:sample_stereotype (...) />
>>>>
>>>> The trigger to this problem seems to be that I am referring to a type
>>>> from the uml package (integer). If I remove the reference, the problem
>>>> goes away.
>>>>
>>>> Am I doing anything wrong to cause this, or is this a bug?
>>>>
>>>> Thanks,
>>>>
>>>> Rafael
>
Re: strange behavior when defining a profile [message #576673 is a reply to message #469706] Mon, 29 January 2007 16:46 Go to previous message
Kenn Hussey is currently offline Kenn HusseyFriend
Messages: 1620
Registered: July 2009
Senior Member
Rafael,

The reason for this behavior is that you have directly referenced a
primitive type (Integer) from the metamodel instead of from the primitive
types library (only metaclasses from the metamodel should be directly
referenced). With the current profile definition algorithm, metadata from
packages other than the profile being defined are copied into the definition
of the profile. This won't necessarily be the case once we fix
https://bugs.eclipse.org/bugs/show_bug.cgi?id=163556 Please update that bug
or open a new one so that we'll remember to cover your use case. Thanks!

Kenn

"Rafael Chaves" <chaves@inf.ufsc.nospam.br> wrote in message
news:epk79s$ith$1@utils.eclipse.org...
> When I define the following profile named 'sample_profile':
>
> <?xml version="1.0" encoding="UTF-8"?>
> <uml:Profile xmi:version="2.1"
> xmlns:xmi="http://schema.omg.org/spec/XMI/2.1"
> xmlns:uml="http://www.eclipse.org/uml2/2.0.0/UML"
> xmi:id="_O3cisK9mEduaoJ8VsHbaPQ" name="sample_profile">
> <packagedElement xmi:type="uml:Stereotype"
> xmi:id="_P7ic8K9mEduaoJ8VsHbaPQ" name="sample_stereotype">
> <ownedAttribute xmi:id="_Xjqr8K9mEduaoJ8VsHbaPQ" name="myProperty">
> <type xmi:type="uml:PrimitiveType"
> href="pathmap://UML_METAMODELS/UML.metamodel.uml#Integer"/>
> </ownedAttribute>
> </packagedElement>
> </uml:Profile>
>
> It results in a EPackage instance that describes the UML metamodel. Also,
> if I try to apply this profile to any models I build, the model is
> persisted in a way that stereotype applications are lost. The reason seems
> to be that the XMI for such a model refers to stereotypes coming from
> 'sample_profile' as if they were coming from 'uml':
>
> <xmi:XMI xmi:version="2.1" (...)>
> <uml:Model xmi:id="_2YHtEK9lEdu8D5FNufO7zw" name="sample_model">
> (...)
> </uml:Model>
> <uml:sample_stereotype (...) />
> </xmi:XMI>
>
> Instead, I would expect the stereotype applications to appear as:
>
> <sample_profile:sample_stereotype (...) />
>
> The trigger to this problem seems to be that I am referring to a type from
> the uml package (integer). If I remove the reference, the problem goes
> away.
>
> Am I doing anything wrong to cause this, or is this a bug?
>
> Thanks,
>
> Rafael
Re: strange behavior when defining a profile [message #576764 is a reply to message #469712] Mon, 29 January 2007 18:44 Go to previous message
Rafael Chaves is currently offline Rafael ChavesFriend
Messages: 362
Registered: July 2009
Senior Member
Thanks, Kenn, I opened bug 172030:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=172030

> The reason for this behavior is that you have directly referenced a
> primitive type (Integer) from the metamodel instead of from the
> primitive types library (only metaclasses from the metamodel
> should be directly referenced)

Is there a place where one can learn about rules like that?

In the specific case, should my profile be importing UMLPrimitiveTypes
instead (and references to uml::Integer be changed to
UMLPrimitiveTypes::Integer)?

Thanks,

Rafael

Kenn Hussey wrote:
> Rafael,
>
> The reason for this behavior is that you have directly referenced a
> primitive type (Integer) from the metamodel instead of from the primitive
> types library (only metaclasses from the metamodel should be directly
> referenced). With the current profile definition algorithm, metadata from
> packages other than the profile being defined are copied into the definition
> of the profile. This won't necessarily be the case once we fix
> https://bugs.eclipse.org/bugs/show_bug.cgi?id=163556 Please update that bug
> or open a new one so that we'll remember to cover your use case. Thanks!
>
> Kenn
>
> "Rafael Chaves" <chaves@inf.ufsc.nospam.br> wrote in message
> news:epk79s$ith$1@utils.eclipse.org...
>> When I define the following profile named 'sample_profile':
>>
>> <?xml version="1.0" encoding="UTF-8"?>
>> <uml:Profile xmi:version="2.1"
>> xmlns:xmi="http://schema.omg.org/spec/XMI/2.1"
>> xmlns:uml="http://www.eclipse.org/uml2/2.0.0/UML"
>> xmi:id="_O3cisK9mEduaoJ8VsHbaPQ" name="sample_profile">
>> <packagedElement xmi:type="uml:Stereotype"
>> xmi:id="_P7ic8K9mEduaoJ8VsHbaPQ" name="sample_stereotype">
>> <ownedAttribute xmi:id="_Xjqr8K9mEduaoJ8VsHbaPQ" name="myProperty">
>> <type xmi:type="uml:PrimitiveType"
>> href="pathmap://UML_METAMODELS/UML.metamodel.uml#Integer"/>
>> </ownedAttribute>
>> </packagedElement>
>> </uml:Profile>
>>
>> It results in a EPackage instance that describes the UML metamodel. Also,
>> if I try to apply this profile to any models I build, the model is
>> persisted in a way that stereotype applications are lost. The reason seems
>> to be that the XMI for such a model refers to stereotypes coming from
>> 'sample_profile' as if they were coming from 'uml':
>>
>> <xmi:XMI xmi:version="2.1" (...)>
>> <uml:Model xmi:id="_2YHtEK9lEdu8D5FNufO7zw" name="sample_model">
>> (...)
>> </uml:Model>
>> <uml:sample_stereotype (...) />
>> </xmi:XMI>
>>
>> Instead, I would expect the stereotype applications to appear as:
>>
>> <sample_profile:sample_stereotype (...) />
>>
>> The trigger to this problem seems to be that I am referring to a type from
>> the uml package (integer). If I remove the reference, the problem goes
>> away.
>>
>> Am I doing anything wrong to cause this, or is this a bug?
>>
>> Thanks,
>>
>> Rafael
>
>
Re: strange behavior when defining a profile [message #582027 is a reply to message #469714] Mon, 05 February 2007 19:54 Go to previous message
Kenn Hussey is currently offline Kenn HusseyFriend
Messages: 1620
Registered: July 2009
Senior Member
Rafael,

The "expected" way to use primitive types is described in the articles
available at http://wiki.eclipse.org/index.php/MDT-UML2#Articles Strictly
speaking, there's nothing wrong with a profile referencing a primitive type
defined in another model or profile...

Kenn

"Rafael Chaves" <chaves@inf.ufsc.nospam.br> wrote in message
news:eplf98$bv0$1@utils.eclipse.org...
> Thanks, Kenn, I opened bug 172030:
> https://bugs.eclipse.org/bugs/show_bug.cgi?id=172030
>
> > The reason for this behavior is that you have directly referenced a
> > primitive type (Integer) from the metamodel instead of from the
> > primitive types library (only metaclasses from the metamodel
> > should be directly referenced)
>
> Is there a place where one can learn about rules like that?
>
> In the specific case, should my profile be importing UMLPrimitiveTypes
> instead (and references to uml::Integer be changed to
> UMLPrimitiveTypes::Integer)?
>
> Thanks,
>
> Rafael
>
> Kenn Hussey wrote:
>> Rafael,
>>
>> The reason for this behavior is that you have directly referenced a
>> primitive type (Integer) from the metamodel instead of from the primitive
>> types library (only metaclasses from the metamodel should be directly
>> referenced). With the current profile definition algorithm, metadata from
>> packages other than the profile being defined are copied into the
>> definition of the profile. This won't necessarily be the case once we fix
>> https://bugs.eclipse.org/bugs/show_bug.cgi?id=163556 Please update that
>> bug or open a new one so that we'll remember to cover your use case.
>> Thanks!
>>
>> Kenn
>>
>> "Rafael Chaves" <chaves@inf.ufsc.nospam.br> wrote in message
>> news:epk79s$ith$1@utils.eclipse.org...
>>> When I define the following profile named 'sample_profile':
>>>
>>> <?xml version="1.0" encoding="UTF-8"?>
>>> <uml:Profile xmi:version="2.1"
>>> xmlns:xmi="http://schema.omg.org/spec/XMI/2.1"
>>> xmlns:uml="http://www.eclipse.org/uml2/2.0.0/UML"
>>> xmi:id="_O3cisK9mEduaoJ8VsHbaPQ" name="sample_profile">
>>> <packagedElement xmi:type="uml:Stereotype"
>>> xmi:id="_P7ic8K9mEduaoJ8VsHbaPQ" name="sample_stereotype">
>>> <ownedAttribute xmi:id="_Xjqr8K9mEduaoJ8VsHbaPQ" name="myProperty">
>>> <type xmi:type="uml:PrimitiveType"
>>> href="pathmap://UML_METAMODELS/UML.metamodel.uml#Integer"/>
>>> </ownedAttribute>
>>> </packagedElement>
>>> </uml:Profile>
>>>
>>> It results in a EPackage instance that describes the UML metamodel.
>>> Also, if I try to apply this profile to any models I build, the model is
>>> persisted in a way that stereotype applications are lost. The reason
>>> seems to be that the XMI for such a model refers to stereotypes coming
>>> from 'sample_profile' as if they were coming from 'uml':
>>>
>>> <xmi:XMI xmi:version="2.1" (...)>
>>> <uml:Model xmi:id="_2YHtEK9lEdu8D5FNufO7zw" name="sample_model">
>>> (...)
>>> </uml:Model>
>>> <uml:sample_stereotype (...) />
>>> </xmi:XMI>
>>>
>>> Instead, I would expect the stereotype applications to appear as:
>>>
>>> <sample_profile:sample_stereotype (...) />
>>>
>>> The trigger to this problem seems to be that I am referring to a type
>>> from the uml package (integer). If I remove the reference, the problem
>>> goes away.
>>>
>>> Am I doing anything wrong to cause this, or is this a bug?
>>>
>>> Thanks,
>>>
>>> Rafael
>>
Re: strange behavior when defining a profile [message #582231 is a reply to message #470059] Mon, 05 February 2007 23:36 Go to previous message
Rafael Chaves is currently offline Rafael ChavesFriend
Messages: 362
Registered: July 2009
Senior Member
> The "expected" way to use primitive types is described in the articles
> available at http://wiki.eclipse.org/index.php/MDT-UML2#Articles

It seems I am doing it properly now.

> Strictly
> speaking, there's nothing wrong with a profile referencing a primitive
> type defined in another model or profile...

Yes, I understand that. The problem in this specific case was that the
primitive types in "uml" were private and I hadn't noticed it.

Thanks!

Rafael

Kenn Hussey wrote:
> Rafael,
>
> The "expected" way to use primitive types is described in the articles
> available at http://wiki.eclipse.org/index.php/MDT-UML2#Articles Strictly
> speaking, there's nothing wrong with a profile referencing a primitive type
> defined in another model or profile...
>
> Kenn
>
> "Rafael Chaves" <chaves@inf.ufsc.nospam.br> wrote in message
> news:eplf98$bv0$1@utils.eclipse.org...
>> Thanks, Kenn, I opened bug 172030:
>> https://bugs.eclipse.org/bugs/show_bug.cgi?id=172030
>>
>>> The reason for this behavior is that you have directly referenced a
>>> primitive type (Integer) from the metamodel instead of from the
>>> primitive types library (only metaclasses from the metamodel
>>> should be directly referenced)
>> Is there a place where one can learn about rules like that?
>>
>> In the specific case, should my profile be importing UMLPrimitiveTypes
>> instead (and references to uml::Integer be changed to
>> UMLPrimitiveTypes::Integer)?
>>
>> Thanks,
>>
>> Rafael
>>
>> Kenn Hussey wrote:
>>> Rafael,
>>>
>>> The reason for this behavior is that you have directly referenced a
>>> primitive type (Integer) from the metamodel instead of from the primitive
>>> types library (only metaclasses from the metamodel should be directly
>>> referenced). With the current profile definition algorithm, metadata from
>>> packages other than the profile being defined are copied into the
>>> definition of the profile. This won't necessarily be the case once we fix
>>> https://bugs.eclipse.org/bugs/show_bug.cgi?id=163556 Please update that
>>> bug or open a new one so that we'll remember to cover your use case.
>>> Thanks!
>>>
>>> Kenn
>>>
>>> "Rafael Chaves" <chaves@inf.ufsc.nospam.br> wrote in message
>>> news:epk79s$ith$1@utils.eclipse.org...
>>>> When I define the following profile named 'sample_profile':
>>>>
>>>> <?xml version="1.0" encoding="UTF-8"?>
>>>> <uml:Profile xmi:version="2.1"
>>>> xmlns:xmi="http://schema.omg.org/spec/XMI/2.1"
>>>> xmlns:uml="http://www.eclipse.org/uml2/2.0.0/UML"
>>>> xmi:id="_O3cisK9mEduaoJ8VsHbaPQ" name="sample_profile">
>>>> <packagedElement xmi:type="uml:Stereotype"
>>>> xmi:id="_P7ic8K9mEduaoJ8VsHbaPQ" name="sample_stereotype">
>>>> <ownedAttribute xmi:id="_Xjqr8K9mEduaoJ8VsHbaPQ" name="myProperty">
>>>> <type xmi:type="uml:PrimitiveType"
>>>> href="pathmap://UML_METAMODELS/UML.metamodel.uml#Integer"/>
>>>> </ownedAttribute>
>>>> </packagedElement>
>>>> </uml:Profile>
>>>>
>>>> It results in a EPackage instance that describes the UML metamodel.
>>>> Also, if I try to apply this profile to any models I build, the model is
>>>> persisted in a way that stereotype applications are lost. The reason
>>>> seems to be that the XMI for such a model refers to stereotypes coming
>>>> from 'sample_profile' as if they were coming from 'uml':
>>>>
>>>> <xmi:XMI xmi:version="2.1" (...)>
>>>> <uml:Model xmi:id="_2YHtEK9lEdu8D5FNufO7zw" name="sample_model">
>>>> (...)
>>>> </uml:Model>
>>>> <uml:sample_stereotype (...) />
>>>> </xmi:XMI>
>>>>
>>>> Instead, I would expect the stereotype applications to appear as:
>>>>
>>>> <sample_profile:sample_stereotype (...) />
>>>>
>>>> The trigger to this problem seems to be that I am referring to a type
>>>> from the uml package (integer). If I remove the reference, the problem
>>>> goes away.
>>>>
>>>> Am I doing anything wrong to cause this, or is this a bug?
>>>>
>>>> Thanks,
>>>>
>>>> Rafael
>
Previous Topic:private package imports
Next Topic:Custom class [1..*] stereotype attribute saved as foo="/-1"
Goto Forum:
  


Current Time: Sat Jun 06 02:59:03 GMT 2020

Powered by FUDForum. Page generated in 0.02598 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top