01: /*
02: * Copyright 2006 JBoss Inc
03: *
04: * Licensed under the Apache License, Version 2.0 (the "License");
05: * you may not use this file except in compliance with the License.
06: * You may obtain a copy of the License at
07: *
08: * http://www.apache.org/licenses/LICENSE-2.0
09: *
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: package org.drools.reteoo.builder;
18:
19: import org.drools.rule.RuleConditionElement;
20:
21: /**
22: * An interface for Reteoo Component builders
23: *
24: * @author etirelli
25: */
26: public interface ReteooComponentBuilder {
27:
28: /**
29: * Builds and attach if needed the given RuleConditionalElement
30: *
31: * @param context current build context
32: * @param rce
33: */
34: public void build(BuildContext context, BuildUtils utils,
35: RuleConditionElement rce);
36:
37: /**
38: * A boolean function that indicates if the builder requires a previous left
39: * (tuple) activation in order to corretly build the given component.
40: *
41: * In other words, if it returns true and no previous TupleSource is already created,
42: * an InitialFact pattern must be added with appropriate left input adapter for
43: * the network to be correctly built.
44: *
45: * For instance, NOT / EXISTS / ACCUMULATE are examples of builders that must return true
46: * for this method, while PATTERN must return false.
47: *
48: * @param rce the element to be built
49: *
50: * @return true if a tuple source is required, false otherwise.
51: */
52: public boolean requiresLeftActivation(BuildUtils utils,
53: RuleConditionElement rce);
54:
55: }
|