public override void PropagateUpdate(IExecutionContext context, IList <Fact> facts) { var joinedSets = JoinedSets(context, facts); var aggregation = new Aggregation(); foreach (var set in joinedSets) { if (set.Facts.Count == 0) { continue; } var matchingFacts = new List <Fact>(); foreach (var fact in set.Facts) { if (MatchesConditions(context, set.Tuple, fact)) { matchingFacts.Add(fact); } } if (matchingFacts.Count > 0) { IAggregator aggregator = GetAggregator(set.Tuple); var results = aggregator.Modify(set.Tuple, matchingFacts); aggregation.Add(set.Tuple, results); } } PropagateAggregation(context, aggregation); }
public override void PropagateUpdate(IExecutionContext context, Fact fact) { var tuples = MatchingTuples(context, fact); foreach (var tuple in tuples) { IAggregator aggregator = Aggregator(context, tuple); var results = aggregator.Modify(fact.Object); HandleAggregationResult(context, results, tuple); } }
public void Modify(Aggregation aggregation, Tuple tuple, IEnumerable <Fact> facts) { var results = _aggregator.Modify(tuple, facts); AddAggregationResult(aggregation, tuple, results); }