Siddhi Aggregate Function consumes zero or more parameters for for each event and output outputs a single attribute having with an aggregated results result based in on the input parameters as an output. This could be used with in conjunction with a window in order to find the aggregated results based on the a given window like such as the Aggregate Function operator.
To Ti implement a custom Aggregate Function, create aggregate function, follow the procedure below.
- Create a class extending
- Create an appropriate
.siddhiextextension mapping file
- Compile the class
- Build the jar containing the .class and .siddhiext files.
- the jar to the Siddhi class path.
- If you need to run them on WSO2 CEP, add
- it to the
For example, Aggregate Function extension created with namespace "custom" and function name "std" an aggregate function extension with
custom as the namespace and
std as the function name can be referred in the a query as follows:.
from pizzaOrder#window.length(20) select custom:count(orderNo) as totalOrders insert into orderCount;