001: package org.drools.ruleflow.core;
002:
003: /*
004: * Copyright 2005 JBoss Inc
005: *
006: * Licensed under the Apache License, Version 2.0 (the "License");
007: * you may not use this file except in compliance with the License.
008: * You may obtain a copy of the License at
009: *
010: * http://www.apache.org/licenses/LICENSE-2.0
011: *
012: * Unless required by applicable law or agreed to in writing, software
013: * distributed under the License is distributed on an "AS IS" BASIS,
014: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
015: * See the License for the specific language governing permissions and
016: * limitations under the License.
017: */
018:
019: import java.util.List;
020:
021: import org.drools.ruleflow.common.core.Process;
022:
023: /**
024: * Represents a RuleFlow process.
025: *
026: * @author <a href="mailto:kris_verlaenen@hotmail.com">Kris Verlaenen</a>
027: */
028: public interface RuleFlowProcess extends Process {
029:
030: /**
031: * Returns the start node of this RuleFlow process.
032: *
033: * @return the start node
034: */
035: StartNode getStart();
036:
037: /**
038: * Returns the nodes of this RuleFlow process.
039: *
040: * @return the nodes of this RuleFlow process
041: */
042: Node[] getNodes();
043:
044: /**
045: * Returns the node with the given id
046: *
047: * @param id the node id
048: * @return the node with the given id
049: * @throws IllegalArgumentException if an unknown id is passed
050: */
051: Node getNode(long id);
052:
053: /**
054: * Method for adding a node to this RuleFlow process.
055: * Note that the node will get an id unique for this process.
056: *
057: * @param node the node to be added
058: * @throws IllegalArgumentException if <code>node</code> is null
059: */
060: void addNode(Node node);
061:
062: /**
063: * Method for removing a node from this RuleFlow process
064: *
065: * @param node the node to be removed
066: * @throws IllegalArgumentException if <code>node</code> is null or unknown
067: */
068: void removeNode(Node node);
069:
070: /**
071: * Returns the global variables used in this RuleFlow process
072: *
073: * @return a list of variables of this RuleFlow process
074: */
075: List getVariables();
076:
077: /**
078: * Sets the global variables used in this RuleFlow process
079: *
080: * @param variables the variables
081: * @throws IllegalArugmentException if <code>variables</code> is null
082: */
083: void setVariables(List variables);
084:
085: /**
086: * Returns the names of the global variables used in this RuleFlow process
087: *
088: * @return the variable names of this RuleFlow process
089: */
090: String[] getVariableNames();
091:
092: /**
093: * Returns the imports of this RuleFlow process.
094: * They are defined as a List of fully qualified class names.
095: *
096: * @return the imports of this RuleFlow process
097: */
098: List getImports();
099:
100: /**
101: * Sets the imports of this RuleFlow process
102: *
103: * @param imports the imports as a List of fully qualified class names
104: */
105: void setImports(List imports);
106:
107: }
|