Search code examples
wso2complex-event-processingsiddhi

Can I load a list white with table event WSO2


I have a postgres blacklist table, I want to load this table and do a join using the event table of WSO2 DAS.

but it does not allow me to use the blacklist eat from in the query.

This is my code of sample:

@From(eventtable='rdbms', jdbc.url='jdbc:postgresql://localhost:5432/pruebabg', username='postgres', password='Easysoft16', driver.name='org.postgresql.Driver', table.name='Trazablack')
define table Trazablack (sensorValue double);

@From(eventtable='rdbms', jdbc.url='jdbc:postgresql://localhost:5432/pruebabg', username='postgres', password='Easysoft16', driver.name='org.postgresql.Driver', table.name='Trazawhite')
define table TrazaExtend (Trazawhite double);

from Trazablack
select *
insert into TrazaFiltrada;

This is the error:

"Stream/table definition with ID 'Trazablack' has not been defined in execution plan "ExecutionPlan""

it's possible?


Solution

  • You can't read a table like that in Siddhi, it should be done with a join query (triggered using an incoming event). Without an incoming event stream, there's no way to trigger the query.

    If you don't want to feed any external events to trigger this query, you can use a Trigger in Siddhi (refer this doc for more information).

    Example query that is triggered every 5 minutes:

    define trigger FiveMinTriggerStream at every 5 min;
    
    from FiveMinTriggerStream join Trazablack as t
    select t.sensorValue as sensorValue
    insert into TrazaFiltrada;