Using the areAreas, areAreas2 or areAreas3 function with an object(s) argument of THIS may lead to wrong results. The result of the evaluation of the first object gets cached and is reused for all other objects.
The attached example has two instances of a class, one with geometry, that satisfies the mandatory constraint with areAreas2 and one that does not. The expected validation result would be one mandatory constraint violation error for the incorrect instance.
Using the areAreas, areAreas2 or areAreas3 function with an object(s) argument of
THIS
may lead to wrong results. The result of the evaluation of the first object gets cached and is reused for all other objects.The attached example has two instances of a class, one with geometry, that satisfies the mandatory constraint with areAreas2 and one that does not. The expected validation result would be one mandatory constraint violation error for the incorrect instance.
MANDATORY CONSTRAINT INTERLIS_ext.areAreas2(THIS, UNDEFINED, "geom_attr->geom");
If the correct instance is checked first the error with the second instance is not detected.
If the faulty instance is checked first, a second superfluous error is logged for the correct instance:
areAreas_constraint_this_broken_caching_ili2_3.zip