WSO2 Complex Event Processor is succeeded by WSO2 Stream Processor. To view the latest documentation for WSO2 SP, see WSO2 Stream Processor Documentation.

Versions Compared


  • This line was added.
  • This line was removed.
  • Formatting was changed.


Given above is the table definition,

  • Defines a table named CardUserTable with the given attributes. 
  • The annotation '@from' is used to link the table to an RDBMS event table named CEPSample0107CardUserTable and 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 BlackListStream.
  • Selects cardNo cardNo and renames it as cardNum, introduces a new attribute named blacklisted with the value 'true' under the select clause, 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 PurchaseStream.
  • Joins it with the CardUserTable with the condition p.cardNo == c.cardNum and c.blacklisted == false. In this condition, the events with blacklisted == true in 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 TransformedRoomTempStream.
Code Block
from DeleteAllUsers 
delete CardUserTable
	on deleteAll == true;

The last query is used to clean up the table from an external trigger event through DeleteAllUsers stream,

  • It processes the events received through the DeleteAllUsers.
  • Checks for the condition deleteAll == true and if it's its true, deletes all the records in the CardUserTable


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 <CEP_HOME>/repository/deployment/server).