How to write OCL for an optional derived property?

Posted:
Mon May 18, 2020 1:27 pm
by Axel Scheithauer
I have a Integer derived property with multiplicity 0..1. The derivation mechanism fills it with 0, even when the ocl script returns null. Is there a way to not fill the field? I know, it is possible with JavaScript by just deleting the field. However, there is no deletion in ocl.
Re: How to write OCL for an optional derived property?

Posted:
Tue May 19, 2020 2:18 am
by Axel Scheithauer
I now figured out, that it works when the multiplicity is 0..*. Returning null then leaves the field unfilled. Its an ugly workaround, but at least it solves the current problem.