diff --git a/.vscode/launch.json b/.vscode/launch.json index 609ddd4..0bb97db 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -3,10 +3,11 @@ "configurations": [ { "type": "java", - "name": "Debug Wildfly", + "name": "Debug AGL", "request": "attach", "hostName": "localhost", - "port": "8787" + "port": "8787", + "projectName": "office-alexander-logistics-app" } -] -} + ] +} \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml index 177f240..24876d8 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -43,6 +43,8 @@ services: #ML_TRAINING_SCHEDULER_ENABLED: "true" #ML_TRAINING_SCHEDULER_INTERVAL: "10000" #ML_TRAINING_SCHEDULER_INITIALDELAY: "30000" + LLM_SERVICE_ENDPOINT_USER: "admin" + LLM_SERVICE_ENDPOINT_PASSWORD: "imixs4.null" ports: - "8080:8080" diff --git a/reports/sepa/result_sepa01.xml b/reports/sepa/result_sepa01.xml index 5bb7d6d..98249c1 100644 --- a/reports/sepa/result_sepa01.xml +++ b/reports/sepa/result_sepa01.xml @@ -6,7 +6,7 @@ bf073e72asdf512c4d60af7740872036 - 2024-07-11T14:29:56 + 2024-07-25T19:03:13 3 655.90 @@ -23,7 +23,7 @@ SEPA - 2024-07-11 + 2024-07-25 Targo Bank diff --git a/reports/sepa/result_sepa02.xml b/reports/sepa/result_sepa02.xml index 208c6c6..d0b81a2 100644 --- a/reports/sepa/result_sepa02.xml +++ b/reports/sepa/result_sepa02.xml @@ -6,7 +6,7 @@ bf073e72asdf512c4d60af7740872036 - 2024-07-11T14:29:57 + 2024-07-25T19:03:14 3 655.90 @@ -23,7 +23,7 @@ SEPA - 2024-07-11 + 2024-07-25 Targo Bank diff --git a/workflow/posteingang-de-2.0.0.bpmn b/workflow/posteingang-de-2.0.0.bpmn new file mode 100644 index 0000000..4f0ec5b --- /dev/null +++ b/workflow/posteingang-de-2.0.0.bpmn @@ -0,0 +1,1668 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + + + + + + + + + For the OCR Adapter the following minimal options should be set: + + * X-Tika-PDFocrStrategy=OCR_AND_TEXT_EXTRACTION + * X-Tika-OCRLanguage=eng+deu + +These options allow OCR and text extraction suporting English and German language. + +Additional Tika Options can be set but are NOT needed in most cases: + + * X-Tika-PDFOcrImageType=RGB (setting the RGB color mode) + * X-Tika-PDFOcrDPI=400 (setting DPI) + +Setting the OcrDPI is only recommended if the DPI is know! + +Possible ImageTypes are: + + * ARGB Alpha, Red, Green, Blue + * BINARY Black or white. + * GRAY Shades of gray + * RGB Red, Green, Blue + + + + + + + + BoundaryEvent_1 + Task_4 + IntermediateCatchEvent_2 + Task_2 + IntermediateCatchEvent_3 + StartEvent_1 + EndEvent_1 + + dataObject_FS1r0Q + task_uB6BGQ + event_1Vp9Fg + textAnnotation_CtU05A + task_PsBytg + dataObject_CRa7xA + event_HhuoiQ + event_bYlo0w + event_za0KnA + event_Zxhr0w + dataObject_vVKXIg + event_esmWYg + event_yQLmNA + task_0YaQ2w + dataObject_HHM58Q + event_xOeBKg + event_pDFoXg + dataObject_ZhBiZg + event_4DNGzg + dataObject_KPUiiw + event_wmNwPA + event_tFxV0w + + + + + + + + + + + + _subject]]> + + + + + + + + + _amount (Brutto € _amount_brutto) +_description]]> + + + + + + + + + + + + + + + + + + + + + + + + + + + home +]]> + + + + + + + + + + + + false + + + + sequenceFlow_fRPOrw + sequenceFlow_4gpPgw + + + + sequenceFlow_fRPOrw + + + + + + + + + + + + + + + + + true + + + + + + + + Rechnungseingangskontrolle +

