[ATL] How to return a null value from a helper [message #490430] |
Thu, 08 October 2009 11:49  |
Eclipse User |
|
|
|
Hi all,
I'm doing my first ATL transformation. There's one helper, that should
return the spouse of a given family member if there is one (You see, I'm
extending that Families2Person example).
So here is the code:
--8<---------------cut here---------------start------------->8---
helper context Families!Member def: spouse : Families!Member =
if not self.familyMother.oclIsUndefined() then
self.familyMother.father
else
if not self.familyFather.oclIsUndefined() then
self.familyFather.mother
else
null
endif
endif;
--8<---------------cut here---------------end--------------->8---
So if my member is neither the father nor the mother of a family, then
he has no spouse and I want to return null. But ATL tells me that the
variable null is undefined. So what's the null literal in OCL?
Bye,
Tassilo
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03881 seconds