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.reteoo.EvalConditionNode;
20: import org.drools.reteoo.TupleSource;
21: import org.drools.rule.EvalCondition;
22: import org.drools.rule.RuleConditionElement;
23:
24: /**
25: * @author etirelli
26: *
27: */
28: public class EvalBuilder implements ReteooComponentBuilder {
29:
30: /**
31: * @inheritDoc
32: */
33: public void build(final BuildContext context,
34: final BuildUtils utils, final RuleConditionElement rce) {
35:
36: final EvalCondition eval = (EvalCondition) rce;
37: utils.checkUnboundDeclarations(context, eval
38: .getRequiredDeclarations());
39: context.setTupleSource((TupleSource) utils.attachNode(context,
40: new EvalConditionNode(context.getNextId(), context
41: .getTupleSource(), eval)));
42:
43: }
44:
45: /**
46: * @inheritDoc
47: */
48: public boolean requiresLeftActivation(final BuildUtils utils,
49: final RuleConditionElement rce) {
50: return true;
51: }
52:
53: }
|