Hi Abimaran, I've tried concatenation using below API configurations[1] and was able to get the expected results as shown in console log[2]. Can you further explain your use case to check is there any issue with script mediator.
[1]. <?xml version="1.0" encoding="UTF-8"?> <api xmlns="http://ws.apache.org/ns/synapse" name="Test" context="/test"> <resource methods="POST"> <inSequence> <log> <property name="#################" value="MIS" /> </log> <script language="js">var result = 'result'; var test = "test"; var i = Math.floor((Math.random() * 100000) + 1); result = result + i; mc.setProperty("MESSAGE_ID", result); mc.setProperty("TEST", test);</script> <log> <property name="#################" expression="get-property('MESSAGE_ID')" /> </log> <respond /> </inSequence> </resource> </api> [2]. [2016-04-19 18:15:08,865] INFO - LogMediator ################# = result45916 Thanks. On Tue, Apr 19, 2016 at 6:00 PM, Abimaran Kugathasan <abima...@wso2.com> wrote: > Hi Devs, > > Concatenation of String and number doesn't work in script mediator. > > <script language="js"> > var result = 'result'; > var test = "test"; > var i = Math.floor((Math.random() * 100000) + 1); > result = result + i; > mc.setProperty("MESSAGE_ID", result); > mc.setProperty("TEST", test); > </script> > > Is this a known issues in ESB 4.8.1? > > -- > Thanks > Abimaran Kugathasan > > Software Engineer | WSO2 Inc > Data & APIs Technologies Team > Mobile : +94 773922820 > > <http://stackoverflow.com/users/515034> > <http://lk.linkedin.com/in/abimaran> > <http://www.lkabimaran.blogspot.com/> <https://github.com/abimarank> > <https://twitter.com/abimaran> > > > _______________________________________________ > Dev mailing list > Dev@wso2.org > http://wso2.org/cgi-bin/mailman/listinfo/dev > > -- Vijitha Ekanayake Software Engineer*, *WSO2, Inc.; http://wso2.com/ Mobile : +94 777 24 73 39 | +94 718 74 44 08 lean.enterprise.middleware
_______________________________________________ Dev mailing list Dev@wso2.org http://wso2.org/cgi-bin/mailman/listinfo/dev