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

Dear Hugo!

I have the same problem using the MARTE profile... When I try to define an input profile, eclipse wants me to pick a file from my workspace or my File System... What kind of file is needed here?

Greetings,

Bragenheim


Hugo Bruneliere schrieb:
Hi Rasha,

First, do you pass the definition of the profile (which is a UML model) as an input of your transformation?

Rasha a Ãcrit :
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);


Are you sure the getValue method is actually returning a uml::Element?
What happens if the property of the given stereotype is of type String or Integer?


---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



Best regards,

Hugo