Thanks Tom, This worked for the rule that reports the errors as I rewrote it to be:
If EXISTS Services where (Services in Staff.Services_Add and Services in Staff.Services_Del) then
report error 'Cannot have same service in both Services_Del and Services_Add'
Now I have a problem with the rule for adding/deleting "normal" entries into the Staff.Services attribute. Background is that I have 4 attributes that are associated with each other (Services, Services_Auto, Services_Del, and Services_Add). Services is calculated from the other three. Services_Auto is calculated from imports from other systems. Services_Add is used to add an additional attribute while Services_Del is used to remove an imported attribute. The rule for Services_Add is:
If Services was added to Staff.Services_Add
then insert AddedServices in Staff.Services
else if Services was removed from Staff.Services_Add
then remove RemovedServices from Staff.Services
Services_Del is the same. The problem is Services_Auto as it not only has to handle adds and deletes but it has to check to assure that it respects the overrides in Services_Add or Services_Del. I have tried:
If Services was added to Staff.Services_Auto and not (exists AddedServices where (AddedServices in Staff.Services_Del))
then insert AddedServices in Staff.Services
else if Services was removed from Staff.Services_Add and not (exists RemovedServices where (RemovedServices in Staff.Services_Add))
then remove RemovedServices from Staff.Services
and a process that tried to delete all Services in Services and then added back in the ones in Services_Auto and Services_Add and then deleted the ones in Services_Del
No luck.
Any ideas?