Der Workflow 'Rechnungseingang' beschreibt beispielhaft einen Ablauf zur Prüfung von Eingangsrechnungen.

+ +

    +
  • Nach Erhalt einer Rechnung (z.B. Post, E-Mail, Fax,...) wird diese in das Workflowsystem übertragen und der Prozess Rechnungseingang gestartet.
  • + +
  • Die Rechnung wird wahlweise eingescannt und über den Abschnitt 'Dokumente' an den Vorgang hinzugefügt.
  • + +
  • In diesem Beispiel wird die Rechnung einem zuvor ausgewählten Mitarbeiter zur Prüfung vorgelegt.
  • + +
  • Nach positiver Prüfung werden die Rechnungsdaten (Zahlungsziel, Bankverbindung) vom Controlling im System erfasst und auf das Zahlungsziel gewartet.
  • + +
  • Nach Erreichen des Zahlungsziels wird der Vorgang automatisch dem Controlling erneut zur abschließenden Bearbeitung vorgelegt.
  • + +
+

Der Workflow

+ +

Eingangsrechnungen können über eine E-Mailschnittstelle oder das Filesystem automatisch eingelesen werden. Eine Eingangsrechnung wird in diesem Beispiel vom zugewiesenen Mitarbeiter sowie den Prozessverantworltichen (Controlling) bearbeitet.

]]>
+ SequenceFlow_9 + sequenceFlow_4gpPgw +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +X-Tika-OCRLanguage=eng+deu +X-Tika-PDFocrStrategy=OCR_ONLY +(PDF|pdf)$ +10]]> + + + + + + + + + + + + false + + + + SequenceFlow_9 + SequenceFlow_2 + + + DataOutput_1 + + + DataOutput_1 + + + sequenceFlow_VlPVJg + + + + + + + + txtlastcomment]]> + + + + + + + + + + + + + + + + + + + + + + + + cdtr.name (invoice.language)]]> + + + $workflowgroup - $workflowstatus]]> + SequenceFlow_12 + sequenceFlow_zA065w + sequenceFlow_gXJm0w + + + SequenceFlow_12 + + + + + + + SequenceFlow_2 + + 1000 + + + + + + + + + + +]]> + + + + + + + + + + + + + + + + + true + + + + + + + + + sequenceFlow_30s7vA + sequenceFlow_VlPVJg + sequenceFlow_0N8cOQ + sequenceFlow_fN22Gg + + + + + + + + + + + _subject]]> + + + + + + + + + _amount (Brutto € _amount_brutto) +_description]]> + + + + + + + + + + + + + + + + + + + + + + + + + + + home]]> + + + + + + + + + + + + false + + + + sequenceFlow_30s7vA + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + cdtr.name (invoice.language)]]> + + + true + + + + + + + + document.type
+Company: document.company
]]>
+
+
+ + sequenceFlow_JpNUKg + sequenceFlow_Fdk05g + sequenceFlow_lmU9IA + sequenceFlow_naZnAA + sequenceFlow_8SpIiA +
+ + + + + + + + + + + + +]]> + + + + + + + + + + + + + + _subject]]> + + + + + + + + + _amount (Brutto € _amount_brutto) +_description]]> + + + + + + + + + + + + + + + + + + + + + + + + + + + home]]> + + + + + + + + + + + + false + + + + sequenceFlow_Fdk05g + + + + + + + + + + + + + + _subject]]> + + + + + + + + + _amount (Brutto € _amount_brutto) +_description]]> + + + + + + + + + + + + + + + + + + + + + + + + + + + home]]> + + + + + + + + + + + + false + + + + sequenceFlow_lmU9IA + sequenceFlow_Od65ZQ + + + + + sequenceFlow_Od65ZQ + + + + sequenceFlow_0N8cOQ + + + + + + + + + + + + + + + + + + +]]> + + + + + + + + + + + _subject]]> + + + + + + + + + _amount (Brutto € _amount_brutto) +_description]]> + + + + + + + + + + + + + + + + + + + + + + + + + + + home]]> + + + + + + + + + + + + false + + + + sequenceFlow_zA065w + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + false + + + + https://llama.cpp.imixs.com/ + XML + + +]]> + + + + + + DataOutput_2 + + + DataOutput_2 + + + sequenceFlow_aC0skQ + sequenceFlow_YMtfiw + + + + + + + + + + + + + + cdtr.name (invoice.language)]]> + + + true + + + + + + + + + sequenceFlow_JpNUKg + sequenceFlow_lmU9IA + sequenceFlow_aC0skQ + sequenceFlow_A62nqQ + sequenceFlow_z8jotQ + + + + + + + + + + + {"max_tokens": 4096, "temperature": 0 } + invoice.summary + +[INST]Transfer the invoice data into an XML object with the following structure: + + + ... + ... + 2024-12-31 + 2024-12-31 + 1234.00 + ... + ... + + +Create only the XML object. Use only the XML structure specified in this example and do not create any other XML tags. Don't create explanations or comments. +Format date values (invoice.date, payment.date) into the ISO 8601 format (YYYY-MM-DD). +Format numbers and amounts (type="double") according to ISO 4217. + +Transfer the individual invoice data to the XML tags, taking into account the following suggestions for mapping: + + - Company name ==> "cdtr.name" + + - Invoice number ==> "invoice.number" + - Invoice Date ==> "invoice.date" + - Total ==> "invoice.total" + + - IBAN ==> "cdtr.iban" + - BIC or SWIFT ==> "cdtr.bic" + - Payment date / Due date ==> "payment.date" + +<> + +[/INST] + +]]]]> + + ]]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + false + + + + rechnungseingang-de-1.2 + 5000 + 990 + +]]> + + + + + + DataOutput_2 + + + DataOutput_2 + + sequenceFlow_YMtfiw + sequenceFlow_gXJm0w + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + false + + + + https://llama.cpp.imixs.com/ + XML + + + +]]> + + + + + + DataOutput_2 + + + DataOutput_2 + + + sequenceFlow_fN22Gg + sequenceFlow_naZnAA + + + + + {"n_predict": 2048, "temperature": 0 } + ^.+\.([pP][dD][fF])$ + +[INST] Assign the invoice to one of the following categories: + +- Cargo-Invoice - in case the invoice is about cargo and logistic services +- Credit - in case of a credit note +- Invoice - in all other cases + +Extract also the company name and the language the invoice is written in. + +Note: The company name is the name of the company that issued the invoice document, not the recipient. The company name is usually at the beginning or end of the invoice document. + +Output the infromation as an XML object that has the following structure: + + + Type + Kraxi GmbH + German + + +Note: Do not generate any other information instead of the XML object. + +[/INST] +]]]]> + + ]]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + false + + + + https://llama.cpp.imixs.com/ + invoice.summary + +document.company + +]]> + + + + + + DataOutput_2 + + + DataOutput_2 + + + sequenceFlow_8SpIiA + sequenceFlow_A62nqQ + + + + + + + + + + + {"max_tokens": 4096, "temperature": 0 } + ^.+\.([pP][dD][fF])$ + +[INST] + +Summarize the data from this invoice document: + + - Company information + - General Billing data + - Invoice total information + - Payment summary + - Invoice items + +The company name is the name of the company that issued the invoice document, not the recipient. The company name is usually at the beginning or end of the invoice document. + +Summarize the invoice lines in a table. +Use only the default values and do not perform any calculations, summing or changes to these values yourself. Format numbers and amounts according to ISO 4217. + +[/INST] +]]]]> + + ]]> + + + + + + + + + + + + + + _subject]]> + + + + + + + + + _amount (Brutto € _amount_brutto) +_description]]> + + + + + + + + + + + + + + + + + + + + + + + + + + + home]]> + + + + + + + + + + + + false + + + + sequenceFlow_z8jotQ + sequenceFlow_7ywCdA + + + + + sequenceFlow_7ywCdA + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
diff --git a/workflow/prompts/categorize_EN.xml b/workflow/prompts/categorize_EN.xml new file mode 100644 index 0000000..4b49f8f --- /dev/null +++ b/workflow/prompts/categorize_EN.xml @@ -0,0 +1,31 @@ + + + {"n_predict": 2048, "temperature": 0 } + ^.+\.([pP][dD][fF])$ + +[INST] Assign the invoice to one of the following categories: + +- Cargo-Invoice - in case the invoice is about cargo and logistic services +- Credit - in case of a credit note +- Invoice - in all other cases + +Extract also the company name and the language the invoice is written in. + +Note: The company name is the name of the company that issued the invoice document, not the recipient. The company name is usually at the beginning or end of the invoice document. + +Output the infromation as an XML object that has the following structure: + + + Type + Kraxi GmbH + German + + +Note: Do not generate any other information instead of the XML object. + +[/INST] +]]> + + \ No newline at end of file diff --git a/workflow/prompts/deprecated/categorize_DE.xml b/workflow/prompts/deprecated/categorize_DE.xml new file mode 100644 index 0000000..57d6e90 --- /dev/null +++ b/workflow/prompts/deprecated/categorize_DE.xml @@ -0,0 +1,27 @@ + + + {"n_predict": 2048, "temperature": 0 } + ^.+\.([pP][dD][fF])$ + +[INST] Ordne das Dokument einer der folgenden Kategorien zu: + + - Eingangsrechnung + - Anfrage + - Bestellung + - Vertrag + +Gib die Information als XML-Objekt aus, welches die folgende Struktur aufweist: + + + type + Firma + + +Beachte: Generiere keine weiteren Informationen die nicht Teil des XML Objekts sind. + +[/INST] +]]> + + \ No newline at end of file diff --git a/workflow/prompts/deprecated/invoice-extract-DE.xml b/workflow/prompts/deprecated/invoice-extract-DE.xml new file mode 100644 index 0000000..0febd28 --- /dev/null +++ b/workflow/prompts/deprecated/invoice-extract-DE.xml @@ -0,0 +1,67 @@ + + + {"max_tokens": 4096, "temperature": 0 } + invoice.summary + +[INST]Übertrage die Rechnungsdaten in ein XML Objekt mit der folgenden Struktur: + + + ... + ... + 2024-12-31 + 2024-12-31 + 1234.00 + ... + ... + + ... + ... + ... + 0.00 + 0.00 + + + ... + ... + ... + 0.00 + 0.00 + + + + +Erstelle nur das XML Objekt. Verwende nur die in diesem Beispiel XML angegebenen Struktur und erzeuge keine anderen XML Tags. Erstelle keine Erklärungen oder Kommentare. +Formatiere Datums Werte (invoice.date, payment.date) im ISO 8601 Format (YYYY-MM-DD). +Formatiere Zahlen und Beträge (type="double") nach ISO 4217. + + +Übertrage die einzelnen Rechnugsdaten unter berücksichtigung der folgenden Vorschläge für ein Mapping auf die XML Tags: + + - Firmenname ==> "cdtr.name" + + - Rechnungsnummer / Beleg-Nr ==> "invoice.number" + - Rechnungsdatum / Datum ==> "invoice.date" + - Betrag / Gesamtsumme / Rechnungssummme / Brutto ==> "invoice.total" + + - IBAN ==> "cdtr.iban" + - BIC oder SWIFT ==> "cdtr.bic" + - Zahlungsdatum / Zahlbar bis ==> "payment.date" + +(Die Zahlungsinformationen können mehrere IBAN und BIC Nummern für unterschiedliche Banken enthalten. Erstelle in diesem Fall eine Liste.) + +** "invoice.positions" + - Auftragsnummer / Bestellnummer / Kunden-Referenz ==> "order" + - Leistungsart, Beschreibung ==> "description" + - Kostenart ==> "costtype" + - Gesamtpreis der Einzelleistung ==> "total" + - Steuer (falls angegeben) ==> "tax" + +<> + +[/INST] + +]]> + + \ No newline at end of file diff --git a/workflow/prompts/deprecated/invoice-summarize-DE.xml b/workflow/prompts/deprecated/invoice-summarize-DE.xml new file mode 100644 index 0000000..c0a9d89 --- /dev/null +++ b/workflow/prompts/deprecated/invoice-summarize-DE.xml @@ -0,0 +1,26 @@ + + + {"max_tokens": 4096, "temperature": 0 } + ^.+\.([pP][dD][fF])$ + +[INST] + +Fasse die Daten aus diesem Rechnungsdokument zusammen: + + - Firmendaten + - Rechnungsdaten + - Rechnungssumme + - Zahlungsinformationen + - Rechnungspositionen + +Der Firmenname ist der Name des Unternehmens, das den Rechnungsbeleg ausgestellt hat, nicht der Empfänger. Der Firmenname steht in der Regel am Anfang oder Ende des Rechnungsbelegs. + +Fasse die Rechnungspositionen in einer Tabelle zusammen. +Verwende ausschließlich die vorgegebenen Werte und führe keinerlei Berechnungen, Summenbildung oder Änderungen an diesen Werten selbst durch. Formatiere Zahlen und Beträge nach ISO 4217. + +[/INST] +]]> + + \ No newline at end of file diff --git a/workflow/prompts/invoice-extract-EN.xml b/workflow/prompts/invoice-extract-EN.xml new file mode 100644 index 0000000..88c97c9 --- /dev/null +++ b/workflow/prompts/invoice-extract-EN.xml @@ -0,0 +1,42 @@ + + + {"max_tokens": 4096, "temperature": 0 } + invoice.summary + +[INST]Transfer the invoice data into an XML object with the following structure: + + + ... + ... + 2024-12-31 + 2024-12-31 + 1234.00 + ... + ... + + +Create only the XML object. Use only the XML structure specified in this example and do not create any other XML tags. Don't create explanations or comments. +Format date values (invoice.date, payment.date) into the ISO 8601 format (YYYY-MM-DD). +Format numbers and amounts (type="double") according to ISO 4217. + +Transfer the individual invoice data to the XML tags, taking into account the following suggestions for mapping: + + - Company name ==> "cdtr.name" + + - Invoice number ==> "invoice.number" + - Invoice Date ==> "invoice.date" + - Total ==> "invoice.total" + + - IBAN ==> "cdtr.iban" + - BIC or SWIFT ==> "cdtr.bic" + - Payment date / Due date ==> "payment.date" + +<> + +[/INST] + +]]> + + \ No newline at end of file diff --git a/workflow/prompts/invoice-summarize-EN.xml b/workflow/prompts/invoice-summarize-EN.xml new file mode 100644 index 0000000..4ee31bd --- /dev/null +++ b/workflow/prompts/invoice-summarize-EN.xml @@ -0,0 +1,26 @@ + + + {"max_tokens": 4096, "temperature": 0 } + ^.+\.([pP][dD][fF])$ + +[INST] + +Summarize the data from this invoice document: + + - Company information + - General Billing data + - Invoice total information + - Payment summary + - Invoice items + +The company name is the name of the company that issued the invoice document, not the recipient. The company name is usually at the beginning or end of the invoice document. + +Summarize the invoice lines in a table. +Use only the default values and do not perform any calculations, summing or changes to these values yourself. Format numbers and amounts according to ISO 4217. + +[/INST] +]]> + + \ No newline at end of file diff --git a/workflow/rechnungseingang-de-1.2.39.bpmn b/workflow/rechnungseingang-de-1.2.39.bpmn index c60fe07..44425ae 100644 --- a/workflow/rechnungseingang-de-1.2.39.bpmn +++ b/workflow/rechnungseingang-de-1.2.39.bpmn @@ -806,27 +806,16 @@ result.isValid=true; SequenceFlow_20 - - - - - - - - - + + + + + - - - + + - - - - - - ]]> @@ -5453,7 +5442,7 @@ result.isValid=true; - + @@ -5484,7 +5473,7 @@ result.isValid=true; - + @@ -5497,11 +5486,12 @@ result.isValid=true; - - posteingang-de-1.0 - 100 - 20 - ]]> + false + + posteingang-de-2.0 + 120 + 1 +]]>