fixes und validierung Positionstabelle
This commit is contained in:
parent
fa43757d94
commit
bb5f453be8
4 changed files with 3179 additions and 4 deletions
|
|
@ -0,0 +1,75 @@
|
|||
package com.alexanderlogistics;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import org.imixs.workflow.ItemCollection;
|
||||
import org.imixs.workflow.engine.plugins.AbstractPlugin;
|
||||
import org.imixs.workflow.exceptions.PluginException;
|
||||
|
||||
/**
|
||||
* Das InvoicePlugin prüft die Eingaben auf gültigkeit, so dass diese problemlos
|
||||
* nach Cargosoft expoertier werden können.
|
||||
* <p>
|
||||
* Konkret geht es darum, das in den ChildItems keine leeren Zeilen vorkommen
|
||||
* dürfen.
|
||||
*
|
||||
* @author rsoika
|
||||
* @version 1.0
|
||||
*
|
||||
*/
|
||||
public class InvoicePlugin extends AbstractPlugin {
|
||||
public static final String CHILD_ITEM_PROPERTY = "_ChildItems";
|
||||
public static final String ERROR_MISSING_DATA = "MISSING_DATA";
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
private static Logger logger = Logger.getLogger(InvoicePlugin.class.getName());
|
||||
|
||||
/**
|
||||
* Test childworkitems for empty lines
|
||||
*
|
||||
* @throws PluginException - if txtCooperateSpace not filled.
|
||||
*
|
||||
**/
|
||||
@Override
|
||||
public ItemCollection run(ItemCollection workitem, ItemCollection documentActivity) throws PluginException {
|
||||
|
||||
List<ItemCollection> childs = explodeChildList(workitem);
|
||||
for (ItemCollection posItem : childs) {
|
||||
if (posItem.getItemValueString("name").trim().isEmpty()) {
|
||||
// throw a plugin exception - because name is missing!
|
||||
throw new PluginException(InvoicePlugin.class.getName(), ERROR_MISSING_DATA,
|
||||
"Eingabefehler - Die Positionsnummer in Zeile " + posItem.getItemValueString("numpos")
|
||||
+ " muss aufgefüllt sein!");
|
||||
}
|
||||
|
||||
if (posItem.getItemValueFloat("amount") == 0) {
|
||||
// throw a plugin exception - because name is missing!
|
||||
throw new PluginException(InvoicePlugin.class.getName(), ERROR_MISSING_DATA,
|
||||
"Eingabefehler - Der Nettobetrag in in Zeile " + posItem.getItemValueString("numpos")
|
||||
+ " darf nicht 0 sein!");
|
||||
}
|
||||
}
|
||||
return workitem;
|
||||
}
|
||||
|
||||
/**
|
||||
* converts the Map List of a workitem into a List of ItemCollectons
|
||||
*/
|
||||
@SuppressWarnings({ "rawtypes", "unchecked" })
|
||||
protected List<ItemCollection> explodeChildList(ItemCollection workitem) {
|
||||
// convert current list of childItems into ItemCollection elements
|
||||
ArrayList<ItemCollection> childItems = new ArrayList<ItemCollection>();
|
||||
|
||||
List<Object> mapOrderItems = workitem.getItemValue(CHILD_ITEM_PROPERTY);
|
||||
for (Object mapOderItem : mapOrderItems) {
|
||||
if (mapOderItem instanceof Map) {
|
||||
ItemCollection itemCol = new ItemCollection((Map) mapOderItem);
|
||||
childItems.add(itemCol);
|
||||
}
|
||||
}
|
||||
return childItems;
|
||||
}
|
||||
}
|
||||
4
pom.xml
4
pom.xml
|
|
@ -17,9 +17,9 @@
|
|||
<!-- <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
because of resource filtering is enabled we can not use UTF-8 for some strange
|
||||
reasons. When setting sourceEncoding to ISO-8859-1 the special german charcters
|
||||
works fine -->
|
||||
works fine
|
||||
<project.build.sourceEncoding>ISO-8859-1</project.build.sourceEncoding>
|
||||
|
||||
-->
|
||||
<!-- Build Time -->
|
||||
<org.imixs.build.timestamp>${maven.build.timestamp}</org.imixs.build.timestamp>
|
||||
<maven.build.timestamp.format>yyyyMMddHHmmss</maven.build.timestamp.format>
|
||||
|
|
|
|||
|
|
@ -328,6 +328,9 @@ Das ist eine automatische generierte E-Mail. Bitte nicht auf diese E-Mail antwor
|
|||
<imixs:item name="txtactivityresult" type="CDATA">
|
||||
<imixs:value><![CDATA[]]></imixs:value>
|
||||
</imixs:item>
|
||||
<imixs:item name="keypublicresult" type="xs:string">
|
||||
<imixs:value><![CDATA[0]]></imixs:value>
|
||||
</imixs:item>
|
||||
</bpmn2:extensionElements>
|
||||
<bpmn2:incoming>SequenceFlow_38</bpmn2:incoming>
|
||||
<bpmn2:outgoing>SequenceFlow_24</bpmn2:outgoing>
|
||||
|
|
@ -405,7 +408,7 @@ Das ist eine automatische generierte E-Mail. Bitte nicht auf diese E-Mail antwor
|
|||
<imixs:value><![CDATA[2]]></imixs:value>
|
||||
</imixs:item>
|
||||
<imixs:item name="keypublicresult" type="xs:string">
|
||||
<imixs:value><![CDATA[1]]></imixs:value>
|
||||
<imixs:value><![CDATA[0]]></imixs:value>
|
||||
</imixs:item>
|
||||
<imixs:item name="keylogdateformat" type="xs:string">
|
||||
<imixs:value><![CDATA[2]]></imixs:value>
|
||||
|
|
|
|||
3097
workflow/rechnungseingang-de-1.0.2.bpmn
Normal file
3097
workflow/rechnungseingang-de-1.0.2.bpmn
Normal file
File diff suppressed because it is too large
Load diff
Loading…
Reference in a new issue