[英]How to get parameters by name in a Siddhi extension custom function of WSO2 CEP?
When I pass params into my Custom Function and I want to get it, I need to do it by that: 当我将参数传递到自定义函数中并且想要获取它时,我需要这样做:
@Override
protected Object process(Object obj) {
param1 = obj[0];
param2 = obj[1];
}
but when I have 30 params I need to repeat this process almost 30 times, and when something change in my input params I will have to change index too. 但是当我有30个参数时,我需要重复此过程近30次,并且当输入参数发生变化时,我也必须更改索引。 So my question is, is possible to get params in Custom Fucntion by they names? 所以我的问题是,是否有可能通过名称来获取Custom Fucntion中的参数? Like that for example: 像这样:
param1 = "getAttributeByName('param1Name')";
param2 = "getAttributeByName('param2Name')";
Similar thing is available in Transformer, but is it possible in Function? 在Transformer中可以使用类似的功能,但是在Function中可以使用吗?
没有Kacu,这是不可能的。.但是由于您具有流定义,因此您无法从中获取事件模式信息并按索引获取属性。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.