use of org.drools.core.reteoo.WindowNode in project drools by kiegroup.
the class PatternBuilder method buildBehaviors.
private void buildBehaviors(BuildContext context, BuildUtils utils, Pattern pattern, Constraints constraints) {
final List<Behavior> behaviors = pattern.getBehaviors();
if (pattern.getSource() == null || (!(pattern.getSource() instanceof WindowReference) && (context.getCurrentEntryPoint() != EntryPointId.DEFAULT || !behaviors.isEmpty()))) {
attachObjectTypeNode(context, utils, pattern);
}
if (!behaviors.isEmpty()) {
// build the window node:
WindowNode wn = context.getComponentFactory().getNodeFactoryService().buildWindowNode(context.getNextId(), constraints.alphaConstraints, behaviors, context.getObjectSource(), context);
context.setObjectSource(utils.attachNode(context, wn));
// alpha constraints added to the window node already
constraints.alphaConstraints.clear();
}
}
use of org.drools.core.reteoo.WindowNode in project drools by kiegroup.
the class WindowReferenceBuilder method build.
/* (non-Javadoc)
* @see org.kie.reteoo.builder.ReteooComponentBuilder#build(org.kie.reteoo.builder.BuildContext, org.kie.reteoo.builder.BuildUtils, org.kie.rule.RuleConditionElement)
*/
public void build(BuildContext context, BuildUtils utils, RuleConditionElement rce) {
final WindowReference window = (WindowReference) rce;
final WindowNode node = context.getKnowledgeBase().getReteooBuilder().getWindowNode(window.getName());
context.setObjectSource(node);
context.setCurrentEntryPoint(node.getEntryPoint());
}
Aggregations