Esper/Nesper runtime configuration add generic event type

90 Views Asked by At

can anyone tell me how to add generic type (bean) to configure the CEP runtime? I'm in NEsper environment using C#., I have an event(bean) - Signal which has the attribute - value. Depends on what kind of Signal it is, the value can be bool or double or string ... value. So I've define Signal as a generic: Signal. My following code return an exception. If I'm not using generic type as event, it works. How should I add the generic event type correctly?

var container = ContainerExtensions.CreateDefaultContainer()
                        .InitializeDefaultServices()
                        .InitializeDatabaseDrivers();
var configuration = new Configuration(container); 
configuration.Common.AddEventType("Signal", typeof(Signal<bool>));
configuration.Common.AddEventType("Signal", typeof(Signal<double>));
var runtime = EPRuntimeProvider.GetDefaultRuntime(configuration);

Thanks for any help!

Narisu

1

There are 1 best solutions below

0
On

There is no support for generic type-parameterized bean events in Nesper yet. There is support in the Java version.