public void ProcessView(
            EventBean[] newData,
            EventBean[] oldData)
        {
            if (!processor.HasHavingClause) {
                if (newData != null && newData.Length > 0) {
                    outputLastIStreamBufView = newData[newData.Length - 1];
                }

                if (oldData != null && oldData.Length > 0) {
                    outputLastRStreamBufView = oldData[oldData.Length - 1];
                }
            }
            else {
                var eventsPerStream = new EventBean[1];
                if (newData != null && newData.Length > 0) {
                    foreach (var theEvent in newData) {
                        eventsPerStream[0] = theEvent;

                        var passesHaving = processor.EvaluateHavingClause(
                            eventsPerStream,
                            true,
                            processor.GetAgentInstanceContext());
                        if (!passesHaving) {
                            continue;
                        }

                        outputLastIStreamBufView = theEvent;
                    }
                }

                if (oldData != null && oldData.Length > 0) {
                    foreach (var theEvent in oldData) {
                        eventsPerStream[0] = theEvent;

                        var passesHaving = processor.EvaluateHavingClause(
                            eventsPerStream,
                            false,
                            processor.GetAgentInstanceContext());
                        if (!passesHaving) {
                            continue;
                        }

                        outputLastRStreamBufView = theEvent;
                    }
                }
            }
        }
Example #2
0
        public void ProcessView(
            EventBean[] newData,
            EventBean[] oldData)
        {
            if (!processor.HasHavingClause) {
                AddToView(newData, oldData);
                return;
            }

            var eventsPerStream = new EventBean[1];
            if (newData != null && newData.Length > 0) {
                foreach (var theEvent in newData) {
                    eventsPerStream[0] = theEvent;

                    var passesHaving = processor.EvaluateHavingClause(
                        eventsPerStream,
                        true,
                        processor.GetAgentInstanceContext());
                    if (!passesHaving) {
                        continue;
                    }

                    eventsNewView.Add(theEvent);
                }
            }

            if (oldData != null && oldData.Length > 0) {
                foreach (var theEvent in oldData) {
                    eventsPerStream[0] = theEvent;

                    var passesHaving = processor.EvaluateHavingClause(
                        eventsPerStream,
                        false,
                        processor.GetAgentInstanceContext());
                    if (!passesHaving) {
                        continue;
                    }

                    eventsOldView.Add(theEvent);
                }
            }
        }