diff --git a/office-alexander-logistics-app/src/main/java/com/alexanderlogistics/ZahlungsavisExportAdapter.java b/office-alexander-logistics-app/src/main/java/com/alexanderlogistics/ZahlungsavisExportAdapter.java index f3240e2..965af71 100644 --- a/office-alexander-logistics-app/src/main/java/com/alexanderlogistics/ZahlungsavisExportAdapter.java +++ b/office-alexander-logistics-app/src/main/java/com/alexanderlogistics/ZahlungsavisExportAdapter.java @@ -5,6 +5,7 @@ import java.util.logging.Logger; import javax.inject.Inject; +import org.imixs.archive.core.SnapshotService; import org.imixs.workflow.FileData; import org.imixs.workflow.ItemCollection; import org.imixs.workflow.SignalAdapter; @@ -41,6 +42,9 @@ public class ZahlungsavisExportAdapter implements SignalAdapter { @Inject DocumentService documentService; + @Inject + SnapshotService snapshotService; + /** * This method finds or create the Zahlungsavis and adds a reference * ($workitemref) to the current invoice. @@ -81,12 +85,7 @@ public class ZahlungsavisExportAdapter implements SignalAdapter { } // load the text block - FileData fileData = null; - ItemCollection textBlockItemCollection = loadTextBlock(textblockRef); - if (textBlockItemCollection != null) { - // fetch attachment - fileData = textBlockItemCollection.getFileData(template); - } + FileData fileData = loadTextBlockFileData(textblockRef, template); // do we found the document? if (fileData == null) { @@ -107,17 +106,20 @@ public class ZahlungsavisExportAdapter implements SignalAdapter { * * */ - public ItemCollection loadTextBlock(String name) { + public FileData loadTextBlockFileData(String name, String fileName) { ItemCollection textBlockItemCollection = null; // load text-block by name.... String sQuery = "(type:\"" + TYPE_TEXTBLOCK + "\" AND txtname:\"" + name + "\")"; Collection col; try { + // find the textblock... col = documentService.find(sQuery, 1, 0); - if (col.size() > 0) { textBlockItemCollection = col.iterator().next(); + // fetch the fileData... + return snapshotService.getWorkItemFile(textBlockItemCollection.getUniqueID(), fileName); + } else { logger.warning("Missing text-block : '" + name + "'"); } @@ -125,7 +127,7 @@ public class ZahlungsavisExportAdapter implements SignalAdapter { logger.warning("getTextBlock - invalid query: " + e.getMessage()); } - return textBlockItemCollection; + return null; } } \ No newline at end of file diff --git a/reports/zahlungsavis/zahlungsavis_template.xls b/reports/zahlungsavis/zahlungsavis_template.xls index ee512eb..5a1569c 100644 Binary files a/reports/zahlungsavis/zahlungsavis_template.xls and b/reports/zahlungsavis/zahlungsavis_template.xls differ diff --git a/reports/zahlungsavis/zahlungsavis_template_neu.xls b/reports/zahlungsavis/zahlungsavis_template_neu.xls new file mode 100644 index 0000000..f0a20ca Binary files /dev/null and b/reports/zahlungsavis/zahlungsavis_template_neu.xls differ diff --git a/reports/zahlungsavis/zahlungsavis_template_old.xls b/reports/zahlungsavis/zahlungsavis_template_old.xls new file mode 100644 index 0000000..759732a Binary files /dev/null and b/reports/zahlungsavis/zahlungsavis_template_old.xls differ diff --git a/workflow/zahlungsavis-1.0.0.bpmn b/workflow/zahlungsavis-1.0.0.bpmn index c7ce522..0c36575 100644 --- a/workflow/zahlungsavis-1.0.0.bpmn +++ b/workflow/zahlungsavis-1.0.0.bpmn @@ -178,6 +178,7 @@ result.isValid=true; $workflowgroup - $workflowstatus]]> SequenceFlow_2 SequenceFlow_6 + SequenceFlow_3 SequenceFlow_10 @@ -482,6 +483,77 @@ result.isValid=true; + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Zahlugnsavis Template + zahlungsavis_template.xls]]> + + + + + + $editor.]]> + + + false + + + + SequenceFlow_3 + + + DataOutput_2 + + + DataOutput_2 + + + + Ein Zahlungsavis enthält eine Liste von zugeordneten Rechnungen (item '$workitemref') @@ -593,6 +665,12 @@ Eine Rechnung wird über die Adapter Klasse 'ZahlungsavisAdapter' eingefügt. + + + + + + @@ -672,6 +750,12 @@ Eine Rechnung wird über die Adapter Klasse 'ZahlungsavisAdapter' eingefügt. + + + + + +