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: Workflow.java 42598 2004-03-01 16:18:28Z gregor $ */ 19 20 package org.apache.lenya.workflow; 21 22 /** 23 * <p>A workflow schema.</p> 24 * <p> 25 * A workflow schema defines a state machine (deterministic finite 26 * automaton - DFA), consisting of 27 * </p> 28 * <ul> 29 * <li>states, including a marked initial state,</li> 30 * <li>transitions, and</li> 31 * <li>state variables.</li> 32 */ 33 public interface Workflow { 34 String NAMESPACE = "http://apache.org/cocoon/lenya/workflow/1.0"; 35 String DEFAULT_PREFIX = "wf"; 36 37 /** 38 * Returns the initial state of this workflow. 39 * @return The initial state 40 */ 41 State getInitialState(); 42 43 /** 44 * Returns the transitions that leave a state. 45 * This method is used, e.g., to disable menu items. 46 * @param state A state. 47 * @return The transitions that leave the state. 48 */ 49 Transition[] getLeavingTransitions(State state); 50 51 /** 52 * Returns the variable names. 53 * @return A string array. 54 */ 55 String[] getVariableNames(); 56 } 57