diff flys-artifacts/src/main/java/de/intevation/flys/artifacts/FLYSArtifact.java @ 624:929137ee8154

ISSUE-62 (part I/II) States are no longer filled with data - if a state needs user input, it needs to query the owner artifact. flys-artifacts/trunk@1982 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Mon, 23 May 2011 15:11:55 +0000
parents aa64fe4df8ab
children 833290f16f09
line wrap: on
line diff
--- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/FLYSArtifact.java	Mon May 23 14:32:17 2011 +0000
+++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/FLYSArtifact.java	Mon May 23 15:11:55 2011 +0000
@@ -370,41 +370,8 @@
             }
         }
 
-        State current           = getCurrentState(context);
-        DefaultState toValidate = (DefaultState) fillState(current);
-
-        toValidate.validate(this, context);
-    }
-
-
-    /**
-     * This method fills a state object with the data that have been inserted to
-     * this artifact. This is necessary to use the isStateReachable() method,
-     * because the Transitions need to know about the inserted data.
-     *
-     * @param state The state that needs to be filled with data.
-     *
-     * @return the filled state.
-     */
-    protected State fillState(State state) {
-        Map<String, StateData> stateData = state.getData();
-
-        if (stateData == null) {
-            return state;
-        }
-
-        Set<String>                 keys = stateData.keySet();
-
-        for (String key: keys) {
-            StateData tmp = getData(key);
-
-            if (tmp != null) {
-                StateData data = stateData.get(key);
-                data.setValue(tmp.getValue());
-            }
-        }
-
-        return state;
+        DefaultState current = (DefaultState) getCurrentState(context);
+        current.validate(this, context);
     }
 
 
@@ -424,7 +391,7 @@
 
         FLYSContext flysContext = getFlysContext(context);
 
-        State currentState  = fillState(getCurrentState(context));
+        State currentState  = getCurrentState(context);
         StateEngine sEngine = (StateEngine) flysContext.get(
             FLYSContext.STATE_ENGINE_KEY);
 

http://dive4elements.wald.intevation.org