finos / rune-dsl

The project containing the Rune DSL grammar and default code generators
Apache License 2.0
24 stars 29 forks source link

Condition with only exists operator should only validate attributes on the type that contains the condition #759

Closed hugohills-regnosys closed 1 week ago

hugohills-regnosys commented 1 month ago

If validating an instance of type B, then when the only exists expression in the condition on super type A is executed, it should only apply to the attributes of type A.

type A:
    a1 string (0..1)
    a2 string (0..1)
    a3 boolean (0..1)

    condition:
        a1 only exists 
        or a3 = True

type B extends A:
    b1 string (0..1)

Currently, given an instance of type B with both a1 and b1 populated, the condition will fail because the only exists evaluates to false.