Example #1
0
        public static void Validate3Stream(ExprNode topNode)
        {
            var supportContainer  = SupportContainer.Instance;
            var streamTypeService = new SupportStreamTypeSvc3Stream();

            var factoriesPerStream = new ViewFactoryChain[3];

            for (var i = 0; i < factoriesPerStream.Length; i++)
            {
                var factories = new List <ViewFactory>();
                factories.Add(new LengthWindowViewFactory());
                factoriesPerStream[i] = new ViewFactoryChain(streamTypeService.EventTypes[i], factories);
            }
            var viewResources = new ViewResourceDelegateUnverified();

            EngineImportService engineImportService = SupportEngineImportServiceFactory.Make(supportContainer);

            VariableService variableService = new VariableServiceImpl(
                supportContainer, 0,
                new SchedulingServiceImpl(new TimeSourceServiceImpl(), supportContainer),
                SupportContainer.Resolve <EventAdapterService>(),
                null);

            variableService.CreateNewVariable(null, "IntPrimitive", typeof(int?).FullName, false, false, false, 10, engineImportService);
            variableService.AllocateVariableState("IntPrimitive", EPStatementStartMethodConst.DEFAULT_AGENT_INSTANCE_ID, null, false);
            variableService.CreateNewVariable(null, "var1", typeof(string).FullName, false, false, false, "my_variable_value", engineImportService);
            variableService.AllocateVariableState("var1", EPStatementStartMethodConst.DEFAULT_AGENT_INSTANCE_ID, null, false);

            ExprNodeUtility.GetValidatedSubtree(
                ExprNodeOrigin.SELECT, topNode, new ExprValidationContext(
                    supportContainer,
                    streamTypeService,
                    SupportEngineImportServiceFactory.Make(supportContainer),
                    null, viewResources,
                    null, variableService, null,
                    new SupportExprEvaluatorContext(supportContainer, null),
                    null, null, 1, null, null, null,
                    false, false, false, false, null, false));
        }
 public static EventBean CreateMapFromValues(IDictionary <String, Object> testValuesMap, EventType eventType)
 {
     return(SupportContainer.Resolve <EventAdapterService>().AdapterForTypedMap(testValuesMap, eventType));
 }
 public static EventType CreateMapType(IDictionary <String, Object> map)
 {
     return(SupportContainer.Resolve <EventAdapterService>().CreateAnonymousMapType("test", map, true));
 }
 public static EventBean CreateObject(Object theEvent)
 {
     return(SupportContainer.Resolve <EventAdapterService>().AdapterForObject(theEvent));
 }
 public static EventType CreateBeanType(Type clazz)
 {
     return(SupportContainer.Resolve <EventAdapterService>().AddBeanType(clazz.FullName, clazz, false, false, false));
 }