update
This commit is contained in:
parent
bb5f453be8
commit
cf9bfd952b
1 changed files with 20 additions and 16 deletions
|
|
@ -13,8 +13,8 @@ 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.
|
||||
* Konkret geht es darum, das im Status 5200 in den ChildItems keine leeren
|
||||
* Zeilen vorkommen dürfen.
|
||||
*
|
||||
* @author rsoika
|
||||
* @version 1.0
|
||||
|
|
@ -30,28 +30,32 @@ public class InvoicePlugin extends AbstractPlugin {
|
|||
/**
|
||||
* Test childworkitems for empty lines
|
||||
*
|
||||
* @throws PluginException - if txtCooperateSpace not filled.
|
||||
* @throws PluginException - if data is missing
|
||||
*
|
||||
**/
|
||||
@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!");
|
||||
}
|
||||
// die prüfung der positionsnummern erfolgt nur im Status 5200 !
|
||||
if (workitem.getTaskID() == 5200) {
|
||||
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!");
|
||||
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;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue