Project

General

Profile

Actions

Defect #1274

closed

Custom filter for synchronization - IcOrFilter uses AND for 3 arguments

Added by Alena Peterová over 5 years ago. Updated over 5 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Vít Švanda
Category:
Identity connectors
Target version:
Start date:
09/26/2018
Due date:
% Done:

100%

Estimated time:
Affected versions:
Owner:

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.

Actions #1

Updated by Vít Švanda over 5 years ago

  • 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))); 

Actions #2

Updated by Alena Peterová over 5 years ago

  • Status changed from Needs feedback to Closed
  • Assignee changed from Alena Peterová to Vít Švanda
  • % Done changed from 90 to 100

Thank you for examining the issue. I understand we can't solve it in our code. I wrote at least the note here: https://wiki.czechidm.com/devel/documentation/synchronization/dev/synchronization#connector_synchronization_vs_my_own_filter

Actions

Also available in: Atom PDF