comparison 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
comparison
equal deleted inserted replaced
613:f20b65c1ebf3 614:e80e37b78302
140 target, XPATH_TARGET_NAME, ArtifactNamespaceContext.INSTANCE 140 target, XPATH_TARGET_NAME, ArtifactNamespaceContext.INSTANCE
141 ); 141 );
142 142
143 // no current state... 143 // no current state...
144 if (current == null) { 144 if (current == null) {
145 log.debug("No current state. Advance not possible."); 145 log.warn("No current state. Advance not possible.");
146 146
147 result = createReport( 147 result = createReport(
148 result, 148 result,
149 "exceptionreport", 149 "exceptionreport",
150 "exception", 150 "exception",
158 158
159 try { 159 try {
160 160
161 // step forward 161 // step forward
162 if (isStateCurrentlyReachable(targetState)) { 162 if (isStateCurrentlyReachable(targetState)) {
163
163 next = states.get(targetState); 164 next = states.get(targetState);
164 165
165 // 2. Transfer Results 166 // 2. Transfer Results
166 next.putInputData(current.getInputData(), identifier); 167 next.putInputData(current.getInputData(), identifier);
167 next.setParent(current); 168 next.setParent(current);
183 } 184 }
184 185
185 // step backward 186 // step backward
186 else if((next = getPreviousState(current, targetState)) != null) { 187 else if((next = getPreviousState(current, targetState)) != null) {
187 188
188 // reset input data
189 resetFutureStates(current, targetState);
190
191 // remove data from future states from cache
192 resetDescribeData(current, identifier, targetState);
193
194 if (current != null) { 189 if (current != null) {
195 current.endOfLife(context.globalContext()); 190 current.endOfLife(context.globalContext());
196 } 191 }
197 192
198 current = next; 193 current = next;
194
195 // 2. Transfer Results
196 current.reset(identifier);
199 197
200 result = createReport( 198 result = createReport(
201 result, "result", "success", "Advance success" 199 result, "result", "success", "Advance success"
202 ); 200 );
203 } 201 }
620 618
621 // add future states 619 // add future states
622 Iterator<Transition> transitions = this.transitions.iterator(); 620 Iterator<Transition> transitions = this.transitions.iterator();
623 while (transitions.hasNext()) { 621 while (transitions.hasNext()) {
624 Transition tmpTransition = transitions.next(); 622 Transition tmpTransition = transitions.next();
625 if (tmpTransition.getFrom().equals(current.getID()) && 623 if (tmpTransition.getFrom().equals(current.getID()) &&
626 tmpTransition.isValid(this.current)){ 624 tmpTransition.isValid(this.current)){
627 Element currentNode = creator.create("state"); 625 Element currentNode = creator.create("state");
628 creator.addAttr(currentNode, "name", tmpTransition.getTo()); 626 creator.addAttr(currentNode, "name", tmpTransition.getTo());
629 creator.addAttr( 627 creator.addAttr(
630 currentNode, 628 currentNode,

http://dive4elements.wald.intevation.org