if (index != null && index > 0) {
if (evalFollowedByNode.isTrackWithMax()) {
countActivePerChild[index - 1]--;
}
if (evalFollowedByNode.isTrackWithPool()) {
PatternSubexpressionPoolStmtSvc poolSvc = evalFollowedByNode.getContext().getStatementContext().getPatternSubexpressionPoolSvc();
poolSvc.getEngineSvc().decreaseCount(evalFollowedByNode);
poolSvc.getStmtHandler().decreaseCount();
}
}
}
// the node may already have quit as a result of an outer state quitting this state,
// however the callback may still be received; It is fine to ignore this callback.
if (index == null)
{
return;
}
// If the match came from the very last filter, need to escalate
int numChildNodes = evalFollowedByNode.getChildNodes().length;
if (index == (numChildNodes - 1))
{
boolean isFollowedByQuitted = false;
if (nodes.isEmpty())
{
isFollowedByQuitted = true;
}
this.getParentEvaluator().evaluateTrue(matchEvent, this, isFollowedByQuitted);
}
// Else start a new sub-expression for the next-in-line filter
else
{
if (evalFollowedByNode.isTrackWithMax()) {
int max = evalFollowedByNode.getFactoryNode().getMax(index);
if ((max != -1) && (max >=0)) {
if (countActivePerChild[index] >= max) {
evalFollowedByNode.getContext().getAgentInstanceContext().getStatementContext().getExceptionHandlingService().handleCondition(new ConditionPatternSubexpressionMax(max), evalFollowedByNode.getContext().getAgentInstanceContext().getStatementContext().getEpStatementHandle());
return;
}
}
}
if (evalFollowedByNode.isTrackWithPool()) {
PatternSubexpressionPoolStmtSvc poolSvc = evalFollowedByNode.getContext().getStatementContext().getPatternSubexpressionPoolSvc();
boolean allow = poolSvc.getEngineSvc().tryIncreaseCount(evalFollowedByNode);
if (!allow) {
return;
}
poolSvc.getStmtHandler().increaseCount();
}
if (evalFollowedByNode.isTrackWithMax()) {
countActivePerChild[index]++;
}