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>A <strong>Step</strong> represents a single executable action that
022     * can occur during the completion of an Activity.  The dynamic execution
023     * of the implementation of this Step happens within the <code>execute()</code>
024     * method -- everything else about a Step is part of its static definition,
025     * which is shared among all users of the owning Activity.</p>
026     *
027     * @version $Revision: 155475 $ $Date: 2005-02-26 13:31:11 +0000 (Sat, 26 Feb 2005) $
028     * @author Craig R. McClanahan
029     */
030    
031    public interface Step {
032    
033    
034        // ------------------------------------------------------------- Properties
035    
036    
037        /**
038         * Return the unique identifier (within this Activity) of this Step.
039         */
040        public String getId();
041    
042    
043        /**
044         * Set the unique identifier (within this Activity) of this Step.
045         *
046         * @param id The new unique identifier
047         */
048        public void setId(String id);
049    
050    
051        /**
052         * Return the next Step in our associated Activity or Block.
053         */
054        public Step getNextStep();
055    
056    
057        /**
058         * Set the next Step in our associated Activity or Block.
059         *
060         * @param nextStep The new next Step
061         */
062        public void setNextStep(Step nextStep);
063    
064    
065        /**
066         * Return the Activity or Block that owns this Step.
067         */
068        public Owner getOwner();
069    
070    
071        /**
072         * Set the Activity or Block that owns this Step.
073         *
074         * @param owner The new owning Activity or Block
075         */
076        public void setOwner(Owner owner);
077    
078    
079        /**
080         * Return the previous Step in our associated Activity or Block.
081         */
082        public Step getPreviousStep();
083    
084    
085        /**
086         * Set the previous Step in our associated Activity or Block.
087         *
088         * @param previousStep The new previous Step
089         */
090        public void setPreviousStep(Step previousStep);
091    
092    
093        // --------------------------------------------------------- Public Methods
094    
095    
096        /**
097         * Perform the executable actions related to this Step, in the context of
098         * the specified Context.
099         *
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    }