Hi Lahiru,

Looking at the code segment given above, everything seems correct. Can you
attach the complete class of the Siddhi extension and the exact query used,
so that we can dig into it deeper?

Thanks,
Lasantha

On 14 October 2014 21:54, Lahiru Cooray <lahi...@wso2.com> wrote:

> Hi,
>
> When writing a custom function as a Siddhi Extension I faced an issue in
> validating the parameter count passed.
>
> Eg:
> from InputStream1
> select *custom:cos(para1)*
> insert into OutputSream1
>
> I tried to validate the custom function '*cos*' where user should be able
> to pass only one parameter.I used the below code in my function:
>
>  @Override
>
> public void init(Attribute.Type[] types, SiddhiContext siddhiContext) {
>
> if (types.length  !=1 ) {
>
>  //validation message
>
> }
>
> ………
>
> }
> Here even when the user doesn't pass any parameter, it returns the
> types.length as '1' and the data type as LONG.
>
> Can somebody please help me to figure out the reason for this??
>
> Thanks...
> --
> *Lahiru Cooray*
> Software Engineer
> WSO2, Inc.;http://wso2.com/
> lean.enterprise.middleware
>
> Mobile: +94 715 654154
>
> _______________________________________________
> Dev mailing list
> Dev@wso2.org
> http://wso2.org/cgi-bin/mailman/listinfo/dev
>
>


-- 
*Lasantha Fernando*
Software Engineer - Data Technologies Team
WSO2 Inc. http://wso2.com

email: lasan...@wso2.com
mobile: (+94) 71 5247551
_______________________________________________
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev

Reply via email to