Hi Dilini, Thank you very much for the detailed explanation. Yes, I can do that in ESB layer and send the concatenated string to CEP.
Thanks, Raj. On Tue, Jun 14, 2016 at 4:02 PM, Dilini Muthumala <dil...@wso2.com> wrote: > Hi Raj, > > When Siddhi Compiler Tokenize a String Literal (like "t\"est" ), > AFAIK it does not escape characters when seeing '\'. So it will read '\' > character as just another character. > So adding an escape character will not work. > > Also the Siddhi Grammar does not allow a String Literal to contain a quote > character (' " ' or ' ' ') > If we put such a character, the query compilation will fail. > > For example, > Following query compilation will fail because "pa\"rt1" contains ' " ' > character. ('\' character will be read as a part of the String Literal) > > > //--------------------------------------------------------------------------------------------------------- > from inputStream > select symbol1 , str:concat("pa\"rt1","part2") as concatString > insert into outputStream; > > //--------------------------------------------------------------------------------------------------------- > > However, > concat function *can* process String Literals with quotes. > So, if you somehow send a String Literal (with quotes) to the Concat > function, then concat function has no issue with processing it. > > For example, following query compilation will be successful, > > //--------------------------------------------------------------------------------------------------------- > define stream inputStream (symbol1 string, symbol2 string); > > @info(name = 'query1') > from inputStream > select str:concat(symbol1,symbol2) as concatString > insert into outputStream; > > //--------------------------------------------------------------------------------------------------------- > > and if you send an inputStream event: > symbol1=AAA > symbol2=B"B > > You will get the result (concatString): > AAAB"B > > Thanks, > Dilini > > On Tue, Jun 14, 2016 at 2:54 PM, Rajkumar Rajaratnam <rajkum...@wso2.com> > wrote: > >> Hi, >> >> $Subject please. Escaping character doesn't seems to be working. >> >> Thanks, >> Raj. >> >> -- >> Rajkumar Rajaratnam >> Committer & PMC Member, Apache Stratos >> Senior Software Engineer, WSO2 >> >> Mobile : +94777568639 >> >> _______________________________________________ >> Dev mailing list >> Dev@wso2.org >> http://wso2.org/cgi-bin/mailman/listinfo/dev >> >> > > > -- > *Dilini Muthumala* > Senior Software Engineer, > WSO2 Inc. > > *E-mail :* dil...@wso2.com > *Mobile: *+94 713-400-029 > -- Rajkumar Rajaratnam Committer & PMC Member, Apache Stratos Senior Software Engineer, WSO2 Mobile : +94777568639
_______________________________________________ Dev mailing list Dev@wso2.org http://wso2.org/cgi-bin/mailman/listinfo/dev