public override void Apply( EventBean matchingEvent, EventBean[] eventsPerStream, TableInstance tableStateInstance, OnExprViewTableChangeHandler changeHandlerAdded, OnExprViewTableChangeHandler changeHandlerRemoved, AgentInstanceContext agentInstanceContext) { var theEvent = insertHelper.Process(eventsPerStream, true, true, agentInstanceContext); if (!route) { var aggs = tableStateInstance.Table.AggregationRowFactory.Make(); ((Array) theEvent.Underlying).SetValue(aggs, 0); tableStateInstance.AddEvent(theEvent); changeHandlerAdded?.Add(theEvent, eventsPerStream, true, agentInstanceContext); return; } if (insertIntoTable != null) { var tableInstance = insertIntoTable.GetTableInstance(agentInstanceContext.AgentInstanceId); tableInstance.AddEventUnadorned(theEvent); return; } if (audit) { agentInstanceContext.AuditProvider.Insert(theEvent, agentInstanceContext); } agentInstanceContext.InternalEventRouter.Route(theEvent, agentInstanceContext, false); }
public override EventBean[] ProcessInsert(FAFQueryMethodIUDInsertInto insert) { TableEvalLockUtil.ObtainLockUnless( instance.TableLevelRWLock.WriteLock, instance.AgentInstanceContext.TableExprEvaluatorContext); var theEvent = insert.InsertHelper.Process(new EventBean[0], true, true, instance.AgentInstanceContext); var aggs = instance.Table.AggregationRowFactory.Make(); ((object[]) theEvent.Underlying)[0] = aggs; instance.AddEvent(theEvent); return CollectionUtil.EVENTBEANARRAY_EMPTY; }