if (scheduleAudit != null) {
schedulingService = new SchedulingServiceAudit(statementName, schedulingService);
}
StatementAIResourceRegistry statementAgentInstanceRegistry = null;
ContextDescriptor contextDescriptor = null;
if (optionalContextName != null) {
contextDescriptor = engineServices.getContextManagementService().getContextDescriptor(optionalContextName);
// allocate a per-instance registry of aggregations and prev/prior/subselect
if (contextDescriptor != null) {
statementAgentInstanceRegistry = contextDescriptor.getAiResourceRegistryFactory().make();
}
}
boolean countSubexpressions = engineServices.getConfigSnapshot().getEngineDefaults().getPatterns().getMaxSubexpressions() != null;
PatternSubexpressionPoolStmtSvc patternSubexpressionPoolStmtSvc = null;