Illegal Argument setting a stereotype property [message #477100] |
Mon, 17 March 2008 20:09 |
Eclipse User |
|
|
|
Originally posted by: flavio.p.duarte.gmail.com
Hi,
it has been a long time since the last time a posted a message here, but
I'm still struggling with profiles and stereotypes.
My newest problem is related to set a value for a stereotype property,
more specificaly, the PAdemand property of the PAstep stereotype
conetained in the UML SPT profile. I used the PAschdPolicy property of
PAhost stereotype without problem, but the PAdemand is triggering an
IllegalArgumentException whenever I try to use setValue method. My code is
basicaly:
// st is PAstep
void setProperties( NamedElement elem, Stereotype st ) {
elem.applyStereotype( st );
String key = "PAdemand";
String value = "('assm','mean',(0.8,'s'))"
elem.setValue( st, key, value );
}
I took a look at the profile.uml file and the PAdemand is defined as a
string, so the contents of the variable value should not matter (I think).
Does anyone have any idea on how to discover what's going on ?
thanks,
Flávio
|
|
|
Re: Illegal Argument setting a stereotype property [message #477103 is a reply to message #477100] |
Tue, 18 March 2008 14:25 |
Eclipse User |
|
|
|
Originally posted by: flavio.p.duarte.gmail.com
Ok,
I managed to "solve" the problem. Basically I had to change the profile.
I would like to have some comments from the experts here in this forum
about my workaround. The relevant lines are:
<eStructuralFeatures xmi:type="ecore:EAttribute"
xmi:id="_U57BXcXKEdybOP4NOZDt8g" name="PAdemand" ordered="false"
upperBound="-1">
<eType xmi:type="ecore:EDataType"
href="http://www.eclipse.org/emf/2002/Ecore#//EString"/>
</eStructuralFeatures>
...
<ownedAttribute xmi:id="_8f8028c_1072170912682_690982_2939"
name="PAdemand" visibility="private">
<type xmi:type="uml:PrimitiveType"
href=" pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml#String"/>
<upperValue xmi:type="uml:LiteralUnlimitedNatural"
xmi:id="_10_0_be00301_1127808747156_845613_154" name="" value="*"/>
<lowerValue xmi:type="uml:LiteralInteger"
xmi:id="_10_0_be00301_1127808747156_472049_153" name=""/>
</ownedAttribute>
In the first set I removed the 'upperBound="-1"' and in the second set
I've changed 'value="*"' to 'value="1"'. I'm not really sure what an
upperBound="-1" means.
It's also worth to say that the original profile was designed to UML 2.1
and I converted it to 2.0 following an advice posted in this newsgroup.
thanks,
Flávio
|
|
|
|
Re: Illegal Argument setting a stereotype property [message #626232 is a reply to message #477100] |
Tue, 18 March 2008 14:25 |
Eclipse User |
|
|
|
Originally posted by: flavio.p.duarte.gmail.com
Ok,
I managed to "solve" the problem. Basically I had to change the profile.
I would like to have some comments from the experts here in this forum
about my workaround. The relevant lines are:
<eStructuralFeatures xmi:type="ecore:EAttribute"
xmi:id="_U57BXcXKEdybOP4NOZDt8g" name="PAdemand" ordered="false"
upperBound="-1">
<eType xmi:type="ecore:EDataType"
href="http://www.eclipse.org/emf/2002/Ecore#//EString"/>
</eStructuralFeatures>
...
<ownedAttribute xmi:id="_8f8028c_1072170912682_690982_2939"
name="PAdemand" visibility="private">
<type xmi:type="uml:PrimitiveType"
href=" pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml#String"/>
<upperValue xmi:type="uml:LiteralUnlimitedNatural"
xmi:id="_10_0_be00301_1127808747156_845613_154" name="" value="*"/>
<lowerValue xmi:type="uml:LiteralInteger"
xmi:id="_10_0_be00301_1127808747156_472049_153" name=""/>
</ownedAttribute>
In the first set I removed the 'upperBound="-1"' and in the second set
I've changed 'value="*"' to 'value="1"'. I'm not really sure what an
upperBound="-1" means.
It's also worth to say that the original profile was designed to UML 2.1
and I converted it to 2.0 following an advice posted in this newsgroup.
thanks,
Flávio
|
|
|
|
Powered by
FUDForum. Page generated in 0.04744 seconds