List<RegexNFAStateEntry> endStates = new ArrayList<RegexNFAStateEntry>();
List<RegexNFAStateEntry> nextStates = new ArrayList<RegexNFAStateEntry>();
List<RegexNFAStateEntry> currentStates;
int eventSequenceNumber = 0;
EventBean theEvent;
for (;events.hasNext();)
{
theEvent = events.next();
eventSequenceNumber++;
RegexPartitionState partitionState = regexPartitionStateRepo.getState(theEvent, false);
currentStates = partitionState.getCurrentStates();
// add start states for each new event
for (RegexNFAState startState : startStates)
{
long time = 0;
if (matchRecognizeSpec.getInterval() != null)
{
time = agentInstanceContext.getStatementContext().getSchedulingService().getTime();
}
currentStates.add(new RegexNFAStateEntry(eventSequenceNumber, time, startState, new EventBean[numEventsEventsPerStreamDefine], new int[allStates.length], null, partitionState.getOptionalKeys()));
}
if (partitionState.getRandomAccess() != null)
{
partitionState.getRandomAccess().existingEventPrepare(theEvent);
}
if ((ExecutionPathDebugLog.isDebugEnabled) && (log.isDebugEnabled()) || (IS_DEBUG))
{
log.info("Evaluating event " + theEvent.getUnderlying() + "\n" +
"current : " + printStates(currentStates));
}
step(currentStates, theEvent, nextStates, endStates, false, eventSequenceNumber, partitionState.getOptionalKeys());
if ((ExecutionPathDebugLog.isDebugEnabled) && (log.isDebugEnabled()) || (IS_DEBUG))
{
log.info("Evaluating event " + theEvent.getUnderlying() + "\n" +
"next : " + printStates(nextStates) + "\n" +
"end : " + printStates(endStates));
}
partitionState.setCurrentStates(nextStates);