Given above is the table definition,
- Defines a table named
CardUserTablewith the given attributes.
- The annotation '
@from' is used to link the table to an RDBMS event table named
CEPSample0107CardUserTableand the data source used to access the table as
WSO2_CARBON_DB(this is the datasource of the default H2 database that is shipped with WSO2 CEP. If needed you can define a separate data source pointing to some other DB such as MySQL and use it here.)
- Processes the events received through the
- Selects cardNo
cardNo and renames it as
cardNum, introduces a new attribute named blacklisted with the value '
true' under the
selectclause, for each event received.
- Updates the CardUserTable with the condition cardNum condition
cardNum == CardUserTable.cardNum. Here the '
blacklisted' attribute in the table will be updated with the new value.
- Defines a length window that keeps 1 event of the input stream
- Joins it with the
CardUserTablewith the condition
p.cardNo == c.cardNum and c.blacklisted == false. In this condition, the events with
blacklisted == truein the table gets filtered out and then the remaining events will be are joined based on the card number.
- Emits those events as output events through the TransformedRoomTempStreamthe
from DeleteAllUsers delete CardUserTable on deleteAll == true;
The last query is used to clean up the table from an external trigger event through
- It processes the events received through the
- Checks for the condition
deleteAll == trueand if it's its true, deletes all the records in the
Set up the prerequisites required for all samples.
- Points the default Axis2 repo to
<CEP_HOME>/samplesamples/cep/artifacts/0107(by default, the Axis2 repo is