示例#1
0
        private void SendSchemaEvent(Object prop, String key)
        {
            IDictionary <String, Object> theEvent = new Dictionary <String, Object>();

            theEvent["prop"] = prop;
            theEvent["key"]  = key;

            if (EventRepresentationEnumExtensions.GetEngineDefault(_epService).IsObjectArrayEvent())
            {
                _epService.EPRuntime.SendEvent(theEvent, "MySchema");
            }
            else
            {
                _epService.EPRuntime.SendEvent(theEvent, "MySchema");
            }
        }
示例#2
0
        private void SendEvent(string e0, int e1, string e2)
        {
            var theEvent = new LinkedHashMap <string, object>();

            theEvent.Put("e0", e0);
            theEvent.Put("e1", e1);
            theEvent.Put("e2", e2);
            if (EventRepresentationEnumExtensions.GetEngineDefault(_epService).IsObjectArrayEvent())
            {
                _epService.EPRuntime.SendEvent(theEvent.Values.ToArray(), "EventSchema");
            }
            else
            {
                _epService.EPRuntime.SendEvent(theEvent, "EventSchema");
            }
        }
示例#3
0
        private void SendWindow(string col0, long col1, string col2)
        {
            var theEvent = new LinkedHashMap <string, object>();

            theEvent.Put("col0", col0);
            theEvent.Put("col1", col1);
            theEvent.Put("col2", col2);
            if (EventRepresentationEnumExtensions.GetEngineDefault(_epService).IsObjectArrayEvent())
            {
                _epService.EPRuntime.SendEvent(theEvent.Values.ToArray(), "WindowSchema");
            }
            else
            {
                _epService.EPRuntime.SendEvent(theEvent, "WindowSchema");
            }
        }
        private void CreateSendEvent(EPServiceProvider engine, string typeName, string company, double value, double total)
        {
            var map = new LinkedHashMap <string, object>();

            map.Put("company", company);
            map.Put("value", value);
            map.Put("total", total);
            if (EventRepresentationEnumExtensions.GetEngineDefault(engine).IsObjectArrayEvent())
            {
                engine.EPRuntime.SendEvent(map.Values.ToArray(), typeName);
            }
            else
            {
                engine.EPRuntime.SendEvent(map, typeName);
            }
        }
示例#5
0
        private void SendEvent(String e0, int e1, String e2)
        {
            var theEvent = new LinkedHashMap <String, Object>();

            theEvent["e0"] = e0;
            theEvent["e1"] = e1;
            theEvent["e2"] = e2;

            if (EventRepresentationEnumExtensions.GetEngineDefault(_epService).IsObjectArrayEvent())
            {
                _epService.EPRuntime.SendEvent(theEvent.Values.ToArray(), "EventSchema");
            }
            else
            {
                _epService.EPRuntime.SendEvent(theEvent, "EventSchema");
            }
        }
示例#6
0
        public void TestDocSample()
        {
            try {
                _epService.EPAdministrator.CreateEPL("create schema OrderEvent(price double)");

                var epl = "@Name('All-Order-Events') @Audit('stream,property') select price from OrderEvent";
                _epService.EPAdministrator.CreateEPL(epl).Events += _listener.Update;

                if (EventRepresentationEnumExtensions.GetEngineDefault(_epService).IsObjectArrayEvent())
                {
                    _epService.EPRuntime.SendEvent(new Object[] { 100d }, "OrderEvent");
                }
                else
                {
                    _epService.EPRuntime.SendEvent(Collections.SingletonDataMap("price", 100d), "OrderEvent");
                }
            } catch (Exception e) {
                Console.WriteLine("Exception caught: {0}", e.GetType());
                throw;
            }
        }