diff --git a/office-alexander-logistics-app/src/main/java/com/alexanderlogistics/BusinessPartnerService.java b/office-alexander-logistics-app/src/main/java/com/alexanderlogistics/BusinessPartnerService.java index a18f938..172310c 100644 --- a/office-alexander-logistics-app/src/main/java/com/alexanderlogistics/BusinessPartnerService.java +++ b/office-alexander-logistics-app/src/main/java/com/alexanderlogistics/BusinessPartnerService.java @@ -287,6 +287,7 @@ public class BusinessPartnerService { // phrase = LuceneSearchService.escapeSearchTerm(phrase); phrase = schemaService.normalizeSearchTerm(phrase); String sQuery = "(type:\"workitem\" OR type:\"workitemarchive\") AND ($modelversion:businesspartner-*)"; + sQuery += " AND NOT ($taskid:1800) "; // ist nur eine Zahl eingegeben worden? if (isCargosoftNumber(phrase)) { diff --git a/office-alexander-logistics-app/src/main/java/com/alexanderlogistics/api/CargosoftMigrationRestService.java b/office-alexander-logistics-app/src/main/java/com/alexanderlogistics/api/CargosoftMigrationRestService.java index 295de04..209fe66 100644 --- a/office-alexander-logistics-app/src/main/java/com/alexanderlogistics/api/CargosoftMigrationRestService.java +++ b/office-alexander-logistics-app/src/main/java/com/alexanderlogistics/api/CargosoftMigrationRestService.java @@ -158,7 +158,7 @@ public class CargosoftMigrationRestService implements Serializable { for (ItemCollection cargosoftItemCol : cargosoftDataList) { totalObjects++; - if (businessPartnerImportService.syncCargosoftCreditorBusinessPartner(cargosoftItemCol) == true) { + if (businessPartnerImportService.syncCargosoftBusinessPartner(cargosoftItemCol) == true) { updateService.updateIndex(); syncs++; if (syncs >= maxcount) diff --git a/office-alexander-logistics-app/src/main/java/com/alexanderlogistics/xml/BusinessPartnerImportService.java b/office-alexander-logistics-app/src/main/java/com/alexanderlogistics/xml/BusinessPartnerImportService.java index 65bd65d..f7af57e 100644 --- a/office-alexander-logistics-app/src/main/java/com/alexanderlogistics/xml/BusinessPartnerImportService.java +++ b/office-alexander-logistics-app/src/main/java/com/alexanderlogistics/xml/BusinessPartnerImportService.java @@ -122,22 +122,39 @@ public class BusinessPartnerImportService { if (event == null || event.getDocument() == null) { return; } + // run only if we have the model 'businesspartner-*'; + if (modelService.findVersionsByRegEx("(businesspartner*)").size() == 0) { + // no business partner workflow found + return; + } + // check source - if (event.getEventType() == DocumentEvent.ON_DOCUMENT_SAVE - && "cargosoftkreditor".equals(event.getDocument().getType())) { + if ("cargosoftkreditor".equals(event.getDocument().getType())) { - // set NOSNAPSHOT=true fro cargosoft item (migration) - event.getDocument().setItemValue(SnapshotService.NOSNAPSHOT, true); - - // run only if we have the model 'businesspartner-*'; - if (modelService.findVersionsByRegEx("(businesspartner*)").size() == 0) { - // no business partner workflow found - return; + if (event.getEventType() == DocumentEvent.ON_DOCUMENT_SAVE) { + // set NOSNAPSHOT=true fro cargosoft item (migration) + event.getDocument().setItemValue(SnapshotService.NOSNAPSHOT, true); + logger.fine("Verify business partner object...."); + ItemCollection importDoc = event.getDocument(); + syncCargosoftBusinessPartner(importDoc); } - logger.fine("Verify business partner object...."); - ItemCollection importDoc = event.getDocument(); - syncCargosoftCreditorBusinessPartner(importDoc); + if (event.getEventType() == DocumentEvent.ON_DOCUMENT_DELETE) { + ItemCollection importDoc = event.getDocument(); + String cargosoftID = importDoc.getItemValueString("name"); + String partnerID = InvoiceUtil.buildBPID(cargosoftID); + ItemCollection businesspartner = lookupBusinessPartner(partnerID); + if (businesspartner != null) { + logger.info("lock business partner object...."); + try { + businesspartner.setEventID(80); + workflowService.processWorkItemByNewTransaction(businesspartner); + } catch (AccessDeniedException | ProcessingErrorException | PluginException | ModelException e) { + logger.warning( + "Failed to lock Business Partner Object " + cargosoftID + " - " + e.getMessage()); + } + } + } } } @@ -156,7 +173,7 @@ public class BusinessPartnerImportService { * * @param creditor */ - public boolean syncCargosoftCreditorBusinessPartner(ItemCollection importDoc) { + public boolean syncCargosoftBusinessPartner(ItemCollection importDoc) { String cargosoftID = importDoc.getItemValueString("name"); // K bedeutet Kreditor D bedeutet Debitor - beides kann vorkommen boolean isCreditor = cargosoftID.toUpperCase().startsWith("K"); diff --git a/workflow/businesspartner-de-1.0.2.bpmn b/workflow/businesspartner-de-1.0.2.bpmn new file mode 100644 index 0000000..7977a6d --- /dev/null +++ b/workflow/businesspartner-de-1.0.2.bpmn @@ -0,0 +1,1107 @@ + + + + + + + association_83sZPw + + + + true + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + task_ToMZaQ + event_WmkBvw + event_1clvlg + task_Q80A1Q + task_B8Pi7A + event_aSdkwg + event_Tr0aug + dataObject_UQIXAQ + event_vwH0cA + textAnnotation_LyGTCw + event_TuyuwQ + event_h0Kk5g + task_delO7Q + event_1OVorA + event_baWU4w + event_ofjVfg + event_i7yQVw + gateway_uK0c6g + event_6250fg + task_NohgrQ + event_AMs05g + event_feLZFQ + event_GTXFMw + event_u8OBFg + gateway_whpM0w + event_Idvwtg + event_8yN0uw + gateway_Kjobpw + event_pYaI6A + event_00CWpg + textAnnotation_pSbYVQ + event_AOFZ0A + event_4A016g + + + + + + + + + + + + + + + + + + + + + + sequenceFlow_25otUg + sequenceFlow_S9LVXg + + + + sequenceFlow_25otUg + + + + sequenceFlow_rwdWxw + + + + + + + + + + + partner.name (partner.id)]]> + + + Adresse:
+partner.name
+partner.address
+partner.zip partner.city
+
+ +BPID: partner.id
+Kreditoren-Nr.: cdtr.number
+Debitoren-Nr.: dbtr.number
+]]>
+
+ + + + + + + + + + + + + + + + + + +
+ + sequenceFlow_avahXg + sequenceFlow_9atLFA + sequenceFlow_b4BcVA + sequenceFlow_03b60w + sequenceFlow_0Icsbw + sequenceFlow_e8q82w +
+ + + + partner.name (partner.id)]]> + + + + + + Adresse:
+partner.name
+partner.address
+partner.zip partner.city
+
+ +BPID: partner.id
+Kreditoren-Nr.: cdtr.number
+Debitoren-Nr.: dbtr.number
+]]>
+
+ + + + + + + + + + + + + + + + + + +
+ + sequenceFlow_1mXO8A + sequenceFlow_rwdWxw + sequenceFlow_kS2fMA + sequenceFlow_djXRgw +
+ + + + + + + + + + Partnermanagement]]> + + + + sequenceFlow_jAU3VA + sequenceFlow_8O1EtQ + + + + + + + + + + + home]]> + + + + + + + sequenceFlow_1mXO8A + sequenceFlow_X4XnjQ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +]]> + + + + sequenceFlow_avahXg + + + + + + + + + + + + + + + + + + + + + + + + + + sequenceFlow_9atLFA + + + + + + + + + + + + + + + sequenceFlow_djXRgw + sequenceFlow_gC0I9w + + + + + + + + + + + partner.name (partner.id)]]> + + + Adresse:
+partner.name
+partner.address
+partner.zip partner.city
+
+ +BPID: partner.id
+Kreditoren-Nr.: cdtr.number
+Debitoren-Nr.: dbtr.number
+]]>
+
+ + + + + + + + + + + + + + + + + + + + + +
+ + sequenceFlow_NNbMhg + sequenceFlow_avahXg + sequenceFlow_pvIENQ + sequenceFlow_BWOtzA + sequenceFlow_ofWWuw + sequenceFlow_b0Bj3Q + sequenceFlow_BHsRkQ +
+ + + + + + + + + + Partnermanagement]]> + + + + sequenceFlow_BHsRkQ + sequenceFlow_5pT4Tw + + + + + + + + home]]> + + + + + + + + + + + + + + + + + + + sequenceFlow_pvIENQ + sequenceFlow_b4BcVA + + + + + + + + + + + + + + + + + + sequenceFlow_BWOtzA + + + + + + + + Partnermanagement]]> + + + + + + + sequenceFlow_ofWWuw + + + + + + + + + + sequenceFlow_S9LVXg + sequenceFlow_jAU3VA + sequenceFlow_8BTEtw + + + + + + + + + + + + + + + + sequenceFlow_kS2fMA + + + + + + + + + + + partner.name (partner.id)]]> + + + Adresse:
+partner.name
+partner.address
+partner.zip partner.city
+
+ +BPID: partner.id
+Kreditoren-Nr.: cdtr.number
+Debitoren-Nr.: dbtr.number
+]]>
+
+ + + + + + + + + + + + + + + + + + +
+ + sequenceFlow_9atLFA + sequenceFlow_8O1EtQ + sequenceFlow_neSsFQ + sequenceFlow_zd6RWA + sequenceFlow_8O1EtQ + sequenceFlow_Zl0LZA + sequenceFlow_BbA3Gg + sequenceFlow_3SU0Xw + sequenceFlow_gC0I9w +
+ + + + + + + sequenceFlow_5pT4Tw + + + + + sequenceFlow_8BTEtw + + + + + + + + + + + sequenceFlow_OwZZBw + + + + + + + + sequenceFlow_zd6RWA + + + + + + + sequenceFlow_b0Bj3Q + sequenceFlow_neSsFQ + sequenceFlow_DC7n0g + sequenceFlow_X4XnjQ + + + + + + + + + + + + + + + sequenceFlow_Zl0LZA + sequenceFlow_0Icsbw + + + + + + + + + + + + + + home]]> + + + + + + + + + + + + + + + + + + + sequenceFlow_RkjrPQ + + sequenceFlow_b0d63g + + + + sequenceFlow_03b60w + sequenceFlow_OwZZBw + sequenceFlow_RkjrPQ + sequenceFlow_DC7n0g + + + + + + + + + + + sequenceFlow_b0d63g + + + + + + + + sequenceFlow_BbA3Gg + + + + + + + + + + + + + + + + + + + + + + sequenceFlow_3SU0Xw + + + + + + + + + mahnlauf-de-1.0 + 1000 + 10 + partner.id,partner.name,dbtr.number,dbtr.mail,partner.name|dbtr.name + /pages/workitems/workitem.jsf?id=$uniqueid +]]> + + + + + + + + + + + sequenceFlow_e8q82w + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
diff --git a/workflow/businesspartner-en-1.0.1.bpmn b/workflow/businesspartner-en-1.0.1.bpmn new file mode 100644 index 0000000..b081d72 --- /dev/null +++ b/workflow/businesspartner-en-1.0.1.bpmn @@ -0,0 +1,1162 @@ + + + + + + + association_83sZPw + + + + true + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + task_ToMZaQ + event_WmkBvw + event_1clvlg + task_Q80A1Q + task_B8Pi7A + event_aSdkwg + event_Tr0aug + dataObject_UQIXAQ + event_vwH0cA + textAnnotation_LyGTCw + event_TuyuwQ + event_h0Kk5g + task_delO7Q + event_1OVorA + event_baWU4w + event_ofjVfg + event_i7yQVw + gateway_uK0c6g + event_6250fg + task_NohgrQ + event_AMs05g + event_feLZFQ + event_GTXFMw + event_u8OBFg + gateway_ERhYvA + event_RsEmoA + gateway_Sg02EQ + event_0vmPSg + event_ZYEq8w + textAnnotation_fFO8tQ + event_kT136g + event_jkHxJA + event_zzWQSA + event_k4Ms1Q + + + + + + + + + + + + + + + + + + + + + + sequenceFlow_25otUg + sequenceFlow_S9LVXg + + + + sequenceFlow_25otUg + + + + sequenceFlow_rwdWxw + + + + + + + + + + + partner.name (partner.id)]]> + + + Adresse:
+partner.name
+partner.address
+partner.zip partner.city
+
+ +BPID: partner.id
+Kreditoren-Nr.: cdtr.number
+Debitoren-Nr.: dbtr.number
+]]>
+
+ + + + + + + + + + + + + + + + + + +
+ $workflowgroup - $workflowstatus]]> + sequenceFlow_avahXg + sequenceFlow_9atLFA + sequenceFlow_b4BcVA + sequenceFlow_03b60w + sequenceFlow_u8PLGw + sequenceFlow_ZTiO7w + sequenceFlow_gIdPow +
+ + + + partner.name (partner.id)]]> + + + + + + Adresse:
+partner.name
+partner.address
+partner.zip partner.city
+
+ +BPID: partner.id
+Kreditoren-Nr.: cdtr.number
+Debitoren-Nr.: dbtr.number
+]]>
+
+ + + + + + + + + + + + + + + + + + +
+ $workflowgroup - $workflowstatus]]> + sequenceFlow_rwdWxw + sequenceFlow_kS2fMA + sequenceFlow_Hrl9Qg + sequenceFlow_8pEpIg +
+ + + + + + + + + + Partnermanagement]]> + + + + sequenceFlow_jAU3VA + sequenceFlow_8O1EtQ + + + + + + + + + + + home]]> + + + + + + + sequenceFlow_neSsFQ + sequenceFlow_Hrl9Qg + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +]]> + + + + sequenceFlow_avahXg + + + + + + + + + + + + + + + + + + + + + + + + + + + + + sequenceFlow_9atLFA + + + + + + + + + + + + + + + + + + sequenceFlow_8pEpIg + sequenceFlow_gC0I9w + + + + + + + + + + + partner.name (partner.id)]]> + + + Adresse:
+partner.name
+partner.address
+partner.zip partner.city
+
+ +BPID: partner.id
+Kreditoren-Nr.: cdtr.number
+Debitoren-Nr.: dbtr.number
+]]>
+
+ + + + + + + + + + + + + + + + + + + + + +
+ $workflowgroup - $workflowstatus]]> + sequenceFlow_NNbMhg + sequenceFlow_avahXg + sequenceFlow_pvIENQ + sequenceFlow_BWOtzA + sequenceFlow_ofWWuw + sequenceFlow_b0Bj3Q + sequenceFlow_BHsRkQ +
+ + + + + + + + + + Partnermanagement]]> + + + + sequenceFlow_BHsRkQ + sequenceFlow_5pT4Tw + + + + + + + + + + + home]]> + + + + sequenceFlow_pvIENQ + sequenceFlow_b4BcVA + + + + + + + + + + + + + + + + + + sequenceFlow_BWOtzA + + + + + + + + Partnermanagement]]> + + + + + + + sequenceFlow_ofWWuw + + + + + + + + + + sequenceFlow_S9LVXg + sequenceFlow_jAU3VA + sequenceFlow_8BTEtw + + + + + + + + + + + + + sequenceFlow_kS2fMA + + + + + + + + + + + partner.name (partner.id)]]> + + + Adresse:
+partner.name
+partner.address
+partner.zip partner.city
+
+ +BPID: partner.id
+Kreditoren-Nr.: cdtr.number
+Debitoren-Nr.: dbtr.number
+]]>
+
+ + + + + + + + + + + + + + + + + + +
+ $workflowgroup - $workflowstatus]]> + sequenceFlow_9atLFA + sequenceFlow_8O1EtQ + sequenceFlow_zd6RWA + sequenceFlow_8O1EtQ + sequenceFlow_u2Ftag + sequenceFlow_cqiAow + sequenceFlow_5iTFQQ + sequenceFlow_17NXNA + sequenceFlow_gC0I9w +
+ + + + + + + sequenceFlow_5pT4Tw + + + + + sequenceFlow_8BTEtw + + + + + + + + + + + sequenceFlow_oc3zTQ + + + + + + + + sequenceFlow_zd6RWA + + + + + + + + + + sequenceFlow_b0Bj3Q + sequenceFlow_58XZjA + sequenceFlow_neSsFQ + sequenceFlow_u2Ftag + + + + + + + + + + + + + + + + + + + + home]]> + + + + + + + + + + + + + + + + sequenceFlow_izMKCw + sequenceFlow_i0zvhQ + + + + + sequenceFlow_03b60w + sequenceFlow_oc3zTQ + sequenceFlow_izMKCw + sequenceFlow_58XZjA + + + + + + + + + + + sequenceFlow_i0zvhQ + + + + + sequenceFlow_cqiAow + + + + + + + + + + + + + + + + + + + + + + + + + + + + sequenceFlow_5iTFQQ + + + + + + + + + + + + sequenceFlow_17NXNA + sequenceFlow_u8PLGw + + + + + + + + + + + + + + + + + + mahnlauf-en-1.0 + 1000 + 10 + partner.id,partner.name,dbtr.number,dbtr.mail,partner.name|dbtr.name + /pages/workitems/workitem.jsf?id=$uniqueid +]]> + + + + + + + sequenceFlow_ZTiO7w + + + + + + + + + + + + + + + + SOA Template + + soa_dbtr.number_$lasteventdate.xlsx + + + F6 + $lasteventdate + date + + + A7 + partner.name +]]> + + + + + sequenceFlow_gIdPow + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +