KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > lenya > workflow > Transition


1 /*
2  * Copyright 1999-2004 The Apache Software Foundation
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  *
16  */

17
18 /* $Id: Transition.java 42598 2004-03-01 16:18:28Z gregor $ */
19
20 package org.apache.lenya.workflow;
21
22
23 /**
24  * <p>
25  * A transition describes the switching of a workflow instance
26  * from one state to another. A transition has
27  * </p>
28  *
29  * <ul>
30  * <li>a source state,</li>
31  * <li>a destination state,</li>
32  * <li>an event,</li>
33  * <li>a set of conditions,</li>
34  * <li>a set of assignments.</li>
35  * </ul>
36  *
37  * <p>
38  * Additionally, a transition can be marked as synchronized.
39  * </p>
40  */

41 public interface Transition {
42     
43     /**
44      * Returns the event of this transition.
45      *
46      * @return the event
47      */

48     Event getEvent();
49
50     /**
51      * Returns the actions of this transition.
52      *
53      * @return the actions
54      */

55     Action[] getActions();
56
57     /**
58      * Returns if the transition can fire in a certain situation.
59      *
60      * @param situation the situation for which the query is requested.
61      * @param instance The workflow instance to invoke the transition on.
62      *
63      * @return true if the transition can fire in the given situation.
64      * @throws WorkflowException when an error occurs.
65      */

66     boolean canFire(Situation situation, WorkflowInstance instance) throws WorkflowException;
67     
68     /**
69      * Returns if this transition is synchronized.
70      * @return A boolean value.
71      */

72     boolean isSynchronized();
73 }
74
Popular Tags