comparison flys-artifacts/src/main/java/de/intevation/flys/artifacts/WINFOArtifact.java @ 355:d97982627596

Bugfixes: Adapted a broken method call of TransitionEngine.isStateReachable() and added the outputs of a current state to the DESCRIBE. flys-artifacts/trunk@1762 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Thu, 28 Apr 2011 11:20:11 +0000
parents 35301cc3b875
children d79a51fc4f1d
comparison
equal deleted inserted replaced
354:542f280d72c3 355:d97982627596
73 73
74 TransitionEngine transitionEngine = (TransitionEngine) flysContext.get( 74 TransitionEngine transitionEngine = (TransitionEngine) flysContext.get(
75 FLYSContext.TRANSITION_ENGINE_KEY); 75 FLYSContext.TRANSITION_ENGINE_KEY);
76 76
77 List<State> reachable = transitionEngine.getReachableStates( 77 List<State> reachable = transitionEngine.getReachableStates(
78 getCurrentState(context), stateEngine); 78 this, getCurrentState(context), stateEngine);
79 79
80 Document description = XMLUtils.newDocument(); 80 Document description = XMLUtils.newDocument();
81 XMLUtils.ElementCreator creator = new XMLUtils.ElementCreator( 81 XMLUtils.ElementCreator creator = new XMLUtils.ElementCreator(
82 description, 82 description,
83 ArtifactNamespaceContext.NAMESPACE_URI, 83 ArtifactNamespaceContext.NAMESPACE_URI,
167 } 167 }
168 168
169 ProtocolUtils.appendOutputModes(creator, outs, list); 169 ProtocolUtils.appendOutputModes(creator, outs, list);
170 } 170 }
171 171
172 // TODO If the current state is already filled with data, the output is 172 try {
173 // available as well! So we need some code to append the outputs of the 173 DefaultState cur = (DefaultState) getCurrentState(context);
174 // current already filled state. 174 if (cur.validate(this, context)) {
175 List<Output> list = cur.getOutputs();
176 if (list != null && list.size() > 0) {
177 logger.debug(
178 "Append output modes for state: " + cur.getID());
179
180 ProtocolUtils.appendOutputModes(creator, outs, list);
181 }
182 }
183 }
184 catch (IllegalArgumentException iae) {
185 // state is not valid, so we do not append its outputs.
186 }
175 } 187 }
176 188
177 189
178 /** 190 /**
179 * This method appends the static data - that has already been inserted by 191 * This method appends the static data - that has already been inserted by

http://dive4elements.wald.intevation.org