I am trying to get this calculation to work in OCL, it has to say that if there is a cancelation present, it should give 'geannuleerd' and if there is a betaaldatum present it should give 'definitief'. My question is: I need for this if-else-then statement a boolean, but I can't find out whether self.annuleringsdatum-> notEmpty() is enough or that there should be an = TRUE behind it.
What I have now is underneath, if you know whether this should work or whether the boolean statement is not correct yet, please answer :)
ontext Reservering::status
derive: if self.annuleringsdatum -> notEmpty()
then self.status = 'geannuleerd'
if self.betaaldatum -> notEmpty()
then self.status = 'definitief'
else self.status = 'voorlopig'
endif