Call a R script from WSO2 - Bridging the loose ends

150 Views Asked by At

I wish to call my R scripts from WSO2 DAS server. I have written the following code in siddhi query

@Plan:name('MyRPlan')

@Import('MyRStream:1.0.0')
define stream Rin (emplyId int);

@Export('MyRout:1.0.0')
define stream Rout (emplyId int);

from Rin#r:eval('/my/file/path/MyRFun.R', 'emplyId int', emplyId)
select *
insert into Rout;

is my syntax to call a R script correct? If it is can someone please tell me why I get this error Error message in DAS console. I have also downloaded the JRI files at https://rforge.net/JRI/files/ according to the link given by wso2.

1

There are 1 best solutions below

0
On

This is not due to a syntax error but because of JRI is not properly configured. Please refer WSO2 CEP docs on integrating R and make sure that you are using exact version [1]. You can try few test cases written for R extension [2].

[1] https://docs.wso2.com/display/CEP400/Installing+R+to+work+with+WSO2+CEP

[2] https://github.com/wso2-gpl/siddhi/blob/master/siddhi-extensions/r/src/test/java/org/wso2/siddhi/gpl/extension/r/RScriptTestCase.java