From c5d37f446821d1269ea513d481fe22e514e67c85 Mon Sep 17 00:00:00 2001 From: "d.buechler" <d.buechler@adito.de> Date: Mon, 19 Aug 2019 14:34:53 +0200 Subject: [PATCH] =?UTF-8?q?Neue=20ID=20f=C3=BCr=20Liquibase=20generiert=20?= =?UTF-8?q?Neues=20LB=20SCript=20f=C3=BCr=20die=20Tabelle=20zum=20ignorier?= =?UTF-8?q?en=20von=20Dubletten=20erstellt=20Dubletten=20k=C3=B6nnen=20nun?= =?UTF-8?q?=20=C3=BCber=20eine=20Action=20ignoriert=20werden=20Neuer=20Par?= =?UTF-8?q?ameter=20an=20der=20Person,=20dass=20die=20ContactId=20des=20ak?= =?UTF-8?q?tuell=20ge=C3=B6ffnetes=20Kontaktes=20an=20die=20DublettenRefer?= =?UTF-8?q?enz/Provider=20per=20Parameter=20weitergegeben=20wird=20Neue=20?= =?UTF-8?q?Funktionen=20zum=20Erstellen,=20l=C3=B6schen=20einer=20Ignorier?= =?UTF-8?q?ten=20Dublettenrelation=20und=20zum=20L=C3=B6schen=20aller=20vo?= =?UTF-8?q?rkomnisse=20einer=20ContactId=20in=20der=20UnrelatedDuplicates?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Duplicates/create_duplicateClusters.xml | 8 -- .../Duplicates/create_duplicateScanner.xml | 2 +- .../Duplicates/create_unrelatedDuplicates.xml | 16 +++ .../Data_alias/basic/2019.2.1/changelog.xml | 1 + aliasDefinition/Data_alias/Data_alias.aod | 58 +++++----- .../ignoreduplicate/onActionProcess.js | 9 +- .../onActionProcess.js | 2 +- .../onActionProcess.js | 2 +- .../valueProcess.js | 3 + neonContext/Duplicates/Duplicates.aod | 4 - .../PersonDuplicates_view.aod | 17 --- process/DuplicateScanner_lib/process.js | 103 +++++++++--------- 12 files changed, 114 insertions(+), 111 deletions(-) create mode 100644 .liquibase/Data_alias/basic/2019.2.1/Duplicates/create_unrelatedDuplicates.xml create mode 100644 entity/Person_entity/entityfields/selfduplicates/children/duplicatecurrentcontactid_param/valueProcess.js delete mode 100644 neonView/PersonDuplicates_view/PersonDuplicates_view.aod diff --git a/.liquibase/Data_alias/basic/2019.2.1/Duplicates/create_duplicateClusters.xml b/.liquibase/Data_alias/basic/2019.2.1/Duplicates/create_duplicateClusters.xml index 30bda2820c..a89ca7761d 100644 --- a/.liquibase/Data_alias/basic/2019.2.1/Duplicates/create_duplicateClusters.xml +++ b/.liquibase/Data_alias/basic/2019.2.1/Duplicates/create_duplicateClusters.xml @@ -11,14 +11,6 @@ <column name="DUPLICATEID" type="CHAR(36)" > <constraints nullable="false"/> </column> - <column name="USER_NEW" type="NVARCHAR(50)"> - <constraints nullable="false"/> - </column> - <column name="DATE_NEW" type="DATE"> - <constraints nullable="false"/> - </column> - <column name="USER_EDIT" type="NVARCHAR(50)" /> - <column name="DATE_EDIT" type="DATE" /> </createTable> </changeSet> </databaseChangeLog> \ No newline at end of file diff --git a/.liquibase/Data_alias/basic/2019.2.1/Duplicates/create_duplicateScanner.xml b/.liquibase/Data_alias/basic/2019.2.1/Duplicates/create_duplicateScanner.xml index aee9dd9861..a855de94e6 100644 --- a/.liquibase/Data_alias/basic/2019.2.1/Duplicates/create_duplicateScanner.xml +++ b/.liquibase/Data_alias/basic/2019.2.1/Duplicates/create_duplicateScanner.xml @@ -1,6 +1,6 @@ <?xml version="1.1" encoding="UTF-8" standalone="no"?> <databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog" xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog-ext http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsd http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.6.xsd"> - <changeSet author="d.buechler" id="53fef445-1c3f-44a7-a55e-33827aac23ea"> + <changeSet author="d.buechler" id="6fdea873-6515-4553-b6e7-f4fd3f2132c4"> <createTable tableName="DUPLICATESCANNER"> <column name="ID" type="CHAR(36)"> <constraints primaryKey="true" primaryKeyName="PK_DUPLICATESCANNER_ID"/> diff --git a/.liquibase/Data_alias/basic/2019.2.1/Duplicates/create_unrelatedDuplicates.xml b/.liquibase/Data_alias/basic/2019.2.1/Duplicates/create_unrelatedDuplicates.xml new file mode 100644 index 0000000000..a4bfd6b956 --- /dev/null +++ b/.liquibase/Data_alias/basic/2019.2.1/Duplicates/create_unrelatedDuplicates.xml @@ -0,0 +1,16 @@ +<?xml version="1.1" encoding="UTF-8" standalone="no"?> +<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog" xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog-ext http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsd http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.6.xsd"> + <changeSet author="d.buechler" id="3f126158-8387-4013-ac73-219adf5fbf83"> + <createTable tableName="UNRELATEDDUPLICATES"> + <column name="ID" type="CHAR(36)"> + <constraints primaryKey="true" primaryKeyName="PK_UNRELATEDDUPLICATES_ID"/> + </column> + <column name="SOURCEDUPLICATEID" type="CHAR(36)" > + <constraints nullable="false"/> + </column> + <column name="UNRELATEDDUPLICATEID" type="CHAR(36)" > + <constraints nullable="false"/> + </column> + </createTable> + </changeSet> +</databaseChangeLog> \ No newline at end of file diff --git a/.liquibase/Data_alias/basic/2019.2.1/changelog.xml b/.liquibase/Data_alias/basic/2019.2.1/changelog.xml index c5853684f6..805f6b4d5a 100644 --- a/.liquibase/Data_alias/basic/2019.2.1/changelog.xml +++ b/.liquibase/Data_alias/basic/2019.2.1/changelog.xml @@ -12,4 +12,5 @@ <include relativeToChangelogFile="true" file="Duplicates/create_duplicateClusters.xml"/> <include relativeToChangelogFile="true" file="Duplicates/create_duplicateScanner.xml"/> <include relativeToChangelogFile="true" file="Duplicates/create_duplicateScanConditionConfig.xml"/> + <include relativeToChangelogFile="true" file="Duplicates/create_unrelatedDuplicates.xml"/> </databaseChangeLog> diff --git a/aliasDefinition/Data_alias/Data_alias.aod b/aliasDefinition/Data_alias/Data_alias.aod index f86fa81687..e03194b8fc 100644 --- a/aliasDefinition/Data_alias/Data_alias.aod +++ b/aliasDefinition/Data_alias/Data_alias.aod @@ -11338,25 +11338,45 @@ <description></description> </entityFieldDb> <entityFieldDb> - <name>DATE_EDIT</name> + <name>ID</name> <dbName></dbName> - <primaryKey v="false" /> - <columnType v="91" /> - <size v="10" /> + <primaryKey v="true" /> + <columnType v="1" /> + <size v="36" /> <scale v="0" /> - <notNull v="false" /> - <isUnique v="false" /> + <notNull v="true" /> + <isUnique v="true" /> <index v="false" /> <documentation></documentation> <title></title> <description></description> </entityFieldDb> + </entityFields> + </entityDb> + <entityDb> + <name>UNRELATEDDUPLICATES</name> + <dbName></dbName> + <idColumn>ID</idColumn> + <idGeneratorType v="0" /> + <idGeneratorInterval v="1" /> + <documentation></documentation> + <title></title> + <description></description> + <auditSyncConfig> + <name>auditSyncConfig</name> + <auditMode v="0" /> + <syncActive v="false" /> + <syncComplete v="true" /> + <syncDirection v="1" /> + <syncIds></syncIds> + </auditSyncConfig> + <entityFields> <entityFieldDb> - <name>DATE_NEW</name> + <name>SOURCEDUPLICATEID</name> <dbName></dbName> <primaryKey v="false" /> - <columnType v="91" /> - <size v="10" /> + <columnType v="1" /> + <size v="36" /> <scale v="0" /> <notNull v="true" /> <isUnique v="false" /> @@ -11380,11 +11400,11 @@ <description></description> </entityFieldDb> <entityFieldDb> - <name>USER_NEW</name> + <name>UNRELATEDDUPLICATEID</name> <dbName></dbName> <primaryKey v="false" /> - <columnType v="12" /> - <size v="50" /> + <columnType v="1" /> + <size v="36" /> <scale v="0" /> <notNull v="true" /> <isUnique v="false" /> @@ -11393,20 +11413,6 @@ <title></title> <description></description> </entityFieldDb> - <entityFieldDb> - <name>USER_EDIT</name> - <dbName></dbName> - <primaryKey v="false" /> - <columnType v="12" /> - <size v="50" /> - <scale v="0" /> - <notNull v="false" /> - <isUnique v="false" /> - <index v="false" /> - <documentation></documentation> - <title></title> - <description></description> - </entityFieldDb> </entityFields> </entityDb> </entities> diff --git a/entity/Person_entity/entityfields/duplicateactions/children/ignoreduplicate/onActionProcess.js b/entity/Person_entity/entityfields/duplicateactions/children/ignoreduplicate/onActionProcess.js index 8bc517ecf8..1c3fc2e21a 100644 --- a/entity/Person_entity/entityfields/duplicateactions/children/ignoreduplicate/onActionProcess.js +++ b/entity/Person_entity/entityfields/duplicateactions/children/ignoreduplicate/onActionProcess.js @@ -1,5 +1,10 @@ +import("system.neon"); import("system.vars"); import("DuplicateScanner_lib"); -let contactId = vars.get("$field.CONTACTID"); -DuplicateScannerUtils.DeleteCachedDuplicate(contactId); \ No newline at end of file +let sourceContactId = vars.get("$param.DuplicateCurrentContactId_param"); +let selectedContactId = vars.get("$sys.selection"); + +DuplicateScannerUtils.CreateUnrelatedDuplicateRelation(sourceContactId, selectedContactId); + +neon.refreshAll(); \ No newline at end of file diff --git a/entity/Person_entity/entityfields/duplicateactions/children/integratecurrentintoselectedaction/onActionProcess.js b/entity/Person_entity/entityfields/duplicateactions/children/integratecurrentintoselectedaction/onActionProcess.js index 63fddf359f..b752040252 100644 --- a/entity/Person_entity/entityfields/duplicateactions/children/integratecurrentintoselectedaction/onActionProcess.js +++ b/entity/Person_entity/entityfields/duplicateactions/children/integratecurrentintoselectedaction/onActionProcess.js @@ -2,7 +2,7 @@ import("system.vars"); import("system.neon"); import("DuplicateScanner_lib"); -let sourceContactId = vars.get("$param.sourceContactId_param"); +let sourceContactId = vars.get("$param.DuplicateCurrentContactId_param"); let targetContactId = vars.get("$sys.selection"); //todo the actual merge ought to happen in a separate view where the contact infos can be merged manually by the user. diff --git a/entity/Person_entity/entityfields/duplicateactions/children/integrateselectedintocurrentaction/onActionProcess.js b/entity/Person_entity/entityfields/duplicateactions/children/integrateselectedintocurrentaction/onActionProcess.js index ca0b259195..ea59a8ed29 100644 --- a/entity/Person_entity/entityfields/duplicateactions/children/integrateselectedintocurrentaction/onActionProcess.js +++ b/entity/Person_entity/entityfields/duplicateactions/children/integrateselectedintocurrentaction/onActionProcess.js @@ -3,7 +3,7 @@ import("system.vars"); import("system.neon"); import("DuplicateScanner_lib"); -let targetContactId = vars.get("$field.CONTACTID"); +let targetContactId = vars.get("$param.DuplicateCurrentContactId_param"); let sourceContactId = vars.get("$sys.selection"); logging.log("targetContactId -> " + targetContactId); logging.log("sourceContactId -> "+ sourceContactId); diff --git a/entity/Person_entity/entityfields/selfduplicates/children/duplicatecurrentcontactid_param/valueProcess.js b/entity/Person_entity/entityfields/selfduplicates/children/duplicatecurrentcontactid_param/valueProcess.js new file mode 100644 index 0000000000..821415ae69 --- /dev/null +++ b/entity/Person_entity/entityfields/selfduplicates/children/duplicatecurrentcontactid_param/valueProcess.js @@ -0,0 +1,3 @@ +import("system.vars"); +import("system.result"); +result.string(vars.get("$field.CONTACTID")); \ No newline at end of file diff --git a/neonContext/Duplicates/Duplicates.aod b/neonContext/Duplicates/Duplicates.aod index b283f75380..e640ba2fe3 100644 --- a/neonContext/Duplicates/Duplicates.aod +++ b/neonContext/Duplicates/Duplicates.aod @@ -8,9 +8,5 @@ <name>fe767c88-a869-4fe6-b61d-8727faad7a12</name> <view>DuplicatesFilter_view</view> </neonViewReference> - <neonViewReference> - <name>42958ab5-8d85-4cfd-ab81-1201348576c9</name> - <view>PersonDuplicates_view</view> - </neonViewReference> </references> </neonContext> diff --git a/neonView/PersonDuplicates_view/PersonDuplicates_view.aod b/neonView/PersonDuplicates_view/PersonDuplicates_view.aod deleted file mode 100644 index 80720c1f06..0000000000 --- a/neonView/PersonDuplicates_view/PersonDuplicates_view.aod +++ /dev/null @@ -1,17 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<neonView xmlns="http://www.adito.de/2018/ao/Model" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" VERSION="1.1.2" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/neonView/1.1.2"> - <name>PersonDuplicates_view</name> - <majorModelMode>DISTRIBUTED</majorModelMode> - <layout> - <boxLayout> - <name>layout</name> - </boxLayout> - </layout> - <children> - <neonViewReference> - <name>113cab06-ca9a-41a5-8de7-7ba759596497</name> - <entityField>PersonConsumer</entityField> - <view>PersonFilter_view</view> - </neonViewReference> - </children> -</neonView> diff --git a/process/DuplicateScanner_lib/process.js b/process/DuplicateScanner_lib/process.js index a17329adff..a98b2f5193 100644 --- a/process/DuplicateScanner_lib/process.js +++ b/process/DuplicateScanner_lib/process.js @@ -5,6 +5,7 @@ import("system.net"); import("system.logging"); import("system.db"); import("system.entities"); +import("Sql_lib"); /** * Methods for duplicate scanning. @@ -28,30 +29,6 @@ DuplicateScannerUtils.ScanForDuplicates = function(pFilterName, pTargetEntity, p return possibleDuplicates; } -//DuplicateScannerUtils.ScanAndUpdateResultCache = function() -//{ -// let duplicatesRay = DuplicateScannerUtils.ScanForDuplicates(); -// -// if(duplicatesRay.length > 0) -// { -// /* -// * Try loading the clusterId instead of using a boolean exists check to determine if theres already an identical cluster. -// * If a same cluster already exists the id of it is directly available to use -// */ -// let clusterId = _DuplicateScannerUtils._getIdOfIdenticalCachedDuplicatesCluster(pRecordIdValueToIgnore, duplicatesRay) -// if(clusterId == "") -// { -// // No cluster with identical records exists, therefore a new one has to be created containing the new value as well as the found duplicates -// _DuplicateScannerUtils._createNewCachedDuplicatesCluster(pRecordIdValueToIgnore, duplicatesRay); -// } -// else -// { -// //aktuellen datensatz zu cluster hinzufügen -// _DuplicateScannerUtils._AddRecordsToCachedDuplicatesCluster(pRecordIdValueToIgnore, clusterId); -// } -// } -//} - DuplicateScannerUtils.DeleteCachedDuplicate = function(pContactId) { let query = "select count(ID), CLUSTERID from DUPLICATECLUSTERS" @@ -75,26 +52,49 @@ DuplicateScannerUtils.DeleteCachedDuplicate = function(pContactId) { db.deleteData("DUPLICATECLUSTERS", "DUPLICATECLUSTERS.DUPLICATEID = '"+ pContactId +"'"); } - //todo delete from ignore table, too + DuplicateScannerUtils.DeleteAllUnrelatedDuplicateRelations(pContactId); +} + +DuplicateScannerUtils.CreateUnrelatedDuplicateRelation = function(pSourceContactId, pUnrelatedContactId) +{ + let newUid = util.getNewUUID(); + let columns = ["ID", "SOURCEDUPLICATEID", "UNRELATEDDUPLICATEID"]; + let values = [newUid, pSourceContactId, pUnrelatedContactId]; + + db.insertData("UNRELATEDDUPLICATES", columns, null, values); } -DuplicateScannerUtils.IgnoreDuplicateRelation = function(pContactId1, pContactId2) +DuplicateScannerUtils.DeleteUnrelatedDuplicateRelation = function(pSourceContactId, pUnrelatedContactId) { + var cond = new SqlCondition(); + cond.andPrepare("UNRELATEDDUPLICATES.SOURCEDUPLICATEID", pSourceContactId) + cond.andPrepare("UNRELATEDDUPLICATES.UNRELATEDDUPLICATEID", pUnrelatedContactId) + let condition = db.translateCondition(cond.build()); + db.deleteData("UNRELATEDDUPLICATES", condition); } -DuplicateScannerUtils.UnIgnoreDuplicateRelation = function(pContactId1, pContactId2) +DuplicateScannerUtils.DeleteAllUnrelatedDuplicateRelations = function(pContactId) { + var cond = new SqlCondition(); + cond.orPrepare("UNRELATEDDUPLICATES.SOURCEDUPLICATEID", pContactId) + cond.orPrepare("UNRELATEDDUPLICATES.UNRELATEDDUPLICATEID", pContactId) + let condition = db.translateCondition(cond.build()); + db.deleteData("UNRELATEDDUPLICATES", condition); } DuplicateScannerUtils.GetCachedDuplicatesForContactId = function(pDuplicateId) { + let querySelectIgnoredDuplicates = ''; let querySelectDuplicateContactIds = "select DUPLICATEID from DUPLICATECLUSTERS" + " where CLUSTERID = (select CLUSTERID from DUPLICATECLUSTERS" + " where DUPLICATEID = '"+ pDuplicateId +"')" - + " and DUPLICATEID != '"+ pDuplicateId +"'"; + + " and DUPLICATEID != '"+ pDuplicateId +"'" + + " and DUPLICATEID not in (select UNRELATEDDUPLICATEID from UNRELATEDDUPLICATES where SOURCEDUPLICATEID = '"+ pDuplicateId +"')" + + " and DUPLICATEID not in (select SOURCEDUPLICATEID from UNRELATEDDUPLICATES where UNRELATEDDUPLICATEID = '"+ pDuplicateId +"')"; + return db.array(db.COLUMN, querySelectDuplicateContactIds); } @@ -175,6 +175,8 @@ pQueryTargetRecords, pFilterFields, pRecordIdFieldToIgnore) db.inserts(duplicatesToInsertQueries); } + + DuplicateScannerUtils.MergePerson = function(pSourceContactId, pTargetContactId) { let updateStatements = []; @@ -183,35 +185,24 @@ DuplicateScannerUtils.MergePerson = function(pSourceContactId, pTargetContactId) var sourcePersonId = db.cell("select PERSON_ID from CONTACT where CONTACTID = '" + pSourceContactId + "'"); var tableInfos = _DuplicateScannerUtils._getMergeUpdateTableInfos(); - updateStatements.concat(_DuplicateScannerUtils._buildUpdateContactIdStatements(tableInfos, pSourceContactId, pTargetContactId)); - updateStatements.concat(_DuplicateScannerUtils._buildUpdateAttachParticipantsToNewContactQuery("CAMPAIGNPARTICIPANT", "CONTACT_ID", "CAMPAIGN_ID", pSourceContactId, pTargetContactId)); + updateStatements = updateStatements.concat(_DuplicateScannerUtils._buildUpdateContactIdStatements(tableInfos, pSourceContactId, pTargetContactId)); + updateStatements = updateStatements.concat(_DuplicateScannerUtils._buildUpdateAttachParticipantsToNewContactQuery("CAMPAIGNPARTICIPANT", "CONTACT_ID", "CAMPAIGN_ID", pSourceContactId, pTargetContactId)); - deleteStatements.concat(_DuplicateScannerUtils._buildDeleteRemoveObsoleteParticipantsRecordsQuery("CAMPAIGNPARTICIPANT", "CONTACT_ID", "CAMPAIGN_ID", pSourceContactId, pTargetContactId)); + deleteStatements = deleteStatements.concat(_DuplicateScannerUtils._buildDeleteRemoveObsoleteParticipantsRecordsQuery("CAMPAIGNPARTICIPANT", "CONTACT_ID", "CAMPAIGN_ID", pSourceContactId, pTargetContactId)); deleteStatements = deleteStatements.concat(_DuplicateScannerUtils._buildDeletePersonAndContactQuery(sourcePersonId, pSourceContactId)); + deleteStatements = deleteStatements.concat(_DuplicateScannerUtils._buildDeleteCachedDuplicateQuery(sourcePersonId, pSourceContactId)); - //logging.log("updateStatements -> " + JSON.stringify(updateStatements)); + + logging.log("updateStatements -> " + JSON.stringify(updateStatements)); logging.log("deleteStatements -> " + JSON.stringify(deleteStatements)); //let affectedRows = db.updates(updateStatements); //let deletedRows = db.deletes(deleteStatements) + DuplicateScannerUtils.DeleteCachedDuplicate(pSourceContactId); + return true;//(affectedRows > 0 && deletedRows >= 2); } -//DuplicateScannerUtils._getScanConfigForEntity = function(pTargetEntity) -//{ -// switch (pTargetEntity) -// { -// case "Person_entity": -// { -// TargetEntityResultFields: -// } -// break; -// default: -// break; -// } -// -//} - function _DuplicateScannerUtils() {} var INDEX_FILTER_CONDITION = 0; @@ -250,8 +241,7 @@ _DuplicateScannerUtils._AddRecordsToCachedDuplicatesCluster = function (pRecordI _DuplicateScannerUtils._deleteDuplicateClusters = function () { - let queryDropTable = "DELETE FROM DUPLICATECLUSTERS"; - db.deleteData("DUPLICATECLUSTERS", ""); + db.deleteData("DUPLICATECLUSTERS"); } /* @@ -277,7 +267,7 @@ _DuplicateScannerUtils._buildUpdateAttachParticipantsToNewContactQuery = functio + " (" + selectAssignableIdsOfTargetContactQuery + ")" + " and " + pContactIdColumn + " = '" + pSourceContactId + "'"; - return [pTableName, [pContactIdColumn], null, [pTargetContactId], updateCondition]; + return [[pTableName, [pContactIdColumn], null, [pTargetContactId], updateCondition]]; } _DuplicateScannerUtils._buildDeleteRemoveObsoleteParticipantsRecordsQuery = function (pTableName, pContactIdColumn, pAssignableIdColumn, pSourceContactId, pTargetContactId, updateStatements) @@ -289,7 +279,9 @@ _DuplicateScannerUtils._buildDeleteRemoveObsoleteParticipantsRecordsQuery = func let deleteCondition = pAssignableIdColumn + " in" + " (" + selectAssignableIdsOfTargetContactQuery + ")" + " and " + pAssignableIdColumn + " = '" + pSourceContactId + "'"; - return [pTableName, deleteCondition]; + let recordsToDelete = []; + recordsToDelete.push([pTableName, deleteCondition]); + return recordsToDelete; } _DuplicateScannerUtils._buildDeletePersonAndContactQuery = function(pSourcePersonId, pSourceContactId) @@ -300,6 +292,15 @@ _DuplicateScannerUtils._buildDeletePersonAndContactQuery = function(pSourcePerso return recordsToDelete; } +_DuplicateScannerUtils._buildDeleteCachedDuplicateQuery = function(pSourcePersonId, pSourceContactId) +{ + + let recordsToDelete = [] + recordsToDelete.push(["PERSON", "PERSONID = '" + pSourcePersonId + "'"]); + recordsToDelete.push(["CONTACT", "CONTACTID = '" + pSourceContactId + "'"]); + return recordsToDelete; +} + _DuplicateScannerUtils._getIgnoreRecordFilter = function(pRecordIdFieldToIgnore, pRecordIdValueToIgnore, pTargetEntity) { let ignoreFilterJson = JSON.stringify({"entity":pTargetEntity,"filter":{"type":"group","operator":"AND","childs":[{"type":"row","name":pRecordIdFieldToIgnore,"operator":"NOT_EQUAL","value":pRecordIdValueToIgnore,"key":"","contenttype":"TEXT"}]}}); -- GitLab