I have a business rule based on the equality of two collections.
The condition A=B doesn't do the job, for = is in this case an assignment operator.
So I tried to implement the condition with two conditions:
A->forAll(B->exists(A.nr=B.nr)) and
B->forAll(A->exists(B.nr=A.nr)), but nesting quantifiers doen't seem possible, the error message is 'mismatched brackets'.
Does anyone know how to solve this? Thanks.
Hi Gertjan,
My previous answer was incorrect, so I deleted it,
A->exists(A.nr=B.nr) and B->exists(A.nr=B.nr) does the trick together with the Corticon inference mechanism.
Thanks,
Tineke
Hi Tineke,
Are the 2 collections based on 2 different entities? So you have A.Nr and B.Nr as the attributes that need to be compared? Or do you have 1 entity with 2 aliasses A and B?
-Gertjan
Hi Gertjan, yes
nr is the identifying attribute of the entities in both collections.
The entities in the collections are the same.
Tineke
Hi Gertjan, my question was a little foolish. Due to the inference mechanisme of Corticon I didn't need the combination of quantifiers. I solved it with:
A->forAll(A.nr=B.nr) and
B->forAll(B.nr=A.nr),
I guess your solution works as well, based on the same mechanisme.
Thanks!
Tineke
Hi Gertjan,
My previous answer was incorrect, so I deleted it,
A->exists(A.nr=B.nr) and B->exists(A.nr=B.nr) does the trick together with the Corticon inference mechanism.
Thanks,
Tineke