01: package org.drools.ruleflow.core;
02:
03: /*
04: * Copyright 2005 JBoss Inc
05: *
06: * Licensed under the Apache License, Version 2.0 (the "License");
07: * you may not use this file except in compliance with the License.
08: * You may obtain a copy of the License at
09: *
10: * http://www.apache.org/licenses/LICENSE-2.0
11: *
12: * Unless required by applicable law or agreed to in writing, software
13: * distributed under the License is distributed on an "AS IS" BASIS,
14: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15: * See the License for the specific language governing permissions and
16: * limitations under the License.
17: */
18:
19: /**
20: * Represents a connection between two nodes in a RuleFlow.
21: *
22: * @author <a href="mailto:kris_verlaenen@hotmail.com">Kris Verlaenen</a>
23: */
24: public interface Connection {
25:
26: /**
27: * The connection type
28: */
29: int TYPE_NORMAL = 1;
30: int TYPE_ABORT = 2;
31:
32: /**
33: * Returns the from node of the connection.
34: * @return the from node of the connection.
35: */
36: Node getFrom();
37:
38: /**
39: * Returns the to node of the connection
40: * @return the to node of the connection
41: */
42: Node getTo();
43:
44: /**
45: * Returns the connection type
46: * @return the connection type
47: */
48: int getType();
49:
50: /**
51: * Destroys the connection. This method also removes the
52: * connection on the <code>to</code> and <code>from</code> nodes.
53: * Onces a connection is destroyed, all methods throw
54: * an <code>IllegalStateException</code>.
55: */
56: void terminate();
57:
58: }
|