From 1ed2abde55d414cbe5ed6b2824325d31f2f16cdc Mon Sep 17 00:00:00 2001
From: Ralph Soika
Date: Thu, 4 Apr 2024 16:57:19 +0200
Subject: [PATCH] internationalisierung datev-cargosoft import
---
.../datev/DatevCargosoftImportAdapter.java | 46 +-
workflow/datev-import-dwc-1.0.0.bpmn | 856 ++++
workflow/rechnungsausgang-dwc-1.0.0.bpmn | 3878 +++++++++++++++++
3 files changed, 4778 insertions(+), 2 deletions(-)
create mode 100644 workflow/datev-import-dwc-1.0.0.bpmn
create mode 100644 workflow/rechnungsausgang-dwc-1.0.0.bpmn
diff --git a/office-alexander-logistics-app/src/main/java/com/alexanderlogistics/datev/DatevCargosoftImportAdapter.java b/office-alexander-logistics-app/src/main/java/com/alexanderlogistics/datev/DatevCargosoftImportAdapter.java
index f48a487..e2bab9d 100644
--- a/office-alexander-logistics-app/src/main/java/com/alexanderlogistics/datev/DatevCargosoftImportAdapter.java
+++ b/office-alexander-logistics-app/src/main/java/com/alexanderlogistics/datev/DatevCargosoftImportAdapter.java
@@ -31,6 +31,7 @@ import org.imixs.workflow.exceptions.PluginException;
import org.imixs.workflow.exceptions.ProcessingErrorException;
import org.imixs.workflow.exceptions.QueryException;
+import com.alexanderlogistics.CargosoftSplitAdapter;
import com.alexanderlogistics.InvoiceUtil;
import com.alexanderlogistics.KreditorDebitorService;
@@ -86,6 +87,17 @@ import com.alexanderlogistics.KreditorDebitorService;
* Belegdatum vor diesem Datum (z.b. 01) wir das Jahr um 1 erhöht. Das
* Wirtschaftsjahr wird ignoriert.
*
+ * 4.4.2024
+ * ----
+ * Der Adapter prüft nun optional die Konfigurationsparameter
+ * - model
+ * - task
+ * - event
+ *
+ * rechnungseingang-dwc-1.0
+ * 1000
+ * 100
*
* @version 1.0
* @author rsoika
@@ -97,6 +109,7 @@ public class DatevCargosoftImportAdapter implements SignalAdapter {
public static final String ENCODING = "ISO-8859-1";
public static final String CHILD_ITEM_PROPERTY = "_ChildItems";
public static final String REGEX_IMPORTTEXTPATTERN = "^R[1-8] .*$";
+ public static final String CONFIG_ERROR = "CONFIG_ERROR";
@Inject
WorkflowService workflowService;
@@ -110,6 +123,12 @@ public class DatevCargosoftImportAdapter implements SignalAdapter {
@Inject
TeamService teamService;
+ private String INITIAL_MODEL_VERSION;
+
+ private int INITIAL_TASK_ID;
+
+ private int INITIAL_EVENT_ID;
+
/**
* This method finds or create the Datev Export and adds a reference
* ($workitemref) to the current invoice.
@@ -121,6 +140,30 @@ public class DatevCargosoftImportAdapter implements SignalAdapter {
throws AdapterException, PluginException {
logger.info("...parse datev file import...");
+
+ // read the cargosoft import options
+ // ("rechnungsausgang-de-1.0").task(5001).event(980);
+ ItemCollection evalItemCollection = workflowService.evalWorkflowResult(event, "datev-cargosoft-import",
+ workitem,
+ false);
+
+ if (evalItemCollection == null) {
+ throw new PluginException(CargosoftSplitAdapter.class.getSimpleName(), CONFIG_ERROR,
+ "missing datev-cargosoft-import configuration in model event - please check model configuration");
+ }
+ INITIAL_MODEL_VERSION = evalItemCollection.getItemValueString("model");
+ if (INITIAL_MODEL_VERSION.isEmpty()) {
+ INITIAL_MODEL_VERSION = "rechnungsausgang-de-1.0";
+ }
+ INITIAL_TASK_ID = evalItemCollection.getItemValueInteger("task");
+ if (INITIAL_TASK_ID == 0) {
+ INITIAL_TASK_ID = 5001;
+ }
+ INITIAL_EVENT_ID = evalItemCollection.getItemValueInteger("event");
+ if (INITIAL_EVENT_ID == 0) {
+ INITIAL_EVENT_ID = 980;
+ }
+
try {
// Datei einlesen
@@ -490,7 +533,6 @@ public class DatevCargosoftImportAdapter implements SignalAdapter {
for (Map.Entry> entry : spacePosMappings.entrySet()) {
List expressionsList = entry.getValue();
for (String expr : expressionsList) {
-
Pattern p = Pattern.compile(expr);
Matcher m = p.matcher(text);
if (m.find()) {
@@ -506,7 +548,7 @@ public class DatevCargosoftImportAdapter implements SignalAdapter {
}
}
// Processe die Invoice
- invoiceWorkitem.model("rechnungsausgang-de-1.0").task(5001).event(980);
+ invoiceWorkitem.model(INITIAL_MODEL_VERSION).task(INITIAL_TASK_ID).event(INITIAL_EVENT_ID);
workflowService.processWorkItem(invoiceWorkitem);
}
diff --git a/workflow/datev-import-dwc-1.0.0.bpmn b/workflow/datev-import-dwc-1.0.0.bpmn
new file mode 100644
index 0000000..173152b
--- /dev/null
+++ b/workflow/datev-import-dwc-1.0.0.bpmn
@@ -0,0 +1,856 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ application.urlindex.jsf?workitem=$uniqueid
+
+]]>
+
+
+ application.urlindex.jsf?workitem=$uniqueid
+
+]]>
+
+
+
+
+
+
+
+
+
+
+
+
+
+ StartEvent_1
+ Task_1
+ IntermediateCatchEvent_2
+ IntermediateCatchEvent_6
+ EndEvent_3
+ IntermediateCatchEvent_18
+ Task_2
+ ExclusiveGateway_1
+ Task_7
+ Task_6
+ IntermediateCatchEvent_5
+ ExclusiveGateway_2
+ ExclusiveGateway_3
+ IntermediateCatchEvent_7
+ IntermediateCatchEvent_3
+
+ textAnnotation_fL0dZg
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ home]]>
+
+
+
+
+
+
+
+
+ false
+
+
+
+
+
+ $editor]]>
+ SequenceFlow_13
+ SequenceFlow_15
+
+
+
+
+
+ SequenceFlow_6
+
+
+
+
+
+ $created]]>
+
+
+ true
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ $workflowgroup - $workflowstatus]]>
+ SequenceFlow_2
+ SequenceFlow_10
+
+
+
+
+
+ SequenceFlow_10
+ SequenceFlow_17
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ SequenceFlow_8
+ SequenceFlow_14
+
+
+ DataOutput_2
+
+
+ DataOutput_2
+
+
+
+
+
+
+ $created]]>
+
+
+
+
+
+
+
+
+
+
+
+ true
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ $workflowgroup - $workflowstatus]]>
+ SequenceFlow_6
+ SequenceFlow_8
+
+
+
+
+ $created]]>
+
+
+ true
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ $workflowgroup - $workflowstatus]]>
+ SequenceFlow_16
+ SequenceFlow_17
+
+
+
+
+
+ SequenceFlow_15
+ SequenceFlow_23
+ SequenceFlow_16
+
+
+
+
+
+
+
+
+ $created]]>
+
+
+ true
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ $workflowgroup - $workflowstatus]]>
+ SequenceFlow_12
+ SequenceFlow_22
+ SequenceFlow_28
+ SequenceFlow_13
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ home]]>
+
+
+
+
+
+
+
+
+ false
+
+
+
+ SequenceFlow_28
+ SequenceFlow_2
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ]]>
+
+
+
+
+
+
+
+
+
+
+
+ false
+
+
+
+ SequenceFlow_12
+
+
+
+
+
+
+
+
+
+
+
+ SequenceFlow_14
+ SequenceFlow_18
+ SequenceFlow_19
+ SequenceFlow_23
+
+
+
+
+
+
+
+
+
+
+
+ rechnungsausgang-dwc-1.0
+5001
+980]]>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ SequenceFlow_18
+ SequenceFlow_20
+
+
+ DataOutput_6
+
+
+ DataOutput_6
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ SequenceFlow_19
+ SequenceFlow_21
+
+
+
+ workitem['datev.formatname'][0]=="Buchungsstapel"
+
+
+
+ workitem['datev.formatname'][0]=="Kontenbeschriftungen"
+
+
+
+ SequenceFlow_20
+ SequenceFlow_21
+ SequenceFlow_22
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ The DATEV Import holds a DATEV Import file and triggeres a import process depending on the document type.
+
+
+
+
+
+
+ rechnungseingang-dwc-1.0
+5001
+980]]>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/workflow/rechnungsausgang-dwc-1.0.0.bpmn b/workflow/rechnungsausgang-dwc-1.0.0.bpmn
new file mode 100644
index 0000000..163ea5f
--- /dev/null
+++ b/workflow/rechnungsausgang-dwc-1.0.0.bpmn
@@ -0,0 +1,3878 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+$workflowstatus
+
+]]>
+
+
+ In case you have already made the payment, please disregard this notice. If you require any information regarding your account, please do not hesitate to contact us.
+Thank you for your cooperation.
+
+Kind regards
Alexander Global Logistics GmbH
+
+