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><strong>Owner</strong> represents the common characteristics of Activities
22   * and Blocks (that is, Steps that allow nested Steps, such as those that
23   * implementat conditionals and iteration).</p>
24   *
25   * @version $Revision: 155475 $ $Date: 2005-02-26 13:31:11 +0000 (Sat, 26 Feb 2005) $
26   * @author Craig R. McClanahan
27   */
28  
29  public interface Owner {
30  
31  
32      // ------------------------------------------------------------- Properties
33  
34  
35      /**
36       * Return the first Step associated with this Activity or Block.
37       */
38      public Step getFirstStep();
39  
40  
41      /**
42       * Return the last Step associated with this Activity or Block.
43       */
44      public Step getLastStep();
45  
46  
47      // --------------------------------------------------------- Public Methods
48  
49  
50      /**
51       * Add a new Step to the end of the sequence of Steps associated with
52       * this Activity or Block.
53       *
54       * @param step The new step to be added
55       */
56      public void addStep(Step step);
57  
58  
59      /**
60       * Clear any existing Steps associated with this Activity or Block.
61       */
62      public void clearSteps();
63  
64  
65      /**
66       * Return the identified Step from our current Activity or Block,
67       * if it exists.  Otherwise, return <code>null</code>.
68       *
69       * @param id Identifier of the desired Step
70       */
71      public Step findStep(String id);
72  
73  
74      /**
75       * Return the set of Steps associated with this Activity or Block.
76       */
77      public Step[] getSteps();
78  
79  
80      /**
81       * Set the set of Steps associated with this Activity or Block,
82       * replacing any existing ones.
83       *
84       * @param steps The new set of steps.
85       */
86      public void setSteps(Step steps[]);
87  
88  
89  }