001    /*
002     * Copyright 1999-2001,2004 The Apache Software Foundation.
003     * 
004     * Licensed under the Apache License, Version 2.0 (the "License");
005     * you may not use this file except in compliance with the License.
006     * You may obtain a copy of the License at
007     * 
008     *      http://www.apache.org/licenses/LICENSE-2.0
009     * 
010     * Unless required by applicable law or agreed to in writing, software
011     * distributed under the License is distributed on an "AS IS" BASIS,
012     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013     * See the License for the specific language governing permissions and
014     * limitations under the License.
015     */ 
016    
017    package org.apache.commons.workflow;
018    
019    
020    /**
021     * <p><strong>Owner</strong> represents the common characteristics of Activities
022     * and Blocks (that is, Steps that allow nested Steps, such as those that
023     * implementat conditionals and iteration).</p>
024     *
025     * @version $Revision: 155475 $ $Date: 2005-02-26 13:31:11 +0000 (Sat, 26 Feb 2005) $
026     * @author Craig R. McClanahan
027     */
028    
029    public interface Owner {
030    
031    
032        // ------------------------------------------------------------- Properties
033    
034    
035        /**
036         * Return the first Step associated with this Activity or Block.
037         */
038        public Step getFirstStep();
039    
040    
041        /**
042         * Return the last Step associated with this Activity or Block.
043         */
044        public Step getLastStep();
045    
046    
047        // --------------------------------------------------------- Public Methods
048    
049    
050        /**
051         * Add a new Step to the end of the sequence of Steps associated with
052         * this Activity or Block.
053         *
054         * @param step The new step to be added
055         */
056        public void addStep(Step step);
057    
058    
059        /**
060         * Clear any existing Steps associated with this Activity or Block.
061         */
062        public void clearSteps();
063    
064    
065        /**
066         * Return the identified Step from our current Activity or Block,
067         * if it exists.  Otherwise, return <code>null</code>.
068         *
069         * @param id Identifier of the desired Step
070         */
071        public Step findStep(String id);
072    
073    
074        /**
075         * Return the set of Steps associated with this Activity or Block.
076         */
077        public Step[] getSteps();
078    
079    
080        /**
081         * Set the set of Steps associated with this Activity or Block,
082         * replacing any existing ones.
083         *
084         * @param steps The new set of steps.
085         */
086        public void setSteps(Step steps[]);
087    
088    
089    }