agentInstanceContext = new AgentInstanceContext(statementContext, null, -1, null, null, statementContext.getDefaultAgentInstanceScriptContext());
// resolve types and named window processors
for (int i = 0; i < numStreams; i++)
{
final StreamSpecCompiled streamSpec = statementSpec.getStreamSpecs()[i];
NamedWindowConsumerStreamSpec namedSpec = (NamedWindowConsumerStreamSpec) streamSpec;
String streamName = namedSpec.getWindowName();
if (namedSpec.getOptionalStreamName() != null)
{