private IAggregator CreateAggregator(Tuple tuple) { var aggregator = _aggregatorFactory.Create(); tuple.SetState(this, aggregator); return(aggregator); }
public static Quantifier CreateQuantifier(this Tuple tuple, INode node) { var quantifier = new Quantifier(); tuple.SetState(node, quantifier); return(quantifier); }
private IFactAggregator CreateFactAggregator(Tuple tuple) { var aggregator = _aggregatorFactory.Create(); var factAggregator = new FactAggregator(aggregator); tuple.SetState(this, factAggregator); return(factAggregator); }
private IAggregator CreateAggregator(IExecutionContext context, Tuple tuple) { var aggregator = _aggregatorFactory.Create(); tuple.SetState(this, aggregator); var results = aggregator.Initial(); HandleAggregationResult(context, results, tuple); return(aggregator); }
private IAggregate GetAggregate(Tuple tuple) { var aggregate = tuple.GetState <IAggregate>(); if (aggregate == null) { aggregate = _aggregateFactory(); tuple.SetState(aggregate); } return(aggregate); }
private void AssertBinding(IExecutionContext context, Tuple tuple, TupleFactList toAssert) { try { var value = BindingExpression.Invoke(context, NodeInfo, tuple); var fact = new Fact(value, ResultType); tuple.SetState(this, fact); toAssert.Add(tuple, fact); } catch (ExpressionEvaluationException e) { if (!e.IsHandled) { throw new RuleLhsExpressionEvaluationException("Failed to evaluate binding expression", e.Expression.ToString(), e.InnerException); } } }
private void AssertBinding(IExecutionContext context, Tuple tuple, TupleFactList toAssert) { try { var value = BindingExpression.Invoke(tuple); var fact = new Fact(value, ResultType); tuple.SetState(this, fact); toAssert.Add(tuple, fact); } catch (Exception e) { bool isHandled = false; context.EventAggregator.RaiseBindingFailed(context.Session, e, BindingExpression.Expression, tuple, ref isHandled); if (!isHandled) { throw new RuleExpressionEvaluationException("Failed to evaluate binding expression", BindingExpression.Expression.ToString(), e); } } }