[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.modeling.m2m] Re: [ATL] NullPointerException--ERROR

I have only another helper ?hasStereotype? which I tested separately and works fine. I attached the whole transformation file.


---This helper define the method "hasStereotype" helper context UML!"uml::Element" def: hasStereotype(stereotype : String) : Boolean = self.getAppliedStereotypes()-> exists (c | c.name = stereotype);

---This helper define the method "getTaggedValue"
helper context UML!"uml::Element" def: getTaggedValue(stereo :
String ,tag : String) : UML!"uml::Element" =
self.getValue(self.getAppliedStereotype(stereo),tag);

---This helper verifies if the value of the proterty 'myProperty' is different of 'value1'
helper context UML!"uml::Element" def : checkMyPropertyValue() : Boolean =
if (self.hasStereotype('MyStereotype')) then
if (self.getTaggedValue('MyStereotype','myProperty')<>'value1') then
true
else false
endif
else
true
endif;


rule Copyclass{
from
s : UML!Class (s.checkMyPropertyValue())
to t : UML!Class( name <- s.name
)
}



Best Regards,

Rasha