Defect #1274
closed
Custom filter for synchronization - IcOrFilter uses AND for 3 arguments
Added by Alena Peterová about 6 years ago.
Updated about 6 years ago.
Category:
Identity connectors
Description
Version 9.1.1 SNAPSHOT
When we use IcOrFilter for custom filter with more than 2 arguments, the filter sent to the system contains AND instead of OR.
- Status changed from New to Needs feedback
- Assignee changed from Vít Švanda to Alena Peterová
- Target version set to Morganite (9.2.0)
- % Done changed from 0 to 90
- That is very interesting bug. Primary problem is in the ConnId search. There is called method 'normalizeFilter', where is created new deep copy of that filter.
- I think the bug is in the OrFilter class in method getRight. In this method is created instance of AndFilter, when number of parameters is bigger then 2.
- I don't have this class under controll (bug is in the ConnId).
- I found the workaround. You can split more OR parameters to more subqueries. Example:
Not working:
import eu.bcvsolutions.idm.ic.filter.impl.IcFilterBuilder;
import eu.bcvsolutions.idm.ic.api.IcAttribute;
import eu.bcvsolutions.idm.ic.impl.IcAttributeImpl;
IcAttribute attr = new IcAttributeImpl ("name", "86970");
IcAttribute attr2 = new IcAttributeImpl ("name", "86923");
IcAttribute attr3 = new IcAttributeImpl ("name", "87302");
return IcFilterBuilder.or( IcFilterBuilder.equalTo (attr), IcFilterBuilder.equalTo (attr2), IcFilterBuilder.equalTo (attr3));
Working:
import eu.bcvsolutions.idm.ic.filter.impl.IcFilterBuilder;
import eu.bcvsolutions.idm.ic.api.IcAttribute;
import eu.bcvsolutions.idm.ic.impl.IcAttributeImpl;
IcAttribute attr = new IcAttributeImpl ("name", "86970");
IcAttribute attr2 = new IcAttributeImpl ("name", "86923");
IcAttribute attr3 = new IcAttributeImpl ("name", "87302");
return IcFilterBuilder.or( IcFilterBuilder.equalTo (attr), IcFilterBuilder.or(IcFilterBuilder.equalTo (attr2), IcFilterBuilder.equalTo (attr3)));
- Status changed from Needs feedback to Closed
- Assignee changed from Alena Peterová to Vít Švanda
- % Done changed from 90 to 100
Also available in: Atom
PDF