use of org.drools.core.rule.constraint.XpathConstraint in project drools by kiegroup.
the class ReactiveFromBuilder method build.
public void build(final BuildContext context, final BuildUtils utils, final RuleConditionElement rce) {
final From from = (From) rce;
context.pushRuleComponent(from);
@SuppressWarnings("unchecked") BetaConstraints betaConstraints = utils.createBetaNodeConstraint(context, context.getBetaconstraints(), true);
AlphaNodeFieldConstraint[] alphaNodeFieldConstraints = context.getAlphaConstraints() != null ? context.getAlphaConstraints().toArray(new AlphaNodeFieldConstraint[context.getAlphaConstraints().size()]) : new AlphaNodeFieldConstraint[0];
ReactiveFromNode node = CoreComponentFactory.get().getNodeFactoryService().buildReactiveFromNode(context.getNextNodeId(), from.getDataProvider(), context.getTupleSource(), alphaNodeFieldConstraints, betaConstraints, context.isTupleMemoryEnabled(), context, from);
context.setTupleSource(utils.attachNode(context, node));
context.setAlphaConstraints(null);
context.setBetaconstraints(null);
List<XpathConstraint> xpathConstraints = context.getXpathConstraints();
for (XpathConstraint xpathConstraint : xpathConstraints) {
for (XpathConstraint.XpathChunk chunk : xpathConstraint.getChunks()) {
context.setAlphaConstraints(chunk.getAlphaConstraints());
context.setBetaconstraints(chunk.getBetaConstraints());
context.setXpathConstraints(chunk.getXpathConstraints());
build(context, utils, chunk.asFrom());
}
}
}
Aggregations