diff --git a/entity/Contact_entity/Contact_entity.aod b/entity/Contact_entity/Contact_entity.aod index 53ca53c9dbbb6e2af03dbeca581fb0767c1c5069..41a386bd8dce1d009f4b1887e118adb79b9165cc 100644 --- a/entity/Contact_entity/Contact_entity.aod +++ b/entity/Contact_entity/Contact_entity.aod @@ -263,6 +263,7 @@ <fromClauseProcess>%aditoprj%/entity/Contact_entity/recordcontainers/db/fromClauseProcess.js</fromClauseProcess> <conditionProcess>%aditoprj%/entity/Contact_entity/recordcontainers/db/conditionProcess.js</conditionProcess> <orderClauseProcess>%aditoprj%/entity/Contact_entity/recordcontainers/db/orderClauseProcess.js</orderClauseProcess> + <onDBDelete>%aditoprj%/entity/Contact_entity/recordcontainers/db/onDBDelete.js</onDBDelete> <linkInformation> <linkInformation> <name>86ded52f-1b55-4d3d-b89d-23c465f20566</name> diff --git a/entity/Contact_entity/recordcontainers/db/onDBDelete.js b/entity/Contact_entity/recordcontainers/db/onDBDelete.js new file mode 100644 index 0000000000000000000000000000000000000000..db41811d78df66c7f51a6c63749bdeae91f7f26f --- /dev/null +++ b/entity/Contact_entity/recordcontainers/db/onDBDelete.js @@ -0,0 +1,18 @@ +import("Sql_lib"); +import("Context_lib"); +import("Attribute_lib"); +import("Workflow_lib"); +import("system.vars"); +import("DuplicateScanner_lib"); + +var contactId = vars.get("$field.CONTACTID"); +DuplicateScannerUtils.DeleteCachedDuplicate(contactId); + +new AttributeRelationQuery(contactId, null, ContextUtils.getCurrentContextId()) + .deleteAllAttributes(); + +newWhere("COMMUNICATION.CONTACT_ID", contactId).deleteData(); +newWhere("ADDRESS.CONTACT_ID", contactId).deleteData(); +newWhere("COMMRESTRICTION.CONTACT_ID", contactId).deleteData(); + +WorkflowSignalSender.deleted(); \ No newline at end of file diff --git a/entity/Person_entity/recordcontainers/db/onDBDelete.js b/entity/Person_entity/recordcontainers/db/onDBDelete.js index c6f452b97cadd9aa9ab20a4f13e1c2ec9319546b..db41811d78df66c7f51a6c63749bdeae91f7f26f 100644 --- a/entity/Person_entity/recordcontainers/db/onDBDelete.js +++ b/entity/Person_entity/recordcontainers/db/onDBDelete.js @@ -4,8 +4,8 @@ import("Attribute_lib"); import("Workflow_lib"); import("system.vars"); import("DuplicateScanner_lib"); -// TODO: enable when duplicate-module is finalized -let contactId = vars.get("$field.CONTACTID"); + +var contactId = vars.get("$field.CONTACTID"); DuplicateScannerUtils.DeleteCachedDuplicate(contactId); new AttributeRelationQuery(contactId, null, ContextUtils.getCurrentContextId())