public void activate(EventBean optionalTriggeringEvent, MatchedEventMap priorMatches, long timeOffset, boolean isRecoveringReslient) {
if (patternStopCallback != null) {
patternStopCallback.stop();
}
PatternStreamSpecCompiled patternStreamSpec = endpointPatternSpec.getPatternCompiled();
StatementContext stmtContext = agentInstanceContext.getStatementContext();
EvalRootFactoryNode rootFactoryNode = servicesContext.getPatternNodeFactory().makeRootNode();
int streamNum = isStartEndpoint ? contextStatePathKey.getSubPath() : -1 * contextStatePathKey.getSubPath();
boolean allowResilient = contextStatePathKey.getLevel() == 1;
rootFactoryNode.addChildNode(patternStreamSpec.getEvalFactoryNode());
PatternContext patternContext = stmtContext.getPatternContextFactory().createContext(stmtContext, streamNum, rootFactoryNode, new MatchedEventMapMeta(patternStreamSpec.getAllTags(), !patternStreamSpec.getArrayEventTypes().isEmpty()), allowResilient);
PatternAgentInstanceContext patternAgentInstanceContext = stmtContext.getPatternContextFactory().createPatternAgentContext(patternContext, agentInstanceContext, false);
EvalRootNode rootNode = EvalNodeUtil.makeRootNodeFromFactory(rootFactoryNode, patternAgentInstanceContext);
if (priorMatches == null) {