public static DataflowStartDesc Realize(String dataFlowName,
                                                IDictionary <int, Object> operators,
                                                IDictionary <int, OperatorMetadataDescriptor> operatorMetadata,
                                                ICollection <int> operatorBuildOrder,
                                                IList <LogicalChannelBinding> bindings,
                                                DataFlowSignalManager dataFlowSignalManager,
                                                EPDataFlowInstantiationOptions options,
                                                EPServicesContext services,
                                                StatementContext statementContext)
        {
            // First pass: inject runtime context
            IDictionary <int, EPDataFlowEmitter> runtimeContexts    = new Dictionary <int, EPDataFlowEmitter>();
            OperatorStatisticsProvider           statisticsProvider = null;

            if (options.IsOperatorStatistics())
            {
                statisticsProvider = new OperatorStatisticsProvider(operatorMetadata);
            }

            bool audit = AuditEnum.DATAFLOW_OP.GetAudit(statementContext.Annotations) != null;

            foreach (int producerOpNum in operatorBuildOrder)
            {
                String operatorPrettyPrint = operatorMetadata.Get(producerOpNum).OperatorPrettyPrint;
                if (Log.IsDebugEnabled)
                {
                    Log.Debug("Generating runtime context for " + operatorPrettyPrint);
                }

                // determine the number of output streams
                Object producingOp                  = operators.Get(producerOpNum);
                int    numOutputStreams             = operatorMetadata.Get(producerOpNum).OperatorSpec.Output.Items.Count;
                IList <ObjectBindingPair>[] targets = GetOperatorConsumersPerStream(
                    numOutputStreams, producerOpNum, operators, operatorMetadata, bindings);

                EPDataFlowEmitter runtimeContext = GenerateRuntimeContext(
                    statementContext.EngineURI, statementContext.StatementName, audit, dataFlowName, producerOpNum,
                    operatorPrettyPrint, dataFlowSignalManager, targets, options);

                if (options.IsOperatorStatistics())
                {
                    runtimeContext = new EPDataFlowEmitterWrapperWStatistics(
                        runtimeContext, producerOpNum, statisticsProvider, options.IsCpuStatistics());
                }

                TypeHelper.SetFieldForAnnotation(producingOp, typeof(DataFlowContextAttribute), runtimeContext);
                runtimeContexts.Put(producerOpNum, runtimeContext);
            }

            // Second pass: hook punctuation such that it gets forwarded
            foreach (int producerOpNum in operatorBuildOrder)
            {
                String operatorPrettyPrint = operatorMetadata.Get(producerOpNum).OperatorPrettyPrint;
                if (Log.IsDebugEnabled)
                {
                    Log.Debug("Handling signals for " + operatorPrettyPrint);
                }

                // determine consumers that receive punctuation
                ICollection <int> consumingOperatorsWithPunctuation = new HashSet <int>();
                foreach (LogicalChannelBinding binding in bindings)
                {
                    if (!binding.LogicalChannel.OutputPort.HasPunctuation ||
                        binding.LogicalChannel.OutputPort.ProducingOpNum != producerOpNum)
                    {
                        continue;
                    }
                    consumingOperatorsWithPunctuation.Add(binding.LogicalChannel.ConsumingOpNum);
                }

                // hook up a listener for each
                foreach (int consumerPunc in consumingOperatorsWithPunctuation)
                {
                    EPDataFlowEmitter context = runtimeContexts.Get(consumerPunc);
                    if (context == null)
                    {
                        continue;
                    }
                    dataFlowSignalManager.AddSignalListener(
                        producerOpNum, new ProxyDataFlowSignalListener
                    {
                        ProcSignal = context.SubmitSignal
                    });
                }
            }

            return(new DataflowStartDesc(statisticsProvider));
        }