diff gnv-artifacts/src/main/java/de/intevation/gnv/artifacts/GNVArtifactBase.java @ 194:00c1a931b9c3

Catch Exception that the Calling Program could not put no InputData into the feed Request.issue56 gnv-artifacts/trunk@244 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Tim Englich <tim.englich@intevation.de>
date Mon, 19 Oct 2009 12:18:08 +0000
parents 7fb9441dd8af
children 734ac082c8d1
line wrap: on
line diff
--- a/gnv-artifacts/src/main/java/de/intevation/gnv/artifacts/GNVArtifactBase.java	Mon Oct 19 12:06:48 2009 +0000
+++ b/gnv-artifacts/src/main/java/de/intevation/gnv/artifacts/GNVArtifactBase.java	Mon Oct 19 12:18:08 2009 +0000
@@ -181,10 +181,18 @@
             if (this.current != null) {
                 String uuid = Config.getStringXPath(target,
                         "action/uuid/@value");
-                this.current.putInputData(this.parseInputData(target,
-                        "/action/data/input"), uuid);
-                result = new ArtifactXMLUtilities().createSuccessReport(
-                        "Feed success", XMLUtils.newDocument());
+                Collection<InputData> inputData = this.parseInputData(target,
+                                                                      "/action/data/input");
+                if (!inputData.isEmpty()){
+                    this.current.putInputData(inputData, uuid);
+                    result = new ArtifactXMLUtilities().createSuccessReport(
+                            "Feed success", XMLUtils.newDocument());
+                }else{
+                    String msg = "No Inputdata given. Please select at least one Entry.";
+                    log.warn(msg);
+                    result = new ArtifactXMLUtilities().createExceptionReport(msg,
+                            XMLUtils.newDocument());
+                }
             } else {
                 String msg = "No Transition instantiated";
                 log.warn(msg);

http://dive4elements.wald.intevation.org