View Javadoc

1   /*
2    * Copyright 1999-2001,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  package org.apache.commons.workflow;
18  
19  
20  /**
21   * <p>A <strong>Step</strong> represents a single executable action that
22   * can occur during the completion of an Activity.  The dynamic execution
23   * of the implementation of this Step happens within the <code>execute()</code>
24   * method -- everything else about a Step is part of its static definition,
25   * which is shared among all users of the owning Activity.</p>
26   *
27   * @version $Revision: 155475 $ $Date: 2005-02-26 13:31:11 +0000 (Sat, 26 Feb 2005) $
28   * @author Craig R. McClanahan
29   */
30  
31  public interface Step {
32  
33  
34      // ------------------------------------------------------------- Properties
35  
36  
37      /**
38       * Return the unique identifier (within this Activity) of this Step.
39       */
40      public String getId();
41  
42  
43      /**
44       * Set the unique identifier (within this Activity) of this Step.
45       *
46       * @param id The new unique identifier
47       */
48      public void setId(String id);
49  
50  
51      /**
52       * Return the next Step in our associated Activity or Block.
53       */
54      public Step getNextStep();
55  
56  
57      /**
58       * Set the next Step in our associated Activity or Block.
59       *
60       * @param nextStep The new next Step
61       */
62      public void setNextStep(Step nextStep);
63  
64  
65      /**
66       * Return the Activity or Block that owns this Step.
67       */
68      public Owner getOwner();
69  
70  
71      /**
72       * Set the Activity or Block that owns this Step.
73       *
74       * @param owner The new owning Activity or Block
75       */
76      public void setOwner(Owner owner);
77  
78  
79      /**
80       * Return the previous Step in our associated Activity or Block.
81       */
82      public Step getPreviousStep();
83  
84  
85      /**
86       * Set the previous Step in our associated Activity or Block.
87       *
88       * @param previousStep The new previous Step
89       */
90      public void setPreviousStep(Step previousStep);
91  
92  
93      // --------------------------------------------------------- Public Methods
94  
95  
96      /**
97       * Perform the executable actions related to this Step, in the context of
98       * the specified Context.
99       *
100      * @param context The Context that is tracking our execution state
101      *
102      * @exception StepException if a processing error has occurred
103      */
104     public void execute(Context context) throws StepException;
105 
106 
107 }