diff gnv-artifacts/src/main/java/de/intevation/gnv/artifacts/GNVArtifactBase.java @ 614:e80e37b78302

Repaired broken step-back-history. gnv-artifacts/trunk@684 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Fri, 12 Feb 2010 11:16:37 +0000
parents 292fbcd5e9ac
children 61f688a69a55
line wrap: on
line diff
--- a/gnv-artifacts/src/main/java/de/intevation/gnv/artifacts/GNVArtifactBase.java	Fri Feb 12 09:17:21 2010 +0000
+++ b/gnv-artifacts/src/main/java/de/intevation/gnv/artifacts/GNVArtifactBase.java	Fri Feb 12 11:16:37 2010 +0000
@@ -142,7 +142,7 @@
 
         // no current state...
         if (current == null) {
-            log.debug("No current state. Advance not possible.");
+            log.warn("No current state. Advance not possible.");
 
             result = createReport(
                 result,
@@ -160,6 +160,7 @@
 
             // step forward
             if (isStateCurrentlyReachable(targetState)) {
+
                 next = states.get(targetState);
 
                 // 2. Transfer Results
@@ -185,18 +186,15 @@
             // step backward
             else if((next = getPreviousState(current, targetState)) != null) {
 
-                // reset input data
-                resetFutureStates(current, targetState);
-
-                // remove data from future states from cache
-                resetDescribeData(current, identifier, targetState);
-
                 if (current != null) {
                     current.endOfLife(context.globalContext());
                 }
 
                 current = next;
 
+                // 2. Transfer Results
+                current.reset(identifier);
+
                 result = createReport(
                     result, "result", "success", "Advance success"
                 );
@@ -622,7 +620,7 @@
             Iterator<Transition> transitions = this.transitions.iterator();
             while (transitions.hasNext()) {
                 Transition tmpTransition = transitions.next();
-                if (tmpTransition.getFrom().equals(current.getID()) && 
+                if (tmpTransition.getFrom().equals(current.getID()) &&
                     tmpTransition.isValid(this.current)){
                     Element currentNode = creator.create("state");
                     creator.addAttr(currentNode, "name", tmpTransition.getTo());

http://dive4elements.wald.intevation.org