API Docs - v5.0.1
Tested Siddhi Core version: 5.1.0
It could also support other Siddhi Core minor versions.
Script
javascript (Script)
This extension allows you to include JavaScript functions within the Siddhi Query Language.
Syntax
define function <FunctionName>[javascript] return <type> {
// Script code
};
Examples EXAMPLE 1
define function concatJ[JavaScript] return string {" var str1 = data[0];
var str2 = data[1];
var str3 = data[2];
var res = str1.concat(str2,str3);
return res;
};
This JS function will consume 3 var variables, concatenate them and will return as a string