@Override
public void beforeUpdate(Record record, Record originalRecord, Repository repository, FieldTypes fieldTypes,
RecordEvent recordEvent) throws RepositoryException, InterruptedException {
Collection<IndexInfo> indexInfos = indexesInfo.getIndexInfos();
if (indexInfos.size() > 0) {
TypeManager typeMgr = repository.getTypeManager();
RecordEvent.IndexRecordFilterData idxSel = new RecordEvent.IndexRecordFilterData();
recordEvent.setIndexRecordFilterData(idxSel);
idxSel.setOldRecordExists(true);
idxSel.setNewRecordExists(true);
if (indexesInfo.getRecordFilterDependsOnRecordType()) {
// Because record type names can change, this is not guaranteed to be the same as what gets
// stored in the repo, but that doesn't matter as it is only for indexing purposes.
SchemaId oldRecordTypeId = typeMgr.getRecordTypeByName(originalRecord.getRecordTypeName(), null).getId();
idxSel.setOldRecordType(oldRecordTypeId);
// on update, specifying record type is optional
idxSel.setNewRecordType(record.getRecordTypeName() != null ?
typeMgr.getRecordTypeByName(record.getRecordTypeName(), null).getId() : oldRecordTypeId);
}
Set<QName> names = indexesInfo.getRecordFilterFieldDependencies();
for (QName name : names) {
Object oldValue = null, newValue = null;