comparison artifact-database/src/main/java/de/intevation/artifactdatabase/transition/Transition.java @ 257:8c2b6cdf22ad

Modified Transition.isValid() - added the artifact and the current state to the parameter list. artifacts/trunk@1758 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Thu, 28 Apr 2011 10:30:30 +0000
parents 26bfff409dd3
children
comparison
equal deleted inserted replaced
256:55d08706ccf2 257:8c2b6cdf22ad
1 package de.intevation.artifactdatabase.transition; 1 package de.intevation.artifactdatabase.transition;
2
3 import org.w3c.dom.Node;
4
5 import de.intevation.artifacts.Artifact;
2 6
3 import de.intevation.artifactdatabase.state.State; 7 import de.intevation.artifactdatabase.state.State;
4 8
5 9
6 /** 10 /**
7 * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a> 11 * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a>
8 */ 12 */
9 public interface Transition { 13 public interface Transition {
14
15 /**
16 * Initializes the transition.
17 *
18 * @param config The configuration node for the transition.
19 */
20 public void init(Node config);
10 21
11 /** 22 /**
12 * Return the ID of the start State. 23 * Return the ID of the start State.
13 */ 24 */
14 public String getFrom(); 25 public String getFrom();
31 * @param to The ID of the target state. 42 * @param to The ID of the target state.
32 */ 43 */
33 public void setTo(String to); 44 public void setTo(String to);
34 45
35 /** 46 /**
36 * Determines if the transition from <code>state</code> is valid. 47 * Determines if its valid to step from state <i>a</i> of an artifact
48 * <i>artifact</i> to state <i>b</i>.
49 *
50 * @param artifact The owner artifact of state a and b.
51 * @param a The current state.
52 * @param b The target state.
53 *
54 * @return true, if it is valid to step from a to b, otherwise false.
37 */ 55 */
38 public boolean isValid(State state); 56 public boolean isValid(Artifact artifact, State a, State b);
39 } 57 }
40 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : 58 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :

http://dive4elements.wald.intevation.org