KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > mr > core > util > patterns > flow > Flow


1 package org.mr.core.util.patterns.flow;
2
3 import java.util.Map JavaDoc;
4
5 /*
6  * Copyright 2002 by
7  * <a HREF="http://www.coridan.com">Coridan</a>
8  * <a HREF="mailto: support@coridan.com ">support@coridan.com</a>
9  *
10  * The contents of this file are subject to the Mozilla Public License Version
11  * 1.1 (the "License"); you may not use this file except in compliance with the
12  * License. You may obtain a copy of the License at
13  * http://www.mozilla.org/MPL/
14  *
15  * Software distributed under the License is distributed on an "AS IS" basis,
16  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
17  * for the specific language governing rights and limitations under the
18  * License.
19  *
20  * The Original Code is "MantaRay" (TM).
21  *
22  * The Initial Developer of the Original Code is Coridan.
23  * Portions created by the Initial Developer are Copyright (C) 2006
24  * Coridan Inc. All Rights Reserved.
25  *
26  * Contributor(s): all the names of the contributors are added in the source
27  * code where applicable.
28  *
29  * Alternatively, the contents of this file may be used under the terms of the
30  * LGPL license (the "GNU LESSER GENERAL PUBLIC LICENSE"), in which case the
31  * provisions of LGPL are applicable instead of those above. If you wish to
32  * allow use of your version of this file only under the terms of the LGPL
33  * License and not to allow others to use your version of this file under
34  * the MPL, indicate your decision by deleting the provisions above and
35  * replace them with the notice and other provisions required by the LGPL.
36  * If you do not delete the provisions above, a recipient may use your version
37  * of this file under either the MPL or the GNU LESSER GENERAL PUBLIC LICENSE.
38  
39  *
40  * This library is free software; you can redistribute it and/or modify it
41  * under the terms of the MPL as stated above or under the terms of the GNU
42  * Lesser General Public License as published by the Free Software Foundation;
43  * either version 2.1 of the License, or any later version.
44  *
45  * This library is distributed in the hope that it will be useful, but WITHOUT
46  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
47  * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
48  * License for more details.
49  */

50
51  /**
52  * User: Moti Tal
53  * Date: Mar 13, 2005
54  * Time: 11:26:39 AM
55  *
56  * The flow combines of 1 to N steps.
57  * Each step as entry point (its position in the flow) and destination.
58  * Many steps can be applies to a single point in the flow, for that a condition tag should be met.
59  *
60  * The Flow use as a controller of the framework processes the outputs that are returned using the HashMap
61  * and determines which Declaration should be called next.
62  */

63 public interface Flow {
64
65     public final static String JavaDoc FLOW_TAG_NAME = "flow";
66     public final static String JavaDoc FLOW_STEP_TAG_NAME = "step";
67     public final static String JavaDoc FLOW_STEP_ID_ATTR_NAME = "id";
68     public final static String JavaDoc FLOW_STEP_FROM_ATTR_NAME = "from";
69     public final static String JavaDoc FLOW_STEP_TO_ATTR_NAME = "to";
70
71
72     /**
73      * Use this method to add steps to the flow
74      * @param i_id the id of the step (should be unique)
75      * @param i_from the entry point to this step
76      * @param i_to The Declaration should be called next
77      * @param i_conditions the condition to met this step
78      */

79     public void addStep(String JavaDoc i_id, Declaration i_from, Declaration i_to, Condition i_conditions);
80
81     /**
82      * Indicate if the current Declaration reach the end of the flow.
83      * @param i_current the Declaration.
84      * @param i_parameters the current parameters
85      * @return true, if has more steps applies to that Declaration; false otherwise
86      */

87     public boolean hasMoreSteps(Declaration i_current, Map JavaDoc i_parameters);
88
89     /**
90      * Get the next step in the flow
91      * @param i_current the current position in the flow
92      * @param i_parameters the current parameters passed to the next step
93      * @return the next Declaration or null if no steps applies
94      */

95     public Declaration getNextStep(Declaration i_current, Map JavaDoc i_parameters);
96 }
97
Popular Tags