3

I have been working on a Siddhi App. Inside this app I have JavaScript functions. I have found a problem when trying to use the function inside the function. Lets say:

define function sum[JavaScript ] return double {
   return data[0]+ data[1];
}
define function getthesum[JavaScript] return double {
   var s = sum(5,1); 
   return s; 
}

But when I do this, "sum" is not defined appears in the logs.

Jorge Monroy
  • 408
  • 1
  • 5
  • 16

1 Answers1

1

The function defined here can be only used within Siddhi queries, and they cannot be used in an integrative manner with each other.

E.g you can do

from FooStream 
select sum(a,b) as total
insert into BarStream; 

And here the getthesum() is not correct.

suho
  • 912
  • 6
  • 12