public ViewableActivationResult activate(AgentInstanceContext agentInstanceContext, boolean isSubselect, boolean isRecoveringResilient) {
PatternAgentInstanceContext patternAgentInstanceContext = agentInstanceContext.getStatementContext().getPatternContextFactory().createPatternAgentContext(patternContext, agentInstanceContext, hasConsumingFilter);
EvalRootNode rootNode = EvalNodeUtil.makeRootNodeFromFactory(rootFactoryNode, patternAgentInstanceContext);
final EventStream sourceEventStream = new ZeroDepthStream(eventType);
final StatementContext statementContext = patternContext.getStatementContext();
final PatternMatchCallback callback = new PatternMatchCallback() {
public void matchFound(Map<String, Object> matchEvent)
{
EventBean compositeEvent = statementContext.getEventAdapterService().adapterForTypedMap(matchEvent, eventType);
sourceEventStream.insert(compositeEvent);
}
};
EvalRootState rootState = rootNode.start(callback, patternContext, isRecoveringResilient);
return new ViewableActivationResult(sourceEventStream, rootState, null, rootState);