Skip to content
Snippets Groups Projects
onActionProcess.js 900 B
Newer Older
import("system.logging");
import("DuplicateScanner_lib");

var filterName = "OrganisationDuplicates";
var targetEntity = "Organisation_entity";
var recordBlockSize = DuplicateScannerUtils.GetBlockSize();
let duplicateFieldsConfig = DuplicateScannerUtils.LoadIndexFieldsConfiguration(filterName, targetEntity);
let resultFields = DuplicateScannerUtils.LoadResultFields(filterName, targetEntity);

logging.log(filterName + ": Delete duplicates -> ");
DuplicateScannerUtils.DeleteDuplicateClustersByTargetEntity(targetEntity);

logging.log(filterName + ": Recalculate duplicates -> ");
DuplicateScannerUtils.RebuildDuplicatesCache(filterName, targetEntity, recordBlockSize,
duplicateFieldsConfig, resultFields, null);

logging.log(filterName + ": Refresh unrelated duplicates -> ");
DuplicateScannerUtils.RefreshUnrelatedDuplicateRelations(targetEntity);

logging.log(filterName + ": Done rebuilding ");