Re: [Dev] CSRF token error in working with EI Management Console with Java 1.8.0_151

2017-11-11 Thread Sudharma Subasinghe
Hi Prakash,

As you mentioned I tried again with jdk1.8.0_144. It does not work for EI
6.1.1-update 8 with JDK 1.8.0_144 or JDK 1.8.0_45.

On Tue, Nov 7, 2017 at 9:14 PM, Sudharma Subasinghe <sudhar...@wso2.com>
wrote:

>
>
> On Tue, Nov 7, 2017 at 7:01 PM, Arunan Sugunakumar <aru...@wso2.com>
> wrote:
>
>> Hi,
>>
>> I seem to be getting this issue in wso2das-3.1.0 and wso2esb5.0.0 as
>> well. Is there any temporary fix for this problem?
>>
>
> Did you get the issue for wso2esb 5.0.0 with JDK 1.8.0_144? Try with JDK
> 1.8.0_45 for wso2 esb 5.0.0 which works for me.
>
>>
>> Thanks
>>
>> On Mon, Nov 6, 2017 at 9:04 PM, Sudharma Subasinghe <sudhar...@wso2.com>
>> wrote:
>>
>>> Hi Prakash,
>>>
>>> Still with jdk1.8.0_144, same issue happens with EI 6.1.1-update 8 pack
>>>
>>> On Mon, Nov 6, 2017 at 8:06 PM, Sudharma Subasinghe <sudhar...@wso2.com>
>>> wrote:
>>>
>>>> Same thing is happening with EI 6.1.1-update 8 with JDK 1.8.0_45.
>>>>
>>>>
>>>> On Wed, Nov 1, 2017 at 7:14 AM, Prakhash Sivakumar <prakh...@wso2.com>
>>>> wrote:
>>>>
>>>>>
>>>>>
>>>>> On Tue, Oct 31, 2017 at 3:20 PM, Thejan Rupasinghe <the...@wso2.com>
>>>>> wrote:
>>>>>
>>>>>> Hi Chaminda,
>>>>>>
>>>>>> Seems it is an issue in the Tomcat server with that jdk update.
>>>>>>
>>>>> Yes. This is happining due to a gzip decoding issue with JDK 1.8.0_151,
>>>>> which is reported in [1] .
>>>>>
>>>>> [1] https://bugs.openjdk.java.net/browse/JDK-8189789
>>>>>
>>>>>
>>>>>> Thanks for informing.
>>>>>>
>>>>>> Regards,
>>>>>> Thejan
>>>>>>
>>>>>> On Tue, Oct 31, 2017 at 2:54 PM, Chaminda Jayawardena <
>>>>>> chami...@wso2.com> wrote:
>>>>>>
>>>>>>>
>>>>>>> seems a known issue and the ESB document has been updated with the
>>>>>>> info.
>>>>>>>
>>>>>>> [1] https://docs.wso2.com/display/ESB500/Installation+Prerequisites
>>>>>>>
>>>>>>> Thanks
>>>>>>> Chaminda
>>>>>>>
>>>>>>> On Tue, Oct 31, 2017 at 10:21 AM, Thejan Rupasinghe <the...@wso2.com
>>>>>>> > wrote:
>>>>>>>
>>>>>>>> Hi all,
>>>>>>>>
>>>>>>>> When I'm working with EI Management Console with the latest Java 8
>>>>>>>> version, 1.8.0_151 [1], following error occurred.
>>>>>>>>
>>>>>>>> [2017-10-30 19:14:54,210] [EI-Core]  WARN - JavaLogger potential
>>>>>>>> cross-site request forgery (CSRF) attack thwarted (user:,
>>>>>>>> ip:10.100.4.201, method:POST, 
>>>>>>>> uri:/carbon/admin/jsp/WSRequestXSSproxy_ajaxprocessor.jsp,
>>>>>>>> error:required token is missing from the request)
>>>>>>>>
>>>>>>>> I could not submit any form data through Management Console.
>>>>>>>>
>>>>>>>> I tested with EI 6.1.1 and current update, EI 6.1.1-update 7, but
>>>>>>>> the same error occurred.
>>>>>>>>
>>>>>>>> When I use Java 1.8.0_144, everything works fine.
>>>>>>>>
>>>>>>>> Can anyone explain why does this happen?
>>>>>>>>
>>>>>>>> [1] https://java.com/en/download/
>>>>>>>>
>>>>>>>> Thanks,
>>>>>>>> Regards,
>>>>>>>> Thejan
>>>>>>>> --
>>>>>>>>
>>>>>>>> *Thejan Rupasinghe*
>>>>>>>>
>>>>>>>> *Intern - Software EngineeringWSO2*
>>>>>>>>
>>>>>>>> *Mobile : +94 77-9020962 <+94%2077%20902%200962>*
>>>>>>>> <https://wso2.com/signature>
>>>>>>>>
>>>>>>>> ___
>>>>>>>> Dev mailing list
>>>>>>>> De

Re: [Dev] CSRF token error in working with EI Management Console with Java 1.8.0_151

2017-11-07 Thread Sudharma Subasinghe
On Tue, Nov 7, 2017 at 7:01 PM, Arunan Sugunakumar <aru...@wso2.com> wrote:

> Hi,
>
> I seem to be getting this issue in wso2das-3.1.0 and wso2esb5.0.0 as well.
> Is there any temporary fix for this problem?
>

Did you get the issue for wso2esb 5.0.0 with JDK 1.8.0_144? Try with JDK
1.8.0_45 for wso2 esb 5.0.0 which works for me.

>
> Thanks
>
> On Mon, Nov 6, 2017 at 9:04 PM, Sudharma Subasinghe <sudhar...@wso2.com>
> wrote:
>
>> Hi Prakash,
>>
>> Still with jdk1.8.0_144, same issue happens with EI 6.1.1-update 8 pack
>>
>> On Mon, Nov 6, 2017 at 8:06 PM, Sudharma Subasinghe <sudhar...@wso2.com>
>> wrote:
>>
>>> Same thing is happening with EI 6.1.1-update 8 with JDK 1.8.0_45.
>>>
>>>
>>> On Wed, Nov 1, 2017 at 7:14 AM, Prakhash Sivakumar <prakh...@wso2.com>
>>> wrote:
>>>
>>>>
>>>>
>>>> On Tue, Oct 31, 2017 at 3:20 PM, Thejan Rupasinghe <the...@wso2.com>
>>>> wrote:
>>>>
>>>>> Hi Chaminda,
>>>>>
>>>>> Seems it is an issue in the Tomcat server with that jdk update.
>>>>>
>>>> Yes. This is happining due to a gzip decoding issue with JDK 1.8.0_151,
>>>> which is reported in [1] .
>>>>
>>>> [1] https://bugs.openjdk.java.net/browse/JDK-8189789
>>>>
>>>>
>>>>> Thanks for informing.
>>>>>
>>>>> Regards,
>>>>> Thejan
>>>>>
>>>>> On Tue, Oct 31, 2017 at 2:54 PM, Chaminda Jayawardena <
>>>>> chami...@wso2.com> wrote:
>>>>>
>>>>>>
>>>>>> seems a known issue and the ESB document has been updated with the
>>>>>> info.
>>>>>>
>>>>>> [1] https://docs.wso2.com/display/ESB500/Installation+Prerequisites
>>>>>>
>>>>>> Thanks
>>>>>> Chaminda
>>>>>>
>>>>>> On Tue, Oct 31, 2017 at 10:21 AM, Thejan Rupasinghe <the...@wso2.com>
>>>>>> wrote:
>>>>>>
>>>>>>> Hi all,
>>>>>>>
>>>>>>> When I'm working with EI Management Console with the latest Java 8
>>>>>>> version, 1.8.0_151 [1], following error occurred.
>>>>>>>
>>>>>>> [2017-10-30 19:14:54,210] [EI-Core]  WARN - JavaLogger potential
>>>>>>> cross-site request forgery (CSRF) attack thwarted (user:,
>>>>>>> ip:10.100.4.201, method:POST, 
>>>>>>> uri:/carbon/admin/jsp/WSRequestXSSproxy_ajaxprocessor.jsp,
>>>>>>> error:required token is missing from the request)
>>>>>>>
>>>>>>> I could not submit any form data through Management Console.
>>>>>>>
>>>>>>> I tested with EI 6.1.1 and current update, EI 6.1.1-update 7, but
>>>>>>> the same error occurred.
>>>>>>>
>>>>>>> When I use Java 1.8.0_144, everything works fine.
>>>>>>>
>>>>>>> Can anyone explain why does this happen?
>>>>>>>
>>>>>>> [1] https://java.com/en/download/
>>>>>>>
>>>>>>> Thanks,
>>>>>>> Regards,
>>>>>>> Thejan
>>>>>>> --
>>>>>>>
>>>>>>> *Thejan Rupasinghe*
>>>>>>>
>>>>>>> *Intern - Software EngineeringWSO2*
>>>>>>>
>>>>>>> *Mobile : +94 77-9020962 <+94%2077%20902%200962>*
>>>>>>> <https://wso2.com/signature>
>>>>>>>
>>>>>>> ___
>>>>>>> Dev mailing list
>>>>>>> Dev@wso2.org
>>>>>>> http://wso2.org/cgi-bin/mailman/listinfo/dev
>>>>>>>
>>>>>>>
>>>>>>
>>>>>>
>>>>>> --
>>>>>> Thanks & Regards
>>>>>>
>>>>>> *Chaminda Jayawardena*
>>>>>> Associate Technical Lead - QA
>>>>>> WSO2 Inc. - http://wso2.com
>>>>>> +94-77-7725234 <+94%2077%20772%205234>
>>>>>>
>>>>>
>>>>>
>>>>>
>>>>> --
>>>>>
>>>>> *Thejan Rupasinghe*
>>>>>
>>>>> *Intern - Software EngineeringWSO2*
>>>>>
>>>>> *Mobile : +94 77-9020962 <+94%2077%20902%200962>*
>>>>> <https://wso2.com/signature>
>>>>>
>>>>> ___
>>>>> Dev mailing list
>>>>> Dev@wso2.org
>>>>> http://wso2.org/cgi-bin/mailman/listinfo/dev
>>>>>
>>>>>
>>>>
>>>>
>>>> --
>>>> Prakhash Sivakumar
>>>> Software Engineer | WSO2 Inc
>>>> Platform Security Team
>>>> Mobile : +94771510080 <+94%2077%20151%200080>
>>>> Blog : https://medium.com/@PrakhashS
>>>>
>>>> ___
>>>> Dev mailing list
>>>> Dev@wso2.org
>>>> http://wso2.org/cgi-bin/mailman/listinfo/dev
>>>>
>>>>
>>>
>>>
>>> --
>>> Sudharma Subasinghe,
>>> Software Engineer,
>>> WSO2 Inc.
>>> Email: sudhar...@wso2.com <hasi...@wso2.com>
>>> Mobile : +94 710 565 157 <%2B94%20718%20210%20200>
>>>
>>
>>
>>
>> --
>> Sudharma Subasinghe,
>> Software Engineer,
>> WSO2 Inc.
>> Email: sudhar...@wso2.com <hasi...@wso2.com>
>> Mobile : +94 710 565 157 <%2B94%20718%20210%20200>
>>
>> ___
>> Dev mailing list
>> Dev@wso2.org
>> http://wso2.org/cgi-bin/mailman/listinfo/dev
>>
>>
>
>
> --
> *Sugunakumar Arunan*
> Sofware Engineering - Intern | WSO2
>
> Email : aru...@wso2.com
> Mobile : 0766016272
> Web : http://wso2.com
> <http://wso2.com/signature>
>



-- 
Sudharma Subasinghe,
Software Engineer,
WSO2 Inc.
Email: sudhar...@wso2.com <hasi...@wso2.com>
Mobile : +94 710 565 157 <%2B94%20718%20210%20200>
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] CSRF token error in working with EI Management Console with Java 1.8.0_151

2017-11-06 Thread Sudharma Subasinghe
Hi Prakash,

Still with jdk1.8.0_144, same issue happens with EI 6.1.1-update 8 pack

On Mon, Nov 6, 2017 at 8:06 PM, Sudharma Subasinghe <sudhar...@wso2.com>
wrote:

> Same thing is happening with EI 6.1.1-update 8 with JDK 1.8.0_45.
>
>
> On Wed, Nov 1, 2017 at 7:14 AM, Prakhash Sivakumar <prakh...@wso2.com>
> wrote:
>
>>
>>
>> On Tue, Oct 31, 2017 at 3:20 PM, Thejan Rupasinghe <the...@wso2.com>
>> wrote:
>>
>>> Hi Chaminda,
>>>
>>> Seems it is an issue in the Tomcat server with that jdk update.
>>>
>> Yes. This is happining due to a gzip decoding issue with JDK 1.8.0_151,
>> which is reported in [1] .
>>
>> [1] https://bugs.openjdk.java.net/browse/JDK-8189789
>>
>>
>>> Thanks for informing.
>>>
>>> Regards,
>>> Thejan
>>>
>>> On Tue, Oct 31, 2017 at 2:54 PM, Chaminda Jayawardena <chami...@wso2.com
>>> > wrote:
>>>
>>>>
>>>> seems a known issue and the ESB document has been updated with the info.
>>>>
>>>> [1] https://docs.wso2.com/display/ESB500/Installation+Prerequisites
>>>>
>>>> Thanks
>>>> Chaminda
>>>>
>>>> On Tue, Oct 31, 2017 at 10:21 AM, Thejan Rupasinghe <the...@wso2.com>
>>>> wrote:
>>>>
>>>>> Hi all,
>>>>>
>>>>> When I'm working with EI Management Console with the latest Java 8
>>>>> version, 1.8.0_151 [1], following error occurred.
>>>>>
>>>>> [2017-10-30 19:14:54,210] [EI-Core]  WARN - JavaLogger potential
>>>>> cross-site request forgery (CSRF) attack thwarted (user:,
>>>>> ip:10.100.4.201, method:POST, 
>>>>> uri:/carbon/admin/jsp/WSRequestXSSproxy_ajaxprocessor.jsp,
>>>>> error:required token is missing from the request)
>>>>>
>>>>> I could not submit any form data through Management Console.
>>>>>
>>>>> I tested with EI 6.1.1 and current update, EI 6.1.1-update 7, but the
>>>>> same error occurred.
>>>>>
>>>>> When I use Java 1.8.0_144, everything works fine.
>>>>>
>>>>> Can anyone explain why does this happen?
>>>>>
>>>>> [1] https://java.com/en/download/
>>>>>
>>>>> Thanks,
>>>>> Regards,
>>>>> Thejan
>>>>> --
>>>>>
>>>>> *Thejan Rupasinghe*
>>>>>
>>>>> *Intern - Software EngineeringWSO2*
>>>>>
>>>>> *Mobile : +94 77-9020962 <+94%2077%20902%200962>*
>>>>> <https://wso2.com/signature>
>>>>>
>>>>> ___
>>>>> Dev mailing list
>>>>> Dev@wso2.org
>>>>> http://wso2.org/cgi-bin/mailman/listinfo/dev
>>>>>
>>>>>
>>>>
>>>>
>>>> --
>>>> Thanks & Regards
>>>>
>>>> *Chaminda Jayawardena*
>>>> Associate Technical Lead - QA
>>>> WSO2 Inc. - http://wso2.com
>>>> +94-77-7725234 <+94%2077%20772%205234>
>>>>
>>>
>>>
>>>
>>> --
>>>
>>> *Thejan Rupasinghe*
>>>
>>> *Intern - Software EngineeringWSO2*
>>>
>>> *Mobile : +94 77-9020962 <+94%2077%20902%200962>*
>>> <https://wso2.com/signature>
>>>
>>> ___
>>> Dev mailing list
>>> Dev@wso2.org
>>> http://wso2.org/cgi-bin/mailman/listinfo/dev
>>>
>>>
>>
>>
>> --
>> Prakhash Sivakumar
>> Software Engineer | WSO2 Inc
>> Platform Security Team
>> Mobile : +94771510080 <+94%2077%20151%200080>
>> Blog : https://medium.com/@PrakhashS
>>
>> ___
>> Dev mailing list
>> Dev@wso2.org
>> http://wso2.org/cgi-bin/mailman/listinfo/dev
>>
>>
>
>
> --
> Sudharma Subasinghe,
> Software Engineer,
> WSO2 Inc.
> Email: sudhar...@wso2.com <hasi...@wso2.com>
> Mobile : +94 710 565 157 <%2B94%20718%20210%20200>
>



-- 
Sudharma Subasinghe,
Software Engineer,
WSO2 Inc.
Email: sudhar...@wso2.com <hasi...@wso2.com>
Mobile : +94 710 565 157 <%2B94%20718%20210%20200>
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] CSRF token error in working with EI Management Console with Java 1.8.0_151

2017-11-06 Thread Sudharma Subasinghe
Same thing is happening with EI 6.1.1-update 8 with JDK 1.8.0_45.


On Wed, Nov 1, 2017 at 7:14 AM, Prakhash Sivakumar <prakh...@wso2.com>
wrote:

>
>
> On Tue, Oct 31, 2017 at 3:20 PM, Thejan Rupasinghe <the...@wso2.com>
> wrote:
>
>> Hi Chaminda,
>>
>> Seems it is an issue in the Tomcat server with that jdk update.
>>
> Yes. This is happining due to a gzip decoding issue with JDK 1.8.0_151,
> which is reported in [1] .
>
> [1] https://bugs.openjdk.java.net/browse/JDK-8189789
>
>
>> Thanks for informing.
>>
>> Regards,
>> Thejan
>>
>> On Tue, Oct 31, 2017 at 2:54 PM, Chaminda Jayawardena <chami...@wso2.com>
>> wrote:
>>
>>>
>>> seems a known issue and the ESB document has been updated with the info.
>>>
>>> [1] https://docs.wso2.com/display/ESB500/Installation+Prerequisites
>>>
>>> Thanks
>>> Chaminda
>>>
>>> On Tue, Oct 31, 2017 at 10:21 AM, Thejan Rupasinghe <the...@wso2.com>
>>> wrote:
>>>
>>>> Hi all,
>>>>
>>>> When I'm working with EI Management Console with the latest Java 8
>>>> version, 1.8.0_151 [1], following error occurred.
>>>>
>>>> [2017-10-30 19:14:54,210] [EI-Core]  WARN - JavaLogger potential
>>>> cross-site request forgery (CSRF) attack thwarted (user:,
>>>> ip:10.100.4.201, method:POST, 
>>>> uri:/carbon/admin/jsp/WSRequestXSSproxy_ajaxprocessor.jsp,
>>>> error:required token is missing from the request)
>>>>
>>>> I could not submit any form data through Management Console.
>>>>
>>>> I tested with EI 6.1.1 and current update, EI 6.1.1-update 7, but the
>>>> same error occurred.
>>>>
>>>> When I use Java 1.8.0_144, everything works fine.
>>>>
>>>> Can anyone explain why does this happen?
>>>>
>>>> [1] https://java.com/en/download/
>>>>
>>>> Thanks,
>>>> Regards,
>>>> Thejan
>>>> --
>>>>
>>>> *Thejan Rupasinghe*
>>>>
>>>> *Intern - Software EngineeringWSO2*
>>>>
>>>> *Mobile : +94 77-9020962 <+94%2077%20902%200962>*
>>>> <https://wso2.com/signature>
>>>>
>>>> ___
>>>> Dev mailing list
>>>> Dev@wso2.org
>>>> http://wso2.org/cgi-bin/mailman/listinfo/dev
>>>>
>>>>
>>>
>>>
>>> --
>>> Thanks & Regards
>>>
>>> *Chaminda Jayawardena*
>>> Associate Technical Lead - QA
>>> WSO2 Inc. - http://wso2.com
>>> +94-77-7725234 <+94%2077%20772%205234>
>>>
>>
>>
>>
>> --
>>
>> *Thejan Rupasinghe*
>>
>> *Intern - Software EngineeringWSO2*
>>
>> *Mobile : +94 77-9020962 <+94%2077%20902%200962>*
>> <https://wso2.com/signature>
>>
>> ___
>> Dev mailing list
>> Dev@wso2.org
>> http://wso2.org/cgi-bin/mailman/listinfo/dev
>>
>>
>
>
> --
> Prakhash Sivakumar
> Software Engineer | WSO2 Inc
> Platform Security Team
> Mobile : +94771510080 <+94%2077%20151%200080>
> Blog : https://medium.com/@PrakhashS
>
> ___
> Dev mailing list
> Dev@wso2.org
> http://wso2.org/cgi-bin/mailman/listinfo/dev
>
>


-- 
Sudharma Subasinghe,
Software Engineer,
WSO2 Inc.
Email: sudhar...@wso2.com <hasi...@wso2.com>
Mobile : +94 710 565 157 <%2B94%20718%20210%20200>
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] Enrich mediator Issue with Json in wso2 esb

2017-10-29 Thread Sudharma Subasinghe
These fixes are available with the latest release Enterprise Integrator
6.1.1-update7. which is available for download from here
<https://github.com/wso2/product-ei/releases/tag/v6.1.1-update7>.

Thanks
Sudharma

On Sun, Oct 29, 2017 at 12:58 PM, aditya shivankar <
shivankar.adit...@gmail.com> wrote:

> Hi Sudharma,
>
> Thanks for the reply.
> Request you to please provide a link to download the version of wso2 esb(WSO2
> EI) , in which these defects are fixed. So that I do not end up , in
> downloading wrong versions.
> Thanks
>
> With Regards,
> Aditya
>
> On Fri, Oct 27, 2017 at 4:49 PM, Sudharma Subasinghe <sudhar...@wso2.com>
> wrote:
>
>> Hi Aditya,
>>
>> This has been fixed with[1] and you can try with latest WSO2 Enterprise
>> Integrator(WSO2 EI), integrator profile. There you can avoid above both
>> issues by enabling *synapse.json.to.xml.processing.instruction.enable *in
>> synapse.properties file.
>>
>> Please refer[2] for more info about using EI.
>>
>> [1] https://wso2.org/jira/browse/ESBJAVA-4721
>> [2] https://docs.wso2.com/display/EI611/
>>
>> Thanks
>> Sudharma
>>
>> On Thu, Oct 26, 2017 at 3:00 PM, aditya shivankar <
>> shivankar.adit...@gmail.com> wrote:
>>
>>> Hi,
>>>
>>> Few more similar things, I found regarding this same flow .
>>> If the request consists of an empty. It gets disappeared in response
>>> completely.
>>> For E.g.
>>>
>>> Request :
>>>{
>>> "id" : "3",
>>> "parts" : ["Screen"],
>>> "test" : [],
>>> "numberTest" : 40
>>> }
>>>
>>>
>>> Actual Response :
>>> {
>>> "id": "3",
>>> "parts": "Screen",
>>> "numberTest": "40",
>>> "make": "Tamsung"
>>>}
>>>
>>> Desired Response :
>>> {
>>>"id": "3",
>>>"parts": ["Screen"],
>>>"test" : [],
>>>"numberTest": "40",
>>>"make": "Tamsung"
>>> }
>>>
>>>
>>> Issue :
>>>
>>>   In the actual response , the empty array named "test" is missing.
>>>
>>>   So overall there are two issues scenarios.
>>> 1. When there is a array in request , with a single(one) element in it .
>>> 2. When there is an empty array in request.
>>>
>>>
>>> With Regards,
>>> Aditya
>>> 
>>> 
>>> ---
>>>
>>> On Wed, Oct 25, 2017 at 5:37 PM, aditya shivankar <
>>> shivankar.adit...@gmail.com> wrote:
>>>
>>>> Hi,
>>>>
>>>> Let me reformat(summarize) the remaining issue now, as one issue is
>>>> resolved.
>>>> The issue which still needs to be addressed is.
>>>>
>>>>
>>>> Below is the sample service I have created to Highlight the issue I am
>>>> facing in my project(In actual project service, the request and response
>>>> are very big, dynamic and this issue is repeating at many places).
>>>>
>>>> Request : { "id" : "3", "parts" : ["Screen"] }
>>>>
>>>> Actual Response : { "id": "3", "parts": "Screen", "make": "Tamsung" }
>>>>
>>>> Desired Response :
>>>>
>>>> { "id": "3", "parts": ["Screen"], "make": "Tamsung" }
>>>> --
>>>>
>>>> Issue :
>>>>
>>>>1.
>>>>
>>>>"parts": "Screen",
>>>>
>>>>should have been like below
>>>>
>>>>"parts": ["Screen"],
>>>>
>>>>i.e. it does not remain array anymore. I understand the array
>>>>consist only one element. But the third party system to which the 
>>>> output of
>>>>this service is sen

Re: [Dev] Enrich mediator Issue with Json in wso2 esb

2017-10-27 Thread Sudharma Subasinghe
Hi Aditya,

This has been fixed with[1] and you can try with latest WSO2 Enterprise
Integrator(WSO2 EI), integrator profile. There you can avoid above both
issues by enabling *synapse.json.to.xml.processing.instruction.enable *in
synapse.properties file.

Please refer[2] for more info about using EI.

[1] https://wso2.org/jira/browse/ESBJAVA-4721
[2] https://docs.wso2.com/display/EI611/

Thanks
Sudharma

On Thu, Oct 26, 2017 at 3:00 PM, aditya shivankar <
shivankar.adit...@gmail.com> wrote:

> Hi,
>
> Few more similar things, I found regarding this same flow .
> If the request consists of an empty. It gets disappeared in response
> completely.
> For E.g.
>
> Request :
>{
> "id" : "3",
> "parts" : ["Screen"],
> "test" : [],
> "numberTest" : 40
> }
>
>
> Actual Response :
> {
> "id": "3",
> "parts": "Screen",
> "numberTest": "40",
> "make": "Tamsung"
>}
>
> Desired Response :
> {
>"id": "3",
>"parts": ["Screen"],
>"test" : [],
>"numberTest": "40",
>"make": "Tamsung"
> }
>
>
> Issue :
>
>   In the actual response , the empty array named "test" is missing.
>
>   So overall there are two issues scenarios.
> 1. When there is a array in request , with a single(one) element in it .
> 2. When there is an empty array in request.
>
>
> With Regards,
> Aditya
> 
> 
> ---
>
> On Wed, Oct 25, 2017 at 5:37 PM, aditya shivankar <
> shivankar.adit...@gmail.com> wrote:
>
>> Hi,
>>
>> Let me reformat(summarize) the remaining issue now, as one issue is
>> resolved.
>> The issue which still needs to be addressed is.
>>
>>
>> Below is the sample service I have created to Highlight the issue I am
>> facing in my project(In actual project service, the request and response
>> are very big, dynamic and this issue is repeating at many places).
>>
>> Request : { "id" : "3", "parts" : ["Screen"] }
>>
>> Actual Response : { "id": "3", "parts": "Screen", "make": "Tamsung" }
>>
>> Desired Response :
>>
>> { "id": "3", "parts": ["Screen"], "make": "Tamsung" }
>> --
>>
>> Issue :
>>
>>1.
>>
>>"parts": "Screen",
>>
>>should have been like below
>>
>>"parts": ["Screen"],
>>
>>i.e. it does not remain array anymore. I understand the array consist
>>only one element. But the third party system to which the output of this
>>service is sent as input(request) expects the element as array. So I need
>>it to be as array.
>>
>> 
>> 
>>
>> I think , I cannot recreate the message using payloadFactory  because,
>>" the message(payload) I am modifying with enrich mediator is a "huge
>> and dynamic response from Third party service". This response I need to
>> modify/enrich at many places in my service and send it to another third
>> party service as input.
>>
>>With "Dynamic" :  I mean, some things in the message(payload) are
>> different(change) everytime service receives the request, depending on some
>> factors in the request received by the third party service whose output is
>> input message to this service.
>>
>>so I think I cannot recreate message using payloadFactory like this
>>
>>
>>  {"id" : $1, "parts" : $2, "make" : "Tamsung"}
>>   
>>  
>>  
>>   
>> 
>>
>>as it will be dynamic response from a third party service.
>> So we cannot recreate the message in payloadFactory it being not static.
>>
>> 
>> 
>>
>> arrayTest.xml :
>>
>> 
>> http://ws.apache.org/ns
>> /synapse">
>> 
>> 
>>
>> 
>> 
>> Tamsung
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>>
>> 
>> 
>> 
>> 
>> 
>> 
>>
>> 
>> 
>> --
>>
>> Please guide...
>>
>> With Regards,
>> Aditya
>>
>
>


-- 
Sudharma Subasinghe,
Software Engineer,
WSO2 Inc.
Email: sudhar...@wso2.com <hasi...@wso2.com>
Mobile : +94 710 565 157 <%2B94%20718%20210%20200>
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] Fwd: Enrich mediator Issue with Json in wso2 esb

2017-10-25 Thread Sudharma Subasinghe
Ok aditya, got the whole idea of your question.Can I know the esb version
which is used ?

On 25 Oct 2017 17:37, "aditya shivankar" 
wrote:

Hi,

Let me reformat(summarize) the remaining issue now, as one issue is
resolved.
The issue which still needs to be addressed is.


Below is the sample service I have created to Highlight the issue I am
facing in my project(In actual project service, the request and response
are very big, dynamic and this issue is repeating at many places).

Request : { "id" : "3", "parts" : ["Screen"] }

Actual Response : { "id": "3", "parts": "Screen", "make": "Tamsung" }

Desired Response :

{ "id": "3", "parts": ["Screen"], "make": "Tamsung" }
--

Issue :

   1.

   "parts": "Screen",

   should have been like below

   "parts": ["Screen"],

   i.e. it does not remain array anymore. I understand the array consist
   only one element. But the third party system to which the output of this
   service is sent as input(request) expects the element as array. So I need
   it to be as array.




I think , I cannot recreate the message using payloadFactory  because,
   " the message(payload) I am modifying with enrich mediator is a "huge
and dynamic response from Third party service". This response I need to
modify/enrich at many places in my service and send it to another third
party service as input.

   With "Dynamic" :  I mean, some things in the message(payload) are
different(change) everytime service receives the request, depending on some
factors in the request received by the third party service whose output is
input message to this service.

   so I think I cannot recreate message using payloadFactory like this

   
 {"id" : $1, "parts" : $2, "make" : "Tamsung"}
  
 
 
  


   as it will be dynamic response from a third party service.
So we cannot recreate the message in payloadFactory it being not static.




arrayTest.xml :


http://ws.apache.org/ns
/synapse">





Tamsung

















--

Please guide...

With Regards,
Aditya
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] Enrich mediator Issue with Json in wso2 esb

2017-10-25 Thread Sudharma Subasinghe
Hi Aditya,

You can have [] with one json element using PayloadFactory mediator. I
tried below instead of enrich mediator and it worked for both single
element and multiple elements.


 {"id" : $1, "parts" : $2, "make" : "Tamsung"}
  
 
 
  


Thanks
Sudharma

On Wed, Oct 25, 2017 at 12:32 PM, Manorama Perera <manor...@wso2.com> wrote:

> Hi Aditya,
>
> In order to preserve the double quotations around the numbers, you can
> configure the below property in /repository/conf/
> synapse.properties
>
> synapse.commons.json.output.autoPrimitive=false
>
> Thanks,
> Manorama
>
> On Wed, Oct 25, 2017 at 11:31 AM, aditya shivankar <
> shivankar.adit...@gmail.com> wrote:
>
>> Below is the sample service I have created to Highlight the issues I am
>> facing in my project(where the request and response are very big and these
>> issues are repeating at many places).
>>
>> Request :
>> {
>> "id" : "3",
>> "parts" : ["Screen"]
>> }
>>
>> Actual Response :
>> {
>> "id": 3,
>> "parts": "Screen",
>> "make": "Tamsung"
>> }
>>
>> Desired Response  :
>>
>> {
>> "id": "3",
>> "parts": ["Screen"],
>> "make": "Tamsung"
>> }
>>
>> 
>> ---
>> Issues :
>>
>> 1. "parts": "Screen",
>>
>>should have been like below
>>
>>"parts": ["Screen"],
>>
>>   i.e. it does not remain array anymore. I understand the array
>> consist only one element. But the third party system to which the output of
>> this service is sent as input(request) expects the element as array. So I
>> need it to be as array.
>>
>> 2."id": 3,
>>
>> should have been like below
>> "id": "3",
>> i.e. the string should have been kept as string.
>>
>>
>> 
>> ---
>> arrayTest.xml :
>>
>> 
>> http://ws.apache.org/ns
>> /synapse">
>> 
>>     
>>
>> 
>> 
>> Tamsung
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>>
>> 
>> 
>> 
>> 
>> 
>> 
>>
>>
>>
>>
>>
>>
>> ___
>> Dev mailing list
>> Dev@wso2.org
>> http://wso2.org/cgi-bin/mailman/listinfo/dev
>>
>>
>
>
> --
> Manorama Perera
> Software Engineer
> WSO2, Inc.;  http://wso2.com/
>
> ___
> Dev mailing list
> Dev@wso2.org
> http://wso2.org/cgi-bin/mailman/listinfo/dev
>
>


-- 
Sudharma Subasinghe,
Software Engineer,
WSO2 Inc.
Email: sudhar...@wso2.com <hasi...@wso2.com>
Mobile : +94 710 565 157 <%2B94%20718%20210%20200>
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] Via the BPS Activiti web service, how to retrieve the list of the completed tasks and their comment in a running process

2017-10-20 Thread Sudharma Subasinghe
Hi Thomas,

First, please ensure that you have retrieved correct taskId for completed
tasks. Then you should be able to get completed task instance by sending a
GET request to *bpmn/history/historic-task-**instances/. *You
cannot get completed task instance details using */runtime* service. Hence
it returns 404.

We are not supporting to get comments by historic task instance ids as it
is not specified in the activiti spec[1].

You can get comments for historic process instance by
*/bpmn/history/historic-process-instances/{process-instance-id}/comments/*
and then it returns all the comments. In the response array you can find
completed tasks also. It contains *processInstanceUrl* and by invoking that
url you can get comments for completed tasks.


[1] https://www.activiti.org/userguide/#_history

Thanks
Sudharma

On Thu, Oct 19, 2017 at 6:00 PM, Thomas LEGRAND <
thomas.legr...@versusmind.eu> wrote:

> Hello everybody,
>
> I have a process where one or more user tasks that can be completed while
> the process is not yet finished. But, my problem is to retrieve those
> completed task to have access to their comments. All of that by using the
> REST web service.
>
> I know we can retrieve the completed tasks, and their comment because the
> Web UI provided by WSO2 allows so [1] & [2]
>
> To illustrate what I am talking about, you can find my process definition
> in [3].
>
> What I tried, for the moment, is to retrieve the list of activities via
> the endpoint /bpmn/history/historic-activity-instances?
> processInstanceId=. From here, I can retrieve the
> taskId of the completed task but I can't find a way to retrieve the
> information concerning it, nor its comment. I tried via :
>
> - /bpmn/runtime/tasks/ => returns 404
> - /bpmn/runtime/tasks//comments => returns 404
> - /bpmn/history/historic-task-instances?taskId= => returns empty
> list (even if I filter by processInstanceId)
> - /bpmn/history/historic-task-instances/ => returns 404
>
> Can you help me, please?
>
> [1] [image: Images intégrées 2]
>
> [2] [image: Images intégrées 3]
>
> [3]
> [image: Images intégrées 1]
>
> ___
> Dev mailing list
> Dev@wso2.org
> http://wso2.org/cgi-bin/mailman/listinfo/dev
>
>


-- 
Sudharma Subasinghe,
Software Engineer,
WSO2 Inc.
Email: sudhar...@wso2.com <hasi...@wso2.com>
Mobile : +94 710 565 157 <%2B94%20718%20210%20200>
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] Endpoint Template Dynamic Endpoint Format

2017-10-04 Thread Sudharma Subasinghe
Hi Junior,

You can observe that there is no option to set format with parameter from
UI as there are per-defined list for format. AFAIU setting format in
Endpoint Template is not possible with parameterized value.

Thanks
Sudharma

On Wed, Oct 4, 2017 at 2:31 AM, Júnior <fjunio...@gmail.com> wrote:

> Hi,
>
> Is it possible to make the Endpoint Dynamic? I am trying to use the format
> as a parameter to a endpoint template, but it seems to not be working.
>
> Is it possible to make this property dynamic?
>
> Follow the config I am trying to use:
>
>
> http://ws.apache.org/ns/synapse;
> name="AGE_Endpoint_Template">
>http://ws.apache.org/ns/synapse;
> name="format"/>
>http://ws.apache.org/ns/synapse;
> name="timeout"/>
>
>   
>  
> -1
> 1.0
>  
>  
> -1
> 0
> 0
>  
>  
> fault
>  
>   
>
> 
>
>
>
>
> Thanks,
>
> --
> Francisco Ribeiro
> *SCEA|SCJP|SCWCD|IBM Certified SOA Associate*
>
> ___
> Dev mailing list
> Dev@wso2.org
> http://wso2.org/cgi-bin/mailman/listinfo/dev
>
>


-- 
Sudharma Subasinghe,
Software Engineer,
WSO2 Inc.
Email: sudhar...@wso2.com <hasi...@wso2.com>
Mobile : +94 710 565 157 <%2B94%20718%20210%20200>
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] How to catch an error from the REST Task in the BPMN

2017-09-29 Thread Sudharma Subasinghe
Hi Thomas,

Can you try without setting *errorRef, *so as in [1] the boundary error
event will catch any error event.

[1] https://www.activiti.org/userguide/#bpmnBoundaryErrorEventXml

On Thu, Sep 28, 2017 at 12:38 PM, Thomas LEGRAND <
thomas.legr...@versusmind.eu> wrote:

> Hello,
>
> Thank you for your answers but what if my configured JSON path is not
> applicable for the returned body in case of an error triggered in the web
> service side? I mean, there is two cases :
> - I request something and this something is returned by the web service.
> The REST task uses the configured JSON path to set an attribute.
> - I request something but this something does not exist. So the web
> service sends me a 404 HTTP code with another body (like an empty one or
> even a JSON object modelizing an error with a business error code and a
> message). This body does not correspond at all to the configured JSON path.
> So, the exception is triggered:
>
> Unknown Exception occurred
>> com.jayway.jsonpath.PathNotFoundException: No results for path:
>> 
>
>
> The ErrorBoundaryEvent will not "catch" this error. Is there a way to
> configure the ErrorBoundaryEvent to catch whatever error is popping, or
> should I create a ErrorBoundaryEvent for each error? Meaning that I don't
> know what is the name of the error spawning where the JSON path is wrong.
>
> Regards,
>
> Thomas
>
> 2017-09-28 6:34 GMT+02:00 Sudharma Subasinghe <sudhar...@wso2.com>:
>
>> Hi Thomas,
>>
>> You can add ErrorBoundaryEvent with error code as* "RestInvokeError"*.
>> Please refer [1] as an example.
>>
>> [1] http://wso2.com/library/articles/2016/04/article-how-to-
>> model-bpmn-business-processes-with-wso2-business-process-server/#error
>>
>> Thanks
>> Sudharma
>>
>> On Wed, Sep 27, 2017 at 8:04 PM, Thomas LEGRAND <
>> thomas.legr...@versusmind.eu> wrote:
>>
>>> Hello there,
>>>
>>> I would like to catch an error from the REST task in my process.
>>> Actually, my distant web service returns a 404 with an empty body if no
>>> result was found. If something was found, I map an element from the
>>> returned JSON into a variable and that works.
>>>
>>> In the case of my 404, I have a NPE and I would like to catch it to be
>>> able to continue the process but I don't know how to do because the
>>> ErrorBoundaryEvent I attached does not work at all.
>>>
>>> Can you help me, please?
>>>
>>> Regards,
>>>
>>> Thomas
>>>
>>> ___
>>> Dev mailing list
>>> Dev@wso2.org
>>> http://wso2.org/cgi-bin/mailman/listinfo/dev
>>>
>>>
>>
>>
>> --
>> Sudharma Subasinghe,
>> Software Engineer,
>> WSO2 Inc.
>> Email: sudhar...@wso2.com <hasi...@wso2.com>
>> Mobile : +94 710 565 157 <%2B94%20718%20210%20200>
>>
>
>


-- 
Sudharma Subasinghe,
Software Engineer,
WSO2 Inc.
Email: sudhar...@wso2.com <hasi...@wso2.com>
Mobile : +94 710 565 157 <%2B94%20718%20210%20200>
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] How to catch an error from the REST Task in the BPMN

2017-09-27 Thread Sudharma Subasinghe
Hi Thomas,

You can add ErrorBoundaryEvent with error code as* "RestInvokeError"*.
Please refer [1] as an example.

[1]
http://wso2.com/library/articles/2016/04/article-how-to-model-bpmn-business-processes-with-wso2-business-process-server/#error

Thanks
Sudharma

On Wed, Sep 27, 2017 at 8:04 PM, Thomas LEGRAND <
thomas.legr...@versusmind.eu> wrote:

> Hello there,
>
> I would like to catch an error from the REST task in my process. Actually,
> my distant web service returns a 404 with an empty body if no result was
> found. If something was found, I map an element from the returned JSON into
> a variable and that works.
>
> In the case of my 404, I have a NPE and I would like to catch it to be
> able to continue the process but I don't know how to do because the
> ErrorBoundaryEvent I attached does not work at all.
>
> Can you help me, please?
>
> Regards,
>
> Thomas
>
> ___
> Dev mailing list
> Dev@wso2.org
> http://wso2.org/cgi-bin/mailman/listinfo/dev
>
>


-- 
Sudharma Subasinghe,
Software Engineer,
WSO2 Inc.
Email: sudhar...@wso2.com <hasi...@wso2.com>
Mobile : +94 710 565 157 <%2B94%20718%20210%20200>
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] Fwd: Call Third party web service and Enriching the original message

2017-09-26 Thread Sudharma Subasinghe
ct
> M: +94 777 219 791 <+94%2077%20721%209791>
> Tel : 94 11 214 5345
> Fax :94 11 2145300
> Skype : malaka.sampath.silva
> LinkedIn : http://www.linkedin.com/pub/malaka-silva/6/33/77
> Blog : http://mrmalakasilva.blogspot.com/
>
> WSO2, Inc.
> lean . enterprise . middleware
> https://wso2.com/signature
> http://www.wso2.com/about/team/malaka-silva/
> <http://wso2.com/about/team/malaka-silva/>
> https://store.wso2.com/store/
>
> Don't make Trees rare, we should keep them with care
>
> ___
> Dev mailing list
> Dev@wso2.org
> http://wso2.org/cgi-bin/mailman/listinfo/dev
>
>


-- 
Sudharma Subasinghe,
Software Engineer,
WSO2 Inc.
Email: sudhar...@wso2.com <hasi...@wso2.com>
Mobile : +94 710 565 157 <%2B94%20718%20210%20200>
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] HTTP POST multipart/form-data via ESB

2017-09-22 Thread Sudharma Subasinghe
Hi Vivek,

If your problem is regarding not adding boundary, try the fix in[1]
relevant version, build and apply that jar as a patch. (Assuming you are
using APIM210)

[1] https://github.com/wso2/pro duct-ei/issues/780

Thanks
Sudharma

On Fri, Sep 22, 2017 at 2:12 PM, vivekkumar <vivek.kum...@fisglobal.com>
wrote:

> Hi
>
> I believe boundary issue has been fixed in July.
> In my case problem is that its not copying the content of file from Input
> to
> Backend service.
>
> I might be using the wrong syntax for copying the content. I just used the
> configuration mentioned in the original email.
>
> Cheers
> Vivek
>
>
>
>
>
> --
> Sent from: http://wso2-oxygen-tank.10903.n7.nabble.com/WSO2-
> Development-f3.html
> ___
> Dev mailing list
> Dev@wso2.org
> http://wso2.org/cgi-bin/mailman/listinfo/dev
>



-- 
Sudharma Subasinghe,
Software Engineer,
WSO2 Inc.
Email: sudhar...@wso2.com <hasi...@wso2.com>
Mobile : +94 710 565 157 <%2B94%20718%20210%20200>
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] Dynamic routing key on rabbitmq endpoint

2017-09-18 Thread Sudharma Subasinghe
Hi Norberto,

You can try endpoint template[1] to define parameter values, and then refer
those values in uri using '$' sign.

[1] https://docs.wso2.com/display/ESB500/Endpoint+Template

Thanks
Sudharma

On Mon, Sep 18, 2017 at 1:25 PM, Vinod Kavinda <vi...@wso2.com> wrote:

> Hi,
> Can you try using "get-property('sendToThisQueue')" other than using
> the context. Found this blog post[1] by a wso2 developer that may useful.
>
> [1] - http://wso2tech.blogspot.com/2015/06/wso2-esb-dynamic-
> jms-endpoint.html
>
> Regards,
> Vinod
>
> On Mon, Sep 18, 2017 at 1:13 PM, Norberto Fernandes <
> norbe...@memoryvox.com> wrote:
>
>> Hi Developers,
>>
>> Could you please let me know if it is possible to pass a variable into a
>> rabbitmq endpoint?
>>
>> I would like to set the routing key dynamically. So I was trying to use a
>> property from the context and define the routing key based on that
>> property. But I could not make it work.
>>
>> I tried :
>>
>> > key={ctx:key}rabbitmq...”/>
>>
>> Where key is the context property where I have the desired value of the
>> routing key.
>>
>> Thanks in advance.
>>
>> Regards,
>> Norberto
>>
>> ___
>> Dev mailing list
>> Dev@wso2.org
>> http://wso2.org/cgi-bin/mailman/listinfo/dev
>>
>>
>
>
> --
> Vinod Kavinda
> Senior Software Engineer
> *WSO2 Inc. - lean . enterprise . middleware <http://www.wso2.com>.*
> Mobile : +94 (0) 712 415544
> Blog : http://soatechflicks.blogspot.com/
> [image: http://wso2.com/signature]
> <http://wso2.com/signature>
>
>
> ___
> Dev mailing list
> Dev@wso2.org
> http://wso2.org/cgi-bin/mailman/listinfo/dev
>
>


-- 
Sudharma Subasinghe,
Software Engineer,
WSO2 Inc.
Email: sudhar...@wso2.com <hasi...@wso2.com>
Mobile : +94 710 565 157 <%2B94%20718%20210%20200>
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] [ESB 4.8.1] Respond with arrays in JSON and XML formats

2017-08-21 Thread Sudharma Subasinghe
Hi Lahiru,

You can try the script mediator to build the expected response which is
better than duplicating XSLTs.

Thanks
Sudharma

On Mon, Aug 21, 2017 at 9:15 PM, Lahiru Sandaruwan <lahi...@wso2.com> wrote:

> Hi,
>
> I want to change the responding content type based on Accept header(JSON
> or XML), sent in the request. My concern is the wrapping element of arrays.
> For example,
>
> Required Json response,
>
> [
> {
> "aaa" : "23432",
> "bbb" : "234",
> "ccc" : "asdfas"
> },
> {
> "aaa" : "23432",
> "bbb" : "234",
> "ccc" : "asdfas"
> },
> {
> "aaa" : "23432",
> "bbb" : "234",
> "ccc" : "asdfas"
> }
> ]
>
> Required XML response,
>
> 
> 
> 2342344
> 23432432432
> asdasdasd
> 
> 
> 234324
> 32432
> asdfasdf
> 
> 
> 234
> 34234
> asdf
> 
> 
>
> If I build local message with jsonArray and jsonElement as below, I could
> get the JSON response correctly. But XML response would be wrong, as it is
> not wrapped with accounts and account tags.
>
> 
> 
> 2342344
> 23432432432
> asdasdasd
> 
> 
> 234324
> 32432
> asdfasdf
> 
> 
> 234
> 34234
> asdf
> 
> 
>
> I'm building this message using a XSLT. I can think of using 2 XSLTs for
> two types. But that will duplicate XSLT just for this. Is there a better
> approach?
>
> Thanks.
> --
> --
>
> Lahiru Sandaruwan
> Associate Technical Lead,
> WSO2 Inc., http://wso2.com
>
> lean.enterprise.middleware
>
> m: +94773325954 <+94%2077%20332%205954>
> e: lahi...@wso2.com b: https://medium.com/@lahirugmg
> in: http://lk.linkedin.com/pub/lahiru-sandaruwan/16/153/146
>
>


-- 
Sudharma Subasinghe,
Software Engineer,
WSO2 Inc.
Email: sudhar...@wso2.com <hasi...@wso2.com>
Mobile : +94 710 565 157 <%2B94%20718%20210%20200>
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] Problem with response EI 6.1.1

2017-07-24 Thread Sudharma Subasinghe
Hi Melodias,

There is no problem with invoke proxy by proxy when first proxy has timeout
duration.

For all the endpoints which does not have a timeout, global timeout which
is located in synapse.properties "synapse.global_timeout_interval" is
considered. The default value is set to 120s.

Thanks
Sudharma

On Mon, Jul 24, 2017 at 2:47 PM, Melodias <osbtestmail...@gmail.com> wrote:

> Hi dev,
> I have flow: proxyA invoke proxyB and proxyB invoke backend. In this
> scenario I have timeout on proxyA. When I invoke proxyB I received a
> response.
>
> Is it a problem with invoke proxy by proxy in EI 6.1.1?
>
>
>
> --
> View this message in context: http://wso2-oxygen-tank.10903.
> n7.nabble.com/Problem-with-response-EI-6-1-1-tp150540.html
> Sent from the WSO2 Development mailing list archive at Nabble.com.
> ___
> Dev mailing list
> Dev@wso2.org
> http://wso2.org/cgi-bin/mailman/listinfo/dev
>



-- 
Sudharma Subasinghe,
Software Engineer,
WSO2 Inc.
Email: sudhar...@wso2.com <hasi...@wso2.com>
Mobile : +94 710 565 157 <%2B94%20718%20210%20200>
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] Adding responses as elements , to an array in json response

2017-07-20 Thread Sudharma Subasinghe
HI Aditya,

I tried the attached configs in the mail thread and could get expected
output as in above. Sorry for missing the point of backend service.

The xpath *get-property('firstResponse')/children* works for me and it will
add elements  to *children* element as in your config. Hope you are trying
with a new ESB version.

*EnrichMediator} -  Invalid Target object to be enrich *error can be happened
for xpath *get-property('firstResponse')/children, *if there is no
'firstResponse' is formed before 'aggrementResponse'. The aggregated result
from the backend service can be as following when aggregating results. So
there will be not be 'firstResponse' before 'aggrementResponse and that
error will be occured. Same can be happened with

*xpath="$ctx:firstResponse".*
 
http://schemas.xmlsoap.org/soap/envelope/;>



3
Tamsung
Mobile
S8


1
TAHB

1


2

Home
5000sqft


2
Tonda
Car
Tmaze





Assuming that your backend gives mentioned output by you, Can you try by
adding PayloadFactory mediator to your main.xml as in below.


---
   
  

$1
 
$1
$2
$3
$4
 

  
  
 
 
 
 
  
   
   

  
  




  
  




This worked for me.


Thanks
Sudharma

On Thu, Jul 20, 2017 at 6:46 PM, aditya shivankar <
shivankar.adit...@gmail.com> wrote:

> Thanks Sudharma for reply,
>
>
> As I mentioned* "modifyAgRes.xml" *is a mock of backend service. I cannot
> change the backend service. Whatever modifications I have to do is only to
> main xml* "**addChild.xml**".*
> Plus I think we cannot use payloadFactory this way , as number of elements
> coming in input array are not fixed.It can be any number.
>
> One more thing, Enrich mediator is behaving weirdly. For editing the
> property of type "OM",
> suppose property like this
>
>  type="OM"/>
>
> use of below xpath sometimes works and sometimes not
>
> *xpath="$ctx:firstResponse"*
>
> but mostly (intermitently) it gives below error
>
> *EnrichMediator} -  Invalid Target object to be enrich. *
>
> I am getting the similar error , even for the xpath you have suggested.
>
> * xpath="get-property('firstResponse')/children*
>
> With Regards,
> Aditya
>
>
>
>
> On Thu, Jul 20, 2017 at 3:31 PM, Sudharma Subasinghe <sudhar...@wso2.com>
> wrote:
>
>> Hi,
>>
>> Try using PayloadFactory mediator as below. Change your configs as
>> following.
>>
>> *modifyAgRes.xml*
>>
>> 
>> 
>>   
>> 
>> $1
>>  
>> $1
>> $2
>> Car
>> Tmaze
>>  
>> 
>>   
>>   
>>  
>>  > />
>>   
>>
>> 
>> 
>> 
>>   
>> 
>> $1
>>  
>> $1
>> $2
>> Mobile
>> S8
>>  
>> 
>>   
>>   
>>  
>>  > />
>>   
>>
>> 
>> --
>>  
>>
>>
>>
>> *addChild.xml*>  expression="//jsonObject/children"
>>  scope="default"
>>  type="OM"/>
>>
>> 
>>  
>>   
>> 
>>
>> Thanks
>> Sudharma
>>
>> On Thu, Jul 20, 2017 at 2:03 AM, aditya shivankar <
>> shivankar.adit...@gmail.com> wrote:
>>
>>>  Adding responses as elements ,to an 

Re: [Dev] Adding responses as elements , to an array in json response

2017-07-20 Thread Sudharma Subasinghe
Hi,

Try using PayloadFactory mediator as below. Change your configs as
following.

*modifyAgRes.xml*



  

$1
 
$1
$2
Car
Tmaze
 

  
  
 
 
  
   



  

$1
 
$1
$2
Mobile
S8
 

  
  
 
 
  
   

--
 



*addChild.xml*


 
  


Thanks
Sudharma

On Thu, Jul 20, 2017 at 2:03 AM, aditya shivankar <
shivankar.adit...@gmail.com> wrote:

>  Adding responses as elements ,to an array in json response
>
> Input request :
>
> [
> {
>"id" : "1",
> "make" : "TAHB",
> "children":[
> {
> "kid":"1"
> },
> {
> "kid":"2"
> }
> ]
> },
> {
> "id" : "2",
> "make" : "Tonda"
> },
> {
> "id" : "3",
> "make" : "Tamsung"
> }
> ]
>
>
> I am using iterate, to send each element of above array as request to a
> backend service( In myactual project this is not so simple service i.e.
> backend service reponse is very complex json with lots of arrays and
> sub-arrays(child arrays)in it . for better understanding of issue I kept it
> like this ).
>
> The responses of the backend service are aggregated in one soap xml by
> AggregateMediator.
>
> Below is response from AggregateMediator
>
>  
> http://schemas.xmlsoap.org/soap/envelope/
> ">
> 
> 
> 
> 1
> TAHB
> 
> 1
> 
> 
> 2
> 
> Home
> 5000sqft
> 
> 
> 2
> Tonda
> Car
> Tmaze
> 
> 
> 3
> Tamsung
> Mobile
> S8
> 
> 
> 
> 
>
> Requirement is to add all the responses from the backend service except
> the first one, to the child array of the first response of the backend
> service.
> I do not know how to do this ? not even how to add new elements to a array
> in wso2.
>
> My Current Output :
>
> {
> "id": 1,
> "make": "TAHB",
> "children": [{
> "kid": 1
> },
> {
> "kid": 2
> }],
> "name": "Home",
> "area": "5000sqft",
> "jsonObject": [{
> "id": 2,
> "make": "Tonda",
> "name": "Car",
> "model": "Tmaze"
> },
> {
> "id": 3,
> "make": "Tamsung",
> "name": "Mobile",
> "model": "S8"
> }]
> }
>
>
> Desired Output :
>
> {
> "id": 1,
> "make": "TAHB",
> "children": [
> {
> "kid": 1
> },
> {
> "kid": 2
> },
> {
> "id": 2,
> "make": "Tonda",
> "name": "Car",
> "model": "Tmaze"
> },
> {
> "id": 3,
> "make": "Tamsung",
> "name": "Mobile",
> "model": "S8"
> }
> ],
> "name": "Home",
> "area": "5000sqft",
> }
>
> Please find main xml and backendService xml attached. It contains what I
> tried.
> main xml : addChild.xml
> backendService xml : modifyAgrRes.xml
>
>
>
> ___
> Dev mailing list
> Dev@wso2.org
> http://wso2.org/cgi-bin/mailman/listinfo/dev
>
>


-- 
Sudharma Subasinghe,
Software Engineer,
WSO2 Inc.
Email: sudhar...@wso2.com <hasi...@wso2.com>
Mobile : +94 710 565 157 <%2B94%20718%20210%20200>
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] [ESB] Taking a list of values as input to a mediator configuration

2017-07-14 Thread Sudharma Subasinghe
Hi,

+1 for taking the input as a list of comma separated values. It is better
to validate those values.

Thanks
Sudharma

On Fri, Jul 14, 2017 at 11:53 AM, Riyafa Abdul Hameed <riy...@wso2.com>
wrote:

> Hi,
>
> I am creating a custom mediator and one of the configuration parameters
> would have to take as input a list of values. What is the best or standard
> way to do this? I plan to take in string with comma separated values and
> split it by the commas and then trim it to get the values in the list.
> Would that work?
>
> To elaborate more consider the syntax for cache mediator:
>
>  [scope=(per-host | per-mediator)] collector=(true | false)
> [maxMessageSize="in-bytes"] hTTPMethodToCache = (GET | POST)]
>
> headersToExcludeInHash=”comma separated list of headers”>
>
>   
>
> (mediator)+
>
>   ?
>
>   
>
> 
>
>
> if the value for the "headersToExcludeInHash" needs to be a list, is it
> correct to take as input a list of comma separated values in a single
> string?
>
>
> Thank you.
>
> Yours faithfully,
>
> Riyafa
>
> --
> Riyafa Abdul Hameed
> Software Engineer, WSO2 Lanka (Pvt) Ltd <http://wso2.com/>
>
> Email: riy...@wso2.com <riyafa...@cse.mrt.ac.lk>
> Website: https://riyafa.wordpress.com/ <http://riyafa.wordpress.com/>
> <http://facebook.com/riyafa.ahf>  <http://lk.linkedin.com/in/riyafa>
> <http://twitter.com/Riyafa1>
>
> ___
> Dev mailing list
> Dev@wso2.org
> http://wso2.org/cgi-bin/mailman/listinfo/dev
>
>


-- 
Sudharma Subasinghe,
Software Engineer,
WSO2 Inc.
Email: sudhar...@wso2.com <hasi...@wso2.com>
Mobile : +94 710 565 157 <%2B94%20718%20210%20200>
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] Foreach is not working properly under AggregateMediator's scope in response flow

2017-07-13 Thread Sudharma Subasinghe
Hi Aditya,

I have tested your configs and could observe the same behavior. Foreach
mediator is working properly.
This behavior is happening due to the Log mediator and it is fixed in [1].

[1] https://wso2.org/jira/browse/ESBJAVA-5202

Thanks
Sudharma

On Wed, Jul 12, 2017 at 2:04 PM, Vinod Kavinda <vi...@wso2.com> wrote:

> Hi Aditya,
> Please use Iterate mediator with the Aggregate mediator. Please refer [1],
> it explains the difference between the forEach and Iterate mediators.
>
> [1] - https://docs.wso2.com/display/ESB490/ForEach+Mediator
>
> Thanks,
> Vinod
>
> On Wed, Jul 12, 2017 at 1:34 PM, Sudharma Subasinghe <sudhar...@wso2.com>
> wrote:
>
>> Hi,
>>
>> Foreach mediator is working properly, above issue can be occurred when
>> log mediator is invoking.
>>
>> On Tue, Jul 11, 2017 at 2:48 PM, aditya shivankar <
>> shivankar.adit...@gmail.com> wrote:
>>
>>> Foreach is not working properly under AggregateMediator's scope in
>>> response flow
>>>
>>> Input request :
>>>
>>> [
>>> {
>>> "name" : "Home"
>>> },
>>> {
>>> "name" : "Car"
>>> },
>>> {
>>> "name" : "Mobile"
>>> }
>>> ]
>>>
>>>
>>> I am using iterate, to send each element of above array as request to a
>>> passthrough service( In myactual project this is not pass through. for
>>> better understanding of issue I kept it like this ).
>>>
>>> The responses of the pass through service are aggregated in one soap xml
>>> by AggregateMediator.
>>>
>>>
>>> Below is response from AggregateMediator
>>>
>>> 
>>> http://schemas.
>>> xmlsoap.org/soap/envelope/">
>>> 
>>> 
>>> 
>>> Mobile
>>> 
>>> 
>>> Car
>>> 
>>> 
>>> Home
>>> 
>>> 
>>> 
>>> 
>>>
>>>
>>> Using foreach to modify each response depending on some parameters
>>> coming in response.
>>> But Foreach is not working properly under Aggregator scope in response
>>> flow . Its response is weird.
>>> 
>>> -
>>> For-each response :
>>>
>>> [2017-07-11 14:07:44,696]  INFO - LogMediator msg4 = "Inside Foreach"
>>> [2017-07-11 14:07:44,697]  INFO - LogMediator To:
>>> http://www.w3.org/2005/08/addressing/anonymous, WSAction: , SOAPAction:
>>> , MessageID: urn:uuid:3e1fd827-12ab-413c-824d-c9daf7b6df7c, Direction:
>>> response, Envelope: 
>>> http://schemas.
>>> xmlsoap.org/soap/envelope/">
>>> 
>>> 
>>> Home
>>> 
>>> 
>>> 
>>>
>>> [2017-07-11 14:07:44,697]  INFO - LogMediator msg4 = "Inside Foreach"
>>> [2017-07-11 14:07:44,697]  INFO - LogMediator To:
>>> http://www.w3.org/2005/08/addressing/anonymous, WSAction: , SOAPAction:
>>> , MessageID: urn:uuid:3e1fd827-12ab-413c-824d-c9daf7b6df7c, Direction:
>>> response, Payload: {"name":"Home"}
>>>
>>> [2017-07-11 14:07:44,697]  INFO - LogMediator msg4 = "Inside Foreach"
>>> [2017-07-11 14:07:44,698]  INFO - LogMediator To:
>>> http://www.w3.org/2005/08/addressing/anonymous, WSAction: , SOAPAction:
>>> , MessageID: urn:uuid:3e1fd827-12ab-413c-824d-c9daf7b6df7c, Direction:
>>> response, Payload: {"name":"Home"}
>>>
>>> 
>>> 
>>> The second and third iterate of foreach should have been like below :
>>>
>>> http://schemas.
>>> xmlsoap.org/soap/envelope/">
>>> 
>>> 
>>> Mobile
>>> 
>>> 
>>> 
>>>
>>> http://schemas.
>>> xmlsoap.org/soap/envelope/">
>>> 
>>> 
>>> Car
>>> 
>>> 
>>> 
>>>
>>> Instead of :
>>>
>>>  Payload: {"name":"Home"}
>>>  Payload: {"name":"Home"}
>>>
>>>  Please find attached flow xml's.
>>>
>>>
>>> ___
>>> Dev mailing list
>>> Dev@wso2.org
>>> http://wso2.org/cgi-bin/mailman/listinfo/dev
>>>
>>>
>>
>>
>> --
>> Sudharma Subasinghe,
>> Software Engineer,
>> WSO2 Inc.
>> Email: sudhar...@wso2.com <hasi...@wso2.com>
>> Mobile : +94 710 565 157 <%2B94%20718%20210%20200>
>>
>> ___
>> Dev mailing list
>> Dev@wso2.org
>> http://wso2.org/cgi-bin/mailman/listinfo/dev
>>
>>
>
>
> --
> Vinod Kavinda
> Senior Software Engineer
> *WSO2 Inc. - lean . enterprise . middleware <http://www.wso2.com>.*
> Mobile : +94 (0) 712 415544
> Blog : http://soatechflicks.blogspot.com/
> [image: http://wso2.com/signature]
> <http://wso2.com/signature>
>
>


-- 
Sudharma Subasinghe,
Software Engineer,
WSO2 Inc.
Email: sudhar...@wso2.com <hasi...@wso2.com>
Mobile : +94 710 565 157 <%2B94%20718%20210%20200>
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] How to correlate message?

2017-07-13 Thread Sudharma Subasinghe
Hi,

Yes, messageID for in and out messages are different and It is not
recommended to make alterations to it. Your approach is correct when
correlating in and out messages.

If you set a property as


inside inSquence, you can get it in outSequence as


I've obtained it even with soapFault occured, due to the backend error.

Thanks
Sudharma




On Mon, Jul 10, 2017 at 2:37 PM, Melodias <osbtestmail...@gmail.com> wrote:

> Hi,
>
> I was try it and that doesn't work. InSequence and outSequence has
> different
> ID:
> IN = urn:uuid:9472d761-0148-4b4d-9fd1-80d426ed9f15
> OUT = urn:uuid:d7fc77ec-2bb8-4508-9dfc-358f2de625cc
>
>
>
> --
> View this message in context: http://wso2-oxygen-tank.10903.
> n7.nabble.com/How-to-correlate-message-in-ESB-tp150139p150143.html
> Sent from the WSO2 Development mailing list archive at Nabble.com.
> ___
> Dev mailing list
> Dev@wso2.org
> http://wso2.org/cgi-bin/mailman/listinfo/dev
>



-- 
Sudharma Subasinghe,
Software Engineer,
WSO2 Inc.
Email: sudhar...@wso2.com <hasi...@wso2.com>
Mobile : +94 710 565 157 <%2B94%20718%20210%20200>
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] Foreach is not working properly under AggregateMediator's scope in response flow

2017-07-12 Thread Sudharma Subasinghe
Hi,

Foreach mediator is working properly, above issue can be occurred when log
mediator is invoking.

On Tue, Jul 11, 2017 at 2:48 PM, aditya shivankar <
shivankar.adit...@gmail.com> wrote:

> Foreach is not working properly under AggregateMediator's scope in
> response flow
>
> Input request :
>
> [
> {
> "name" : "Home"
> },
> {
> "name" : "Car"
> },
> {
> "name" : "Mobile"
> }
> ]
>
>
> I am using iterate, to send each element of above array as request to a
> passthrough service( In myactual project this is not pass through. for
> better understanding of issue I kept it like this ).
>
> The responses of the pass through service are aggregated in one soap xml
> by AggregateMediator.
>
>
> Below is response from AggregateMediator
>
> 
> http://schemas.xmlsoap.org/soap/envelope/
> ">
> 
> 
> 
> Mobile
> 
> 
> Car
> 
> 
> Home
> 
> 
> 
> 
>
>
> Using foreach to modify each response depending on some parameters coming
> in response.
> But Foreach is not working properly under Aggregator scope in response
> flow . Its response is weird.
> -
> For-each response :
>
> [2017-07-11 14:07:44,696]  INFO - LogMediator msg4 = "Inside Foreach"
> [2017-07-11 14:07:44,697]  INFO - LogMediator To:
> http://www.w3.org/2005/08/addressing/anonymous, WSAction: , SOAPAction: ,
> MessageID: urn:uuid:3e1fd827-12ab-413c-824d-c9daf7b6df7c, Direction:
> response, Envelope: 
> http://schemas.xmlsoap.org/soap/envelope/
> ">
> 
> 
> Home
> 
> 
> 
>
> [2017-07-11 14:07:44,697]  INFO - LogMediator msg4 = "Inside Foreach"
> [2017-07-11 14:07:44,697]  INFO - LogMediator To:
> http://www.w3.org/2005/08/addressing/anonymous, WSAction: , SOAPAction: ,
> MessageID: urn:uuid:3e1fd827-12ab-413c-824d-c9daf7b6df7c, Direction:
> response, Payload: {"name":"Home"}
>
> [2017-07-11 14:07:44,697]  INFO - LogMediator msg4 = "Inside Foreach"
> [2017-07-11 14:07:44,698]  INFO - LogMediator To:
> http://www.w3.org/2005/08/addressing/anonymous, WSAction: , SOAPAction: ,
> MessageID: urn:uuid:3e1fd827-12ab-413c-824d-c9daf7b6df7c, Direction:
> response, Payload: {"name":"Home"}
>
> 
> 
> The second and third iterate of foreach should have been like below :
>
> http://schemas.xmlsoap.org/soap/envelope/
> ">
> 
> 
> Mobile
> 
> 
> 
>
> http://schemas.xmlsoap.org/soap/envelope/
> ">
> 
> 
> Car
> 
> 
> 
>
> Instead of :
>
>  Payload: {"name":"Home"}
>  Payload: {"name":"Home"}
>
>  Please find attached flow xml's.
>
>
> ___
> Dev mailing list
> Dev@wso2.org
> http://wso2.org/cgi-bin/mailman/listinfo/dev
>
>


-- 
Sudharma Subasinghe,
Software Engineer,
WSO2 Inc.
Email: sudhar...@wso2.com <hasi...@wso2.com>
Mobile : +94 710 565 157 <%2B94%20718%20210%20200>
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] Get Super tenant admin email

2017-07-10 Thread Sudharma Subasinghe
We cannot obtain super tenant's email address via TenantManager as it is
not set.

On Tue, Jul 11, 2017 at 10:47 AM, Ayesha Dissanayaka <aye...@wso2.com>
wrote:

> Hi Godwin,
>
> You can admin username from carbon context when in super-tenant flow.
>
> PrivilegedCarbonContext.getThreadLocalCarbonContext().getUserRealm().
> getRealmConfiguration()
> .getAdminUserName()
>
> Thanks!
> -Ayesha
>
>
> On Tue, Jul 11, 2017 at 7:35 AM, Godwin Shrimal <god...@wso2.com> wrote:
>
>> Hi All,
>>
>> We cannot get super tenant information via TenantManager. Below code
>> returns null, So how can we get the super tenant admin's email address ?
>>
>> *tenantManager.getTenant(-1234)*
>>
>>
>> Thanks
>> Godwin
>>
>> --
>> *Godwin Amila Shrimal*
>> WSO2 Inc.; http://wso2.com
>> lean.enterprise.middleware
>>
>> mobile: *+94772264165*
>> linkedin: *http://lnkd.in/KUum6D <http://lnkd.in/KUum6D>*
>> twitter: https://twitter.com/godwinamila
>> <http://wso2.com/signature>
>>
>> ___
>> Dev mailing list
>> Dev@wso2.org
>> http://wso2.org/cgi-bin/mailman/listinfo/dev
>>
>>
>
>
> --
> *Ayesha Dissanayaka*
> Senior Software Engineer,
> WSO2, Inc : http://wso2.com
> <http://www.google.com/url?q=http%3A%2F%2Fwso2.com=D=1=AFQjCNEZvyc0uMD1HhBaEGCBxs6e9fBObg>
> 20, Palm grove Avenue, Colombo 3
> E-Mail: aye...@wso2.com <ayshsa...@gmail.com>
>
> ___
> Dev mailing list
> Dev@wso2.org
> http://wso2.org/cgi-bin/mailman/listinfo/dev
>
>


-- 
Sudharma Subasinghe,
Software Engineer,
WSO2 Inc.
Email: sudhar...@wso2.com <hasi...@wso2.com>
Mobile : +94 710 565 157 <%2B94%20718%20210%20200>
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] How to correlate message?

2017-07-10 Thread Sudharma Subasinghe
Hi,

Can you try

org.apache.axis2.context.MessageContext a2mc = ((Axis2MessageContext)
synCtx).getAxis2MessageContext();
a2mc.getMessageID();

inside your custom mediator class to obtain the ID?


On Mon, Jul 10, 2017 at 1:26 PM, Melodias <osbtestmail...@gmail.com> wrote:

> Hi devs,
>
> How I can correlate message?
> To correlate IN and OUT message i can set properties with uniq string, but
> when i get fault message from the endpoint, then properties is null.
> Is there some special ID in message context which I can get by using class
> mediator?
>
>
>
> --
> View this message in context: http://wso2-oxygen-tank.10903.
> n7.nabble.com/How-to-correlate-message-tp150139.html
> Sent from the WSO2 Development mailing list archive at Nabble.com.
> ___
> Dev mailing list
> Dev@wso2.org
> http://wso2.org/cgi-bin/mailman/listinfo/dev
>



-- 
Sudharma Subasinghe,
Software Engineer,
WSO2 Inc.
Email: sudhar...@wso2.com <hasi...@wso2.com>
Mobile : +94 710 565 157 <%2B94%20718%20210%20200>
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


[Dev] Adding Transacted Samplers for performance testing in MB 4 using Jmeter

2017-05-22 Thread Sudharma Subasinghe
Hi,

The purpose was to enabling performance testing for local transactions and
distributed transactions in MB 4 using Jmeter.

As latest Jmeter version does not provide that feature, I have created
sender and receiver samplers for queues as Jmeter java request samplers
[1]. This has used same queueSession with each thread in threadGruop.
(regardless loopcount for each thread in Jmeter).

[1]  https://github.com/wso2/carbon-business-messaging/pull/453/

Thanks
Sudharma

-- 
Sudharma Subasinghe,
Software Engineer,
WSO2 Inc.
Email: sudhar...@wso2.com <hasi...@wso2.com>
Mobile : +94 710 565 157 <%2B94%20718%20210%20200>
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] [VOTE][RC1] Release - WSO2 Business Process Server 3.6.0 RC1

2016-08-25 Thread Sudharma Subasinghe
Verified the following.
 - BPMN Explorer functionalities and multi-tenant support
 - BPEL deployment, execution and clustering with MySql
 - MySql compatibility
 - BPS process cleanup tools with MySql

[+] Stable - go ahead and release.

Thanks
Sudharma

On Fri, Aug 26, 2016 at 12:45 AM, Milinda Perera <milin...@wso2.com> wrote:

> Tested and following:
>
> Setups : Cluster with MySql + DepSync enabled + fronted by NGINX
> Cluster with Oracle + DepSync enabled + fronted by NGINX
>
> Tested following:
>
>- Basic functionalities of BPMN, BPEL, WS-Humantask
>- BPMN, BPEL and WS-Humantask versioning
>- Smoke test on BPMN-Explorer and Humantask-Explorer
>- Verify XML and JSON variable types usage
>- BPMN, BPEL and WS-Humantask package deployement in tenants with
> DepSync
>
> [+] Stable - go ahead and release.
>
>
> Thanks,
> Milinda
>
> On Thu, Aug 25, 2016 at 11:23 PM, Amal Gunatilake <am...@wso2.com> wrote:
>
>> Hi,
>>
>> Verified the following.
>>
>>- BPMN basic functionalities.
>>- BPMN Rest Task improvements.
>>- Humantask deployments + basic functionalities.
>>- BPEL sample deployments + basic functionalities.
>>- BPEL process instance cleanup tool.
>>- Tested DB2 compatibility for BPEL and Humantask.
>>- Oracle compatibility.
>>- Tested Substitution feature + Oracle
>>
>> [+] Stable - go ahead and release.
>>
>> Best regards,
>> Amal.
>>
>> On Thu, Aug 25, 2016 at 3:41 PM, Milinda Perera <milin...@wso2.com>
>> wrote:
>>
>>> Hi APIM and IS team,
>>>
>>> Could you please tryout your features with BPS with 3.6.0 RC1.
>>>
>>> Thanks,
>>> Milinda
>>>
>>> On Thu, Aug 25, 2016 at 3:34 PM, Vinod Kavinda <vi...@wso2.com> wrote:
>>>
>>>> Hi,
>>>> I verified,
>>>>
>>>>- Substitution feature.
>>>>- BPMN Explorer.
>>>>- Human Task Explorer.
>>>>- Migration from 3.5.1.
>>>>
>>>> [+] Stable - go ahead and release.
>>>>
>>>> Regards,
>>>> Vinod
>>>>
>>>> On Wed, Aug 24, 2016 at 2:30 PM, Milinda Perera <milin...@wso2.com>
>>>> wrote:
>>>>
>>>>> Hi All,
>>>>>
>>>>> This is the 1st Release Candidate of WSO2 Business Process Server 3.6.0
>>>>>
>>>>> Please download, test the product and vote. Vote will be open for 72
>>>>> hours or as needed.
>>>>>
>>>>> *Source and distribution*
>>>>>
>>>>> *Run-time* : https://github.com/wso2/produc
>>>>> t-bps/releases/tag/v3.6.0-RC1
>>>>> *Tooling*  : https://github.com/wso2/devstu
>>>>> dio-tooling-bps/releases/tag/Released-release-3.6.0-RC1-2016
>>>>> -08-24-114818
>>>>>
>>>>> Please vote as follows.
>>>>> [+] Stable - go ahead and release
>>>>> [-] Broken - do not release (explain why)
>>>>>
>>>>> Thanks,
>>>>> ~ WSO2 BPS Team ~
>>>>>
>>>>> --
>>>>> Milinda Perera
>>>>> Senior Software Engineer;
>>>>> WSO2 Inc. http://wso2.com ,
>>>>> Mobile: (+94) 714 115 032
>>>>>
>>>>>
>>>>
>>>>
>>>> --
>>>> Vinod Kavinda
>>>> Software Engineer
>>>> *WSO2 Inc. - lean . enterprise . middleware <http://www.wso2.com>.*
>>>> Mobile : +94 (0) 712 415544
>>>> Blog : http://soatechflicks.blogspot.com/
>>>> [image: http://wso2.com/signature]
>>>> <http://wso2.com/signature>
>>>>
>>>>
>>>
>>>
>>> --
>>> Milinda Perera
>>> Senior Software Engineer;
>>> WSO2 Inc. http://wso2.com ,
>>> Mobile: (+94) 714 115 032
>>>
>>>
>>> ___
>>> Dev mailing list
>>> Dev@wso2.org
>>> http://wso2.org/cgi-bin/mailman/listinfo/dev
>>>
>>>
>>
>>
>> --
>> *Amal Gunatilake*
>> WSO2 Inc.; http://wso2.com
>> Lean . Enterprise . Middleware
>>
>> mobile: (+94) 773561195
>> blog: amalg-blogs.blogspot.com; twitter: @daag123
>> linkedIn: https://www.linkedin.com/in/amalgunatilake
>>
>
>
>
> --
> Milinda Perera
> Senior Software Engineer;
> WSO2 Inc. http://wso2.com ,
> Mobile: (+94) 714 115 032
>
>
> ___
> Dev mailing list
> Dev@wso2.org
> http://wso2.org/cgi-bin/mailman/listinfo/dev
>
>


-- 
Sudharma Subasinghe,
Software Engineer,
WSO2 Inc.
Email: sudhar...@wso2.com <hasi...@wso2.com>
Mobile : +94 710 565 157 <%2B94%20718%20210%20200>
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] BPS 3.5.1 sends emails with empty bodies

2016-07-20 Thread Sudharma Subasinghe
Hi,

The issue can be resolved with following fix [1].

[1]
https://github.com/wso2/carbon-business-process/pull/423/commits/17bc321d39079125dbcb0e278107af4cd8cc6d19

Thanks
Sudharma


On Fri, Jul 1, 2016 at 12:43 AM, Amal Gunatilake <am...@wso2.com> wrote:

> Hi Manu,
>
> According to the mail thread [1] discussion, it seems this is a potential
> bug in email task when message body configured in HTML format.
> I have created a jira ticket[2] to track this. Meanwhile as a workaround,
> using the text format body works.
>
> [1] Re: WSO2 BPS - Email Task
> [2] https://wso2.org/jira/browse/BPS-1063
>
> Best regards,
> Amal.
>
> On Thu, Jun 30, 2016 at 9:37 PM, Manuranga Perera <m...@wso2.com> wrote:
>
>> Hi Amal,
>>
>> 1) The doc [1] asks me to copy commons-email:jar:1.3 but the product
>> already comes with 1.4
>>
>> 2) Even if I copy the jars, I still get emails with empty body, only with
>> title. (emails are send with html bodies using )
>>
>> [1] https://docs.wso2.com/display/BPS351/Working+with+the+Email+Task
>>
>> --
>> With regards,
>> *Manu*ranga Perera.
>>
>> phone : 071 7 70 20 50
>> mail : m...@wso2.com
>>
>
>
>
> --
> *Amal Gunatilake*
> WSO2 Inc.; http://wso2.com
> Lean . Enterprise . Middleware
>
> mobile: (+94) 773561195
> blog: amalg-blogs.blogspot.com; twitter: @daag123
> linkedIn: https://www.linkedin.com/in/amalgunatilake
>
> ___
> Dev mailing list
> Dev@wso2.org
> http://wso2.org/cgi-bin/mailman/listinfo/dev
>
>


-- 
Sudharma Subasinghe,
Software Engineer,
WSO2 Inc.
Email: sudhar...@wso2.com <hasi...@wso2.com>
Mobile : +94 710 565 157 <%2B94%20718%20210%20200>
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


[Dev] Launching the BPMN Explorer does not work after updating to Kernel 4.4.6

2016-07-01 Thread Sudharma Subasinghe
Hi,

Error 405 - Method Not Allowed occurred for BPMN Explorer UI launching
request after adding configurations for jaggery apps.

Are "/csrf.js" which is added in the header of HTML template in the app and
"/csrfPrevention.js" for management console same?

Appreciate idea on this.

Thanks
Sudhama

-- 
Sudharma Subasinghe,
Software Engineer,
WSO2 Inc.
Email: sudhar...@wso2.com <hasi...@wso2.com>
Mobile : +94 710 565 157 <%2B94%20718%20210%20200>
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] [UUF] Convert a timestamp in long format to readable format in HBS.

2016-06-23 Thread Sudharma Subasinghe
Yeah, there is a way to write custom helpers in HBS and we can use it by
registering the helper in HBS.

On Thu, Jun 23, 2016 at 3:56 PM, Hemika Kodikara <hem...@wso2.com> wrote:

> *Also is there a way to plug custom helpers ?
>
> Hemika Kodikara
> Software Engineer
> WSO2 Inc.
> lean . enterprise . middleware
> http://wso2.com
>
> Mobile : +9477762
>
> On Thu, Jun 23, 2016 at 3:06 PM, Hemika Kodikara <hem...@wso2.com> wrote:
>
>> Hi All,
>>
>> Is there a way to do $subject ?
>>
>> Also is there to plug custom helpers ? and also can we add all the
>> supported helpers to [1] including the ones coming from jnack.
>>
>> [1] - https://docs.wso2.com/display/UUF100/Helpers
>>
>> Regards,
>> Hemika
>>
>> Hemika Kodikara
>> Software Engineer
>> WSO2 Inc.
>> lean . enterprise . middleware
>> http://wso2.com
>>
>> Mobile : +94777688882
>>
>
>
> ___
> Dev mailing list
> Dev@wso2.org
> http://wso2.org/cgi-bin/mailman/listinfo/dev
>
>


-- 
Sudharma Subasinghe,
Software Engineer,
WSO2 Inc.
Email: sudhar...@wso2.com <hasi...@wso2.com>
Mobile : +94 710 565 157 <%2B94%20718%20210%20200>
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] [UUF] Convert a timestamp in long format to readable format in HBS.

2016-06-23 Thread Sudharma Subasinghe
Hi Hemika,

You can process the timestamp in long format to readable format in js side
and return that to display in hbs.

Thanks
Sudharma



On Thu, Jun 23, 2016 at 3:06 PM, Hemika Kodikara <hem...@wso2.com> wrote:

> Hi All,
>
> Is there a way to do $subject ?
>
> Also is there to plug custom helpers ? and also can we add all the
> supported helpers to [1] including the ones coming from jnack.
>
> [1] - https://docs.wso2.com/display/UUF100/Helpers
>
> Regards,
> Hemika
>
> Hemika Kodikara
> Software Engineer
> WSO2 Inc.
> lean . enterprise . middleware
> http://wso2.com
>
> Mobile : +9477762
>
> ___
> Dev mailing list
> Dev@wso2.org
> http://wso2.org/cgi-bin/mailman/listinfo/dev
>
>


-- 
Sudharma Subasinghe,
Software Engineer,
WSO2 Inc.
Email: sudhar...@wso2.com <hasi...@wso2.com>
Mobile : +94 710 565 157 <%2B94%20718%20210%20200>
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] [UUF] Pagination support in UUF

2016-06-21 Thread Sudharma Subasinghe
Hi Rasika,

There is a table which shows process details in bpmn-explorer. When loading
process details to table, it does not load all the process data set at once
as there can be a huge nu. of data set in database by calling the osgi
service. Hence it shows 10 processes for one page of table. It is required
to use the pagination to show all the data.

So each pagination requires the osgi service call to load process details.

On Tue, Jun 21, 2016 at 7:42 PM, Rasika Perera <rasi...@wso2.com> wrote:

> Hi Sudharma,
>
> I need server side pagination for my requirements.
>
> I am not clear about the exact requirement. ​Pagination can be achieved
> with following options;
>
> ​[1]. Full page refresh with path params
>
> ​First option is that you can pass path parameters. For example;
> https://techcrunch.com/page/2/​, https://techcrunch.com/page/3/.
>
> +org.wso2.sample.app
>
> |pages
>
>  `--articles
>
> |-{id}.hbs
>
> `-{id}.js
>
> function onRequest(env) {
> return {"articles": getArticles(env.pathParams['id'])};
> }
>
> [2]. Fragments rendering​
>
> ​via AJAX​
>
> ​I think you can use fragments rendering feature for this. The idea is
> that inaddtion to the pages, fragments are accessible through the following
> api;
>
> http://localhost:9090/pets-store/fragments/devices​
> ​?offset=1=10​
>
>
> You can use AJAX call to the above api and update relavant "div" on the
> page.
>
> ​This api call will look for​ a fragment in your application's fragments
> folder. Your query parameters "offset" and "limit" will be mapped as params
> for the fragment. You can also resuse the same fragment also in your pages.
>
> *device.hbs*
> ===
> 
>
> 
> {{#each devices}}
> 
> Name : {{name}}
> Type : {{type}}
> 
> {{/each}}
> 
> 
>
>
> *devices.js*
> *==*
> function onRequest(env) {
>
> var devices;
> if (env.queryParams && (env.queryParams.offset && env.queryParams.limit)) 
> {
> devices = getDevices(env.queryParams.offset, env.queryParams.limit);
> } else {
> devices = getDevices(0, 0);
> }
>
> return {"devices": devices}
> }
>
> function getDevices(offset, limit) {
> var result = [{name: "device1", type: "android"}, {name: "device2", type: 
> "windows"}];
> if (limit == 0) {
> //no pagination
> return result;
> } else if (offset + limit <= result.size()) {
> //valid pagination
> result = result.slice(offset, limit);
> } else {
> //invalid pagination
> result = [];
> }
> return result;
> }
>
> ​Thanks,
> Rasika​
>
>
> On Tue, Jun 21, 2016 at 3:53 PM, Sudharma Subasinghe <sudhar...@wso2.com>
> wrote:
>
>> I need server side pagination for my requirements.
>>
>> On Tue, Jun 21, 2016 at 12:28 PM, Hemika Kodikara <hem...@wso2.com>
>> wrote:
>>
>>> Hi Sudharma,
>>>
>>> [+ looping in Thusitha]
>>>
>>> If this is for a table, you can use datatable library[1]. There is a
>>> sample where this has been in used in [2] as well. But in this case, we
>>> have to bind all the rows(data) to the table upon onRequest method to the
>>> HTML table. The datatable library will provide the client side
>>> pagination(no http requests sent for pagination). Datatables also provide
>>> server side pagination as well, i.e when next page is clicked, it will send
>>> a HTTP request to get the rest of the data.
>>>
>>> But I am not aware on how to do server side pagination along with UUF.
>>>
>>> [1] - https://datatables.net/
>>> [2] - http://wso2-dev-ux.github.io/theme-wso2/layout.html (See "Data
>>> Table Template" title).
>>>
>>> Regards,
>>> Hemika
>>>
>>>
>>> Hemika Kodikara
>>> Software Engineer
>>> WSO2 Inc.
>>> lean . enterprise . middleware
>>> http://wso2.com
>>>
>>> Mobile : +9477762
>>>
>>> On Tue, Jun 21, 2016 at 12:18 PM, Sudharma Subasinghe <
>>> sudhar...@wso2.com> wrote:
>>>
>>>> Hi,
>>>>
>>>> How is the pagination supported by UUF? Is there any recommended lib
>>>> for that?
>>>>
>>>> Appreciate your ideas.
>>>>
>>>> Thanks
>>>> Sudharma
>>

Re: [Dev] [UUF] Pagination support in UUF

2016-06-21 Thread Sudharma Subasinghe
I need server side pagination for my requirements.

On Tue, Jun 21, 2016 at 12:28 PM, Hemika Kodikara <hem...@wso2.com> wrote:

> Hi Sudharma,
>
> [+ looping in Thusitha]
>
> If this is for a table, you can use datatable library[1]. There is a
> sample where this has been in used in [2] as well. But in this case, we
> have to bind all the rows(data) to the table upon onRequest method to the
> HTML table. The datatable library will provide the client side
> pagination(no http requests sent for pagination). Datatables also provide
> server side pagination as well, i.e when next page is clicked, it will send
> a HTTP request to get the rest of the data.
>
> But I am not aware on how to do server side pagination along with UUF.
>
> [1] - https://datatables.net/
> [2] - http://wso2-dev-ux.github.io/theme-wso2/layout.html (See "Data
> Table Template" title).
>
> Regards,
> Hemika
>
>
> Hemika Kodikara
> Software Engineer
> WSO2 Inc.
> lean . enterprise . middleware
> http://wso2.com
>
> Mobile : +9477762
>
> On Tue, Jun 21, 2016 at 12:18 PM, Sudharma Subasinghe <sudhar...@wso2.com>
> wrote:
>
>> Hi,
>>
>> How is the pagination supported by UUF? Is there any recommended lib for
>> that?
>>
>> Appreciate your ideas.
>>
>> Thanks
>> Sudharma
>>
>> --
>> Sudharma Subasinghe,
>> Software Engineer,
>> WSO2 Inc.
>> Email: sudhar...@wso2.com <hasi...@wso2.com>
>> Mobile : +94 710 565 157 <%2B94%20718%20210%20200>
>>
>> ___
>> Dev mailing list
>> Dev@wso2.org
>> http://wso2.org/cgi-bin/mailman/listinfo/dev
>>
>>
>


-- 
Sudharma Subasinghe,
Software Engineer,
WSO2 Inc.
Email: sudhar...@wso2.com <hasi...@wso2.com>
Mobile : +94 710 565 157 <%2B94%20718%20210%20200>
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


[Dev] [UUF] Pagination support in UUF

2016-06-21 Thread Sudharma Subasinghe
Hi,

How is the pagination supported by UUF? Is there any recommended lib for
that?

Appreciate your ideas.

Thanks
Sudharma

-- 
Sudharma Subasinghe,
Software Engineer,
WSO2 Inc.
Email: sudhar...@wso2.com <hasi...@wso2.com>
Mobile : +94 710 565 157 <%2B94%20718%20210%20200>
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] [UUF] Convert an array to a javascript string array in nashorn.

2016-06-16 Thread Sudharma Subasinghe
OK, got the idea of processing enough to render without any extra logic :-)



On Thu, Jun 16, 2016 at 7:42 PM, Manuranga Perera <m...@wso2.com> wrote:

> It is not simple like using "isInput"
>
> OK :-) then how about
>
> var isSudharmasVeryComplexLogic = ... // true or false
>
> then you don't need any logic in the HBS. Just kidding... well... kinda,
> but not really.
>
> The idea of a view-model is that, it is already processed enough, so it
> can be rendered without any extra logic. Can you give a small sample of the
> use-case where you need to "compare by values *inside *the template"?
>
> On Thu, Jun 16, 2016 at 7:22 AM, Sudharma Subasinghe <sudhar...@wso2.com>
> wrote:
>
>> Hi Manuranga,
>>
>> It is not simple like using "isInput", "isTextArea" for my scenario, as
>> it is needed to compare by values inside the template. But HBS does not
>> provide comparing using values inside if-else conditions. So have to
>> implement Handlebar helper to support that logic. Is it okay to implement a
>> HBS helper to use with view model?
>>
>> On Wed, Jun 15, 2016 at 8:35 PM, Manuranga Perera <m...@wso2.com> wrote:
>>
>>> Hi Sudarma, Hemika,
>>> I have started documenting these practices [1]
>>> Please point me to any problem arias and your personal finding that you
>>> think are import, so I can add them to the doc.
>>>
>>>
>>> [1] https://docs.wso2.com/display/UUF100/Code+Review
>>>
>>> On Wed, Jun 15, 2016 at 11:01 AM, Manuranga Perera <m...@wso2.com>
>>> wrote:
>>>
>>>> Hi Sudharma,
>>>> In your case, please try to make a view-model, and actually render the
>>>> view-model using HBS the normal way.
>>>>
>>>> func onRequest(){
>>>>   var myForm = ...;  // eg: [{"name": "string"}, {"id": "number" }]
>>>>   ...
>>>>
>>>>   return toViewModel(myForm);
>>>> }
>>>>
>>>> func toViewModel(formModel){
>>>>   var viewModel = {element: []};
>>>>   for (var key in formModel) {
>>>> if(...){
>>>>   ...
>>>>   viewModel.elements.push(...)
>>>>     }
>>>>   }
>>>>   return viewModel;  // eg: {"element: [{"isInput":true,"id":"name",
>>>> "label": "Name", "type", "text"}, ...]}
>>>> }
>>>>
>>>>
>>>> 
>>>>   {{each element}}
>>>>  {{#if isInput}}
>>>>  {{label}}
>>>>  
>>>>  {{/if}}
>>>>  {{#if isTextAria}}
>>>>  ...
>>>>  {{/if}}
>>>>  ...
>>>>   {{/each}}
>>>> 
>>>>
>>>>
>>>> Hi Sajith,Rasika,
>>>>
>>>> We may need to "bake-in" the idea of a view-model to the framework.
>>>>
>>>> On Mon, Jun 13, 2016 at 7:24 AM, Sudharma Subasinghe <
>>>> sudhar...@wso2.com> wrote:
>>>>
>>>>> There was a case to generate dynamic form using string such as
>>>>> "."  and I had to use {{{ }}} to generate the form
>>>>> dynamically.
>>>>>
>>>>> Hence need a function to resolve this also.
>>>>>
>>>>> On Fri, Jun 10, 2016 at 9:07 PM, Ayoma Wijethunga <ay...@wso2.com>
>>>>> wrote:
>>>>>
>>>>>> +1 for not using "{{{".
>>>>>>
>>>>>> We will further check on adding such patterns ("{{{ * }}}") in
>>>>>> planned Jenkins based automated security scans (static code analysis).
>>>>>>
>>>>>> On Fri, Jun 10, 2016 at 8:47 PM, SajithAR Ariyarathna <
>>>>>> sajit...@wso2.com> wrote:
>>>>>>
>>>>>>> +1 for abandoning "{{{"
>>>>>>>
>>>>>>> toClent("fromBackend.protocols", protocols);
>>>>>>>
>>>>>>> We can implement this in the next milestone.
>>>>>>>
>>>>>>> On Fri, Jun 10, 2016 at 8:12 PM, Manuranga Perera <m...@wso2.com>
>>>>>>> wrote:
>>>>>>>
>>>>>>>> These are mistakes we have already made in our old systems, let's
>>

Re: [Dev] [UUF] Convert an array to a javascript string array in nashorn.

2016-06-16 Thread Sudharma Subasinghe
Hi Manuranga,

It is not simple like using "isInput", "isTextArea" for my scenario, as it
is needed to compare by values inside the template. But HBS does not
provide comparing using values inside if-else conditions. So have to
implement Handlebar helper to support that logic. Is it okay to implement a
HBS helper to use with view model?

On Wed, Jun 15, 2016 at 8:35 PM, Manuranga Perera <m...@wso2.com> wrote:

> Hi Sudarma, Hemika,
> I have started documenting these practices [1]
> Please point me to any problem arias and your personal finding that you
> think are import, so I can add them to the doc.
>
>
> [1] https://docs.wso2.com/display/UUF100/Code+Review
>
> On Wed, Jun 15, 2016 at 11:01 AM, Manuranga Perera <m...@wso2.com> wrote:
>
>> Hi Sudharma,
>> In your case, please try to make a view-model, and actually render the
>> view-model using HBS the normal way.
>>
>> func onRequest(){
>>   var myForm = ...;  // eg: [{"name": "string"}, {"id": "number" }]
>>   ...
>>
>>   return toViewModel(myForm);
>> }
>>
>> func toViewModel(formModel){
>>   var viewModel = {element: []};
>>   for (var key in formModel) {
>> if(...){
>>   ...
>>   viewModel.elements.push(...)
>> }
>>   }
>>   return viewModel;  // eg: {"element: [{"isInput":true,"id":"name",
>> "label": "Name", "type", "text"}, ...]}
>> }
>>
>>
>> 
>>   {{each element}}
>>  {{#if isInput}}
>>  {{label}}
>>  
>>  {{/if}}
>>  {{#if isTextAria}}
>>  ...
>>  {{/if}}
>>  ...
>>   {{/each}}
>> 
>>
>>
>> Hi Sajith,Rasika,
>>
>> We may need to "bake-in" the idea of a view-model to the framework.
>>
>> On Mon, Jun 13, 2016 at 7:24 AM, Sudharma Subasinghe <sudhar...@wso2.com>
>> wrote:
>>
>>> There was a case to generate dynamic form using string such as
>>> "."  and I had to use {{{ }}} to generate the form
>>> dynamically.
>>>
>>> Hence need a function to resolve this also.
>>>
>>> On Fri, Jun 10, 2016 at 9:07 PM, Ayoma Wijethunga <ay...@wso2.com>
>>> wrote:
>>>
>>>> +1 for not using "{{{".
>>>>
>>>> We will further check on adding such patterns ("{{{ * }}}") in planned
>>>> Jenkins based automated security scans (static code analysis).
>>>>
>>>> On Fri, Jun 10, 2016 at 8:47 PM, SajithAR Ariyarathna <
>>>> sajit...@wso2.com> wrote:
>>>>
>>>>> +1 for abandoning "{{{"
>>>>>
>>>>> toClent("fromBackend.protocols", protocols);
>>>>>
>>>>> We can implement this in the next milestone.
>>>>>
>>>>> On Fri, Jun 10, 2016 at 8:12 PM, Manuranga Perera <m...@wso2.com>
>>>>> wrote:
>>>>>
>>>>>> These are mistakes we have already made in our old systems, let's not
>>>>>> repeat them
>>>>>>
>>>>>> 1) Please DO NOT use "{{{", it introduces SECURITY VULNERABILITIES,
>>>>>> Sajith,Rasika we need to introduce a new function. Don't even tell
>>>>>> people about "{{{"
>>>>>> in backend JS, Hemika should be able to do the following
>>>>>>
>>>>>> toClent("fromBackend.protocols", protocols);
>>>>>>
>>>>>> and in frontend, he should be able to just
>>>>>> console.log(fromBackend.protocols) and see the json
>>>>>> Given the cost of this kind of vulnerabilities, I don't think we
>>>>>> should even do this as a temp solution. We should safe stringify before
>>>>>> sending, view source of gmail and search "var GLOBALS" and you see
>>>>>> how safe json stringify works. ALL non-alpha-numeric has to be encoded 
>>>>>> with
>>>>>> \x. Not just " but things like < , which are normally considered safe in
>>>>>> json, has to be encoded [1].
>>>>>>
>>>>>> 2) We shouldn't manually iterating to convert to JSON. This just adds
>>>>>> unnecessary boilerplate work dev has to do. If we implement (1) we don't
>>>>>> need this for now. So we can discuss this lat

Re: [Dev] [UUF] Convert an array to a javascript string array in nashorn.

2016-06-13 Thread Sudharma Subasinghe
colStrings.push(item.toString());
>>>>>> }
>>>>>>
>>>>>> // var protocolsJson = JSON.stringify(protocolStrings);
>>>>>> return {"protocols" : protocolStrings};
>>>>>> };
>>>>>>
>>>>>> I am assigning the "protocols" json value to a javascript variable in
>>>>>> the client-side as following :
>>>>>>
>>>>>> var protocols =* {{protocols}}*;
>>>>>> $.each(protocols, function(index, value) {
>>>>>>
>>>>>> ('#queue-subscription-protocols').append($('').text(value).attr('value',
>>>>>> index));
>>>>>> });
>>>>>>
>>>>>>
>>>>>> But I am getting the following errors when rendered the page(client
>>>>>> side js) :
>>>>>>
>>>>>> var protocols = [object Array];<-- Syntax error
>>>>>>
>>>>>> When I use JSON.stringify in server side js, I get the following
>>>>>> output :
>>>>>>
>>>>>> var protocols =
>>>>>> [AMQP-0-10,MQTT-default,AMQP-0-91,AMQP-8-0,AMQP-0-9];
>>>>>>   <-- Unexpected token &
>>>>>>
>>>>>> Any Idea ?
>>>>>>
>>>>>> Regards,
>>>>>> Hemika
>>>>>>
>>>>>>
>>>>>> Hemika Kodikara
>>>>>> Software Engineer
>>>>>> WSO2 Inc.
>>>>>> lean . enterprise . middleware
>>>>>> http://wso2.com
>>>>>>
>>>>>> Mobile : +9477762
>>>>>>
>>>>>> On Fri, Jun 10, 2016 at 12:51 PM, Milinda Perera <milin...@wso2.com>
>>>>>> wrote:
>>>>>>
>>>>>>> Hi Hemika,
>>>>>>>
>>>>>>> If AMQP-0-10, MQTT-default, AMQP-0-91, AMQP-8-0, AMQP-0-9 are
>>>>>>> strings, following should work
>>>>>>>
>>>>>>> JSON.parse("[\"AMQP-0-10\", \"MQTT-default\", \"AMQP-0-91\",
>>>>>>> \"AMQP-8-0\", \"AMQP-0-9\"]")
>>>>>>>
>>>>>>> Accroding to [1] within array " A *value* can be a *string* in
>>>>>>> double quotes, or a *number*, or true or false or null, or an
>>>>>>> *object* or an *array*. These structures can be nested."
>>>>>>>
>>>>>>> [1] http://www.json.org/
>>>>>>>
>>>>>>> Thanks,
>>>>>>> Mili
>>>>>>>
>>>>>>> On Fri, Jun 10, 2016 at 12:33 PM, Hemika Kodikara <hem...@wso2.com>
>>>>>>> wrote:
>>>>>>>
>>>>>>>> Hi All,
>>>>>>>>
>>>>>>>> I am invoking the callOSGiService method in nashorn to get a list
>>>>>>>> of protocols thats in andes of MB.
>>>>>>>>
>>>>>>>> I am getting the following output after invoking the
>>>>>>>> callOSGiService :
>>>>>>>> [AMQP-0-10, MQTT-default, AMQP-0-91, AMQP-8-0, AMQP-0-9]
>>>>>>>>
>>>>>>>> But need to convert it into a javascript array(Probably a String
>>>>>>>> array). Need to bind it to a dropdown(select element).
>>>>>>>>
>>>>>>>> I tried JSON.parse, but getting the following errors :
>>>>>>>>
>>>>>>>> jjs> JSON.parse("[AMQP-0-10, MQTT-default, AMQP-0-91, AMQP-8-0,
>>>>>>>> AMQP-0-9]");
>>>>>>>> :1 SyntaxError: Invalid JSON: :1:1 Expected json
>>>>>>>> literal but found ident
>>>>>>>> [AMQP-0-10, MQTT-default, AMQP-0-91, AMQP-8-0, AMQP-0-9]
>>>>>>>>  ^
>>>>>>>>
>>>>>>>> jjs> JSON.parse([AMQP-0-10, MQTT-default, AMQP-0-91, AMQP-8-0,
>>>>>>>> AMQP-0-9]);
>>>>>>>> ECMAScript Exception: SyntaxError: :1:28 Expected an operand
>>>>>>>> but found default
>>>>>>>> JSON.parse([AMQP-0-10, MQTT-default, AMQP-0-91, AMQP-8-0,
>>>>>>>> AMQP-0-9]);
>>>>>>>> ^
>>>>>>>>
>>>>>>>> My OSGi method returns a Set.
>>>>>>>>
>>>>>>>> How can I achieve this ?
>>>>>>>>
>>>>>>>> Regards,
>>>>>>>> Hemika
>>>>>>>>
>>>>>>>> Hemika Kodikara
>>>>>>>> Software Engineer
>>>>>>>> WSO2 Inc.
>>>>>>>> lean . enterprise . middleware
>>>>>>>> http://wso2.com
>>>>>>>>
>>>>>>>> Mobile : +9477762
>>>>>>>>
>>>>>>>> ___
>>>>>>>> Dev mailing list
>>>>>>>> Dev@wso2.org
>>>>>>>> http://wso2.org/cgi-bin/mailman/listinfo/dev
>>>>>>>>
>>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> --
>>>>>>> Milinda Perera
>>>>>>> Software Engineer;
>>>>>>> WSO2 Inc. http://wso2.com ,
>>>>>>> Mobile: (+94) 714 115 032
>>>>>>>
>>>>>>>
>>>>>>
>>>>>
>>>>
>>>
>>>
>>> --
>>> With regards,
>>> *Manu*ranga Perera.
>>>
>>> phone : 071 7 70 20 50
>>> mail : m...@wso2.com
>>>
>>
>>
>>
>> --
>> Sajith Janaprasad Ariyarathna
>> Software Engineer; WSO2, Inc.;  http://wso2.com/
>>
>
>
>
> --
> Ayoma Wijethunga
> Software Engineer
> Platform Security Team
> WSO2, Inc.; http://wso2.com
> lean.enterprise.middleware
>
> Mobile : +94 (0) 719428123 <+94+(0)+719428123>
> Blog : http://www.ayomaonline.com
> LinkedIn: https://www.linkedin.com/in/ayoma
>
> ___
> Dev mailing list
> Dev@wso2.org
> http://wso2.org/cgi-bin/mailman/listinfo/dev
>
>


-- 
Sudharma Subasinghe,
Software Engineer,
WSO2 Inc.
Email: sudhar...@wso2.com <hasi...@wso2.com>
Mobile : +94 710 565 157 <%2B94%20718%20210%20200>
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


[Dev] [UUF] Passing values when continuing using server side js

2016-06-13 Thread Sudharma Subasinghe
Hi,

Currently, I am using "query string" parameter to pass a value from one
page to another page using server side js.

Is there any way to pass values without using "query string" for these
scenarios?

Thanks
Sudharma
-- 
Sudharma Subasinghe,
Software Engineer,
WSO2 Inc.
Email: sudhar...@wso2.com <hasi...@wso2.com>
Mobile : +94 710 565 157 <%2B94%20718%20210%20200>
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


[Dev] [UUF] Samples are not working properly with new changes in wso2:master branch

2016-06-05 Thread Sudharma Subasinghe
teGuardingDynamicLinker.getGuardedInvocation(CompositeGuardingDynamicLinker.java:124)
at
jdk.internal.dynalink.support.LinkerServicesImpl.getGuardedInvocation(LinkerServicesImpl.java:149)
at jdk.internal.dynalink.DynamicLinker.relink(DynamicLinker.java:233)
at
jdk.nashorn.internal.scripts.Script$Recompilation$10$72A$\^eval\_.onRequest(/home/sudharma/Documents/carbon-uuf/product/target/wso2uuf-1.0.0-SNAPSHOT/deployment/uufapps/org.wso2.uuf.sample.pets-store/components/root/pages/pets/{id}.js:3)
at
jdk.nashorn.internal.runtime.ScriptFunctionData.invoke(ScriptFunctionData.java:658)
at
jdk.nashorn.internal.runtime.ScriptFunction.invoke(ScriptFunction.java:229)
at
jdk.nashorn.internal.runtime.ScriptRuntime.apply(ScriptRuntime.java:387)
at
jdk.nashorn.api.scripting.ScriptObjectMirror.callMember(ScriptObjectMirror.java:192)
at
jdk.nashorn.api.scripting.NashornScriptEngine.invokeImpl(NashornScriptEngine.java:381)
... 24 more

Appreciate your response.

Thanks
Sudharma
-- 
Sudharma Subasinghe,
Software Engineer,
WSO2 Inc.
Email: sudhar...@wso2.com <hasi...@wso2.com>
Mobile : +94 710 565 157 <%2B94%20718%20210%20200>
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


[Dev] [UUF] Functionalities related OSGi Services are not working

2016-05-30 Thread Sudharma Subasinghe
/1.1", "uri": "/bpmn-explorer/bpmn/process",
"queryString": "null"}, uriParams={}}'.
at
org.wso2.carbon.uuf.handlebars.JSExecutable.execute(JSExecutable.java:75)
at
org.wso2.carbon.uuf.handlebars.renderable.HbsPageRenderable.executeExecutable(HbsPageRenderable.java:92)
at
org.wso2.carbon.uuf.handlebars.renderable.HbsPageRenderable.render(HbsPageRenderable.java:63)
at org.wso2.carbon.uuf.core.Page.render(Page.java:48)
at org.wso2.carbon.uuf.core.Component.renderPage(Component.java:89)
at org.wso2.carbon.uuf.core.App.renderPage(App.java:85)
at org.wso2.carbon.uuf.internal.UUFRegistry.serve(UUFRegistry.java:113)
at
org.wso2.carbon.uuf.connector.ms.UUFMicroservice.execute(UUFMicroservice.java:105)
at
org.wso2.carbon.uuf.connector.ms.UUFMicroservice.get(UUFMicroservice.java:93)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at
org.wso2.msf4j.internal.router.HttpMethodInfo.invoke(HttpMethodInfo.java:95)
at
org.wso2.msf4j.internal.router.HttpDispatcher.channelRead0(HttpDispatcher.java:53)
at
org.wso2.msf4j.internal.router.HttpDispatcher.channelRead0(HttpDispatcher.java:31)
at
io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:105)
at
io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:308)
at
io.netty.channel.AbstractChannelHandlerContext.access$600(AbstractChannelHandlerContext.java:32)
at
io.netty.channel.AbstractChannelHandlerContext$7.run(AbstractChannelHandlerContext.java:299)
at
io.netty.util.concurrent.DefaultEventExecutor.run(DefaultEventExecutor.java:36)
at
io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:110)
at
io.netty.util.concurrent.DefaultThreadFactory$DefaultRunnableDecorator.run(DefaultThreadFactory.java:137)
at java.lang.Thread.run(Thread.java:745)
Caused by: javax.script.ScriptException: TypeError:
org.wso2.carbon.uuf.handlebars.JSExecutable$$Lambda$87/1272884125@25700705
is not a function in
/home/sudharma/Documents/carbon-uuf/product/target/wso2uuf-1.0.0-m5/deployment/uufapps/org.wso2.uuf.sample.bpmn-explorer/components/root/pages/bpmn/process.js
at line number 3
at
jdk.nashorn.api.scripting.NashornScriptEngine.throwAsScriptException(NashornScriptEngine.java:455)
at
jdk.nashorn.api.scripting.NashornScriptEngine.invokeImpl(NashornScriptEngine.java:387)
at
jdk.nashorn.api.scripting.NashornScriptEngine.invokeFunction(NashornScriptEngine.java:187)
at
org.wso2.carbon.uuf.handlebars.JSExecutable.execute(JSExecutable.java:72)
... 23 more
Caused by:
/home/sudharma/Documents/carbon-uuf/product/target/wso2uuf-1.0.0-m5/deployment/uufapps/org.wso2.uuf.sample.bpmn-explorer/components/root/pages/bpmn/process.js:3
TypeError:
org.wso2.carbon.uuf.handlebars.JSExecutable$$Lambda$87/1272884125@25700705
is not a function
at jdk.nashorn.internal.runtime.ECMAErrors.error(ECMAErrors.java:57)
at
jdk.nashorn.internal.runtime.ECMAErrors.typeError(ECMAErrors.java:213)
at
jdk.nashorn.internal.runtime.ECMAErrors.typeError(ECMAErrors.java:185)
at
jdk.nashorn.internal.runtime.ECMAErrors.typeError(ECMAErrors.java:172)
at
jdk.nashorn.internal.runtime.linker.NashornBottomLinker.linkBean(NashornBottomLinker.java:100)
at
jdk.nashorn.internal.runtime.linker.NashornBottomLinker.getGuardedInvocation(NashornBottomLinker.java:71)
at
jdk.internal.dynalink.support.CompositeGuardingDynamicLinker.getGuardedInvocation(CompositeGuardingDynamicLinker.java:124)
at
jdk.internal.dynalink.support.LinkerServicesImpl.getGuardedInvocation(LinkerServicesImpl.java:149)
at jdk.internal.dynalink.DynamicLinker.relink(DynamicLinker.java:233)
at
jdk.nashorn.internal.scripts.Script$Recompilation$15$28A$\^eval\_.onRequest(/home/sudharma/Documents/carbon-uuf/product/target/wso2uuf-1.0.0-m5/deployment/uufapps/org.wso2.uuf.sample.bpmn-explorer/components/root/pages/bpmn/process.js:3)
at
jdk.nashorn.internal.runtime.ScriptFunctionData.invoke(ScriptFunctionData.java:638)
at
jdk.nashorn.internal.runtime.ScriptFunction.invoke(ScriptFunction.java:229)
at
jdk.nashorn.internal.runtime.ScriptRuntime.apply(ScriptRuntime.java:387)
at
jdk.nashorn.api.scripting.ScriptObjectMirror.callMember(ScriptObjectMirror.java:192)
at
jdk.nashorn.api.scripting.NashornScriptEngine.invokeImpl(NashornScriptEngine.java:381)
... 25 more


Appreciate if you can help to resolve these issues.

Thanks
Sudharma
-- 
Sudharma Subasinghe,
Software Engineer,
WSO2 Inc.
Email: sudhar...@wso2.com <hasi...@wso2.com>
Mobile : +94 710 565 157 <%2B94%20718%20210%20200>
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] [UUF] Failing remote debugging the code of UUF v1.0.0-m5

2016-05-26 Thread Sudharma Subasinghe
Hi Rasika,

Those two issues are solved with the provided fix. Thank you  for the
response.

On Fri, May 27, 2016 at 11:14 AM, Rasika Perera <rasi...@wso2.com> wrote:

> ​Hi Sudharma,
>
> ​UUF will turning into the debug mode from "-Xdebug" JVM parameter(when
> remote debugging is on).
>
> When UUF debug mode is on, It doesn't cache anything. Trying to reload the
> application per each request. This error occurs when trying to reload the
> app. This is a known bug and fixed with [1].
>
> Also it deactivates the debug pointers after starting the debug mode
>
> Can you verify this behaviour? This should not affect your IDE or break
> pointers.
>
> [1] 
> *https://github.com/wso2/carbon-uuf/commit/fe1255a702d08370843db2e06096412ba283708c
> <https://github.com/wso2/carbon-uuf/commit/fe1255a702d08370843db2e06096412ba283708c>*
>
>
> On Fri, May 27, 2016 at 10:32 AM, Sudharma Subasinghe <sudhar...@wso2.com>
> wrote:
>
>> Hi,
>>
>> I got following exception while loading the uuf app under remote
>> debugging mode. Also it deactivates the debug pointers after starting the
>> debug mode.
>>
>> [2016-05-27 10:12:48,206] ERROR
>> {org.wso2.carbon.uuf.internal.UUFRegistry} - A server occurred while
>> serving for request '/bpmn-explorer/'.
>> org.wso2.carbon.uuf.exception.UUFException: Cannot reload app
>> 'org.wso2.uuf.sample.bpmn-explorer'.
>> at
>> org.wso2.carbon.uuf.internal.UUFRegistry.lambda$reloadApp$15(UUFRegistry.java:158)
>> at
>> org.wso2.carbon.uuf.internal.UUFRegistry$$Lambda$113/1112994017.get(Unknown
>> Source)
>> at java.util.Optional.orElseThrow(Optional.java:290)
>> at
>> org.wso2.carbon.uuf.internal.UUFRegistry.reloadApp(UUFRegistry.java:158)
>> at org.wso2.carbon.uuf.internal.UUFRegistry.serve(UUFRegistry.java:99)
>> at
>> org.wso2.carbon.uuf.connector.ms.UUFMicroservice.execute(UUFMicroservice.java:105)
>> at
>> org.wso2.carbon.uuf.connector.ms.UUFMicroservice.get(UUFMicroservice.java:93)
>> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>> at
>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
>> at
>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>> at java.lang.reflect.Method.invoke(Method.java:497)
>> at
>> org.wso2.msf4j.internal.router.HttpMethodInfo.invoke(HttpMethodInfo.java:95)
>> at
>> org.wso2.msf4j.internal.router.HttpDispatcher.channelRead0(HttpDispatcher.java:53)
>> at
>> org.wso2.msf4j.internal.router.HttpDispatcher.channelRead0(HttpDispatcher.java:31)
>> at
>> io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:105)
>> at
>> io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:308)
>> at
>> io.netty.channel.AbstractChannelHandlerContext.access$600(AbstractChannelHandlerContext.java:32)
>> at
>> io.netty.channel.AbstractChannelHandlerContext$7.run(AbstractChannelHandlerContext.java:299)
>> at
>> io.netty.util.concurrent.DefaultEventExecutor.run(DefaultEventExecutor.java:36)
>> at
>> io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:110)
>> at
>> io.netty.util.concurrent.DefaultThreadFactory$DefaultRunnableDecorator.run(DefaultThreadFactory.java:137)
>>
>> Without remote debugging mode enabling, it loads apps successfully.
>>
>> Without "Debugger.isDebuggingEnabled()" as in [1], it starts the
>> debugging successfully. But still gives the same exception.
>>
>> I think, when debugging is enabled, reloading the requested app is not
>> properly working.
>>
>> [1]
>> https://github.com/wso2/carbon-uuf/blob/v1.0.0-m5/uuf-core/src/main/java/org/wso2/carbon/uuf/internal/UUFRegistry.java#L98
>>
>> Thanks
>> Sudharma
>>
>>
>>
>>
>> --
>> Sudharma Subasinghe,
>> Software Engineer,
>> WSO2 Inc.
>> Email: sudhar...@wso2.com <hasi...@wso2.com>
>> Mobile : +94 710 565 157 <%2B94%20718%20210%20200>
>>
>
>
>
> --
> With Regards,
>
> *Rasika Perera*
> Software Engineer
> M: +94 71 680 9060 E: rasi...@wso2.com
> LinkedIn: http://lk.linkedin.com/in/rasika90
>
> WSO2 Inc. www.wso2.com
> lean.enterprise.middleware
>



-- 
Sudharma Subasinghe,
Software Engineer,
WSO2 Inc.
Email: sudhar...@wso2.com <hasi...@wso2.com>
Mobile : +94 710 565 157 <%2B94%20718%20210%20200>
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


[Dev] [UUF] Failing remote debugging the code of UUF v1.0.0-m5

2016-05-26 Thread Sudharma Subasinghe
Hi,

I got following exception while loading the uuf app under remote debugging
mode. Also it deactivates the debug pointers after starting the debug mode.

[2016-05-27 10:12:48,206] ERROR {org.wso2.carbon.uuf.internal.UUFRegistry}
- A server occurred while serving for request '/bpmn-explorer/'.
org.wso2.carbon.uuf.exception.UUFException: Cannot reload app
'org.wso2.uuf.sample.bpmn-explorer'.
at
org.wso2.carbon.uuf.internal.UUFRegistry.lambda$reloadApp$15(UUFRegistry.java:158)
at
org.wso2.carbon.uuf.internal.UUFRegistry$$Lambda$113/1112994017.get(Unknown
Source)
at java.util.Optional.orElseThrow(Optional.java:290)
at
org.wso2.carbon.uuf.internal.UUFRegistry.reloadApp(UUFRegistry.java:158)
at org.wso2.carbon.uuf.internal.UUFRegistry.serve(UUFRegistry.java:99)
at
org.wso2.carbon.uuf.connector.ms.UUFMicroservice.execute(UUFMicroservice.java:105)
at
org.wso2.carbon.uuf.connector.ms.UUFMicroservice.get(UUFMicroservice.java:93)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at
org.wso2.msf4j.internal.router.HttpMethodInfo.invoke(HttpMethodInfo.java:95)
at
org.wso2.msf4j.internal.router.HttpDispatcher.channelRead0(HttpDispatcher.java:53)
at
org.wso2.msf4j.internal.router.HttpDispatcher.channelRead0(HttpDispatcher.java:31)
at
io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:105)
at
io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:308)
at
io.netty.channel.AbstractChannelHandlerContext.access$600(AbstractChannelHandlerContext.java:32)
at
io.netty.channel.AbstractChannelHandlerContext$7.run(AbstractChannelHandlerContext.java:299)
at
io.netty.util.concurrent.DefaultEventExecutor.run(DefaultEventExecutor.java:36)
at
io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:110)
at
io.netty.util.concurrent.DefaultThreadFactory$DefaultRunnableDecorator.run(DefaultThreadFactory.java:137)

Without remote debugging mode enabling, it loads apps successfully.

Without "Debugger.isDebuggingEnabled()" as in [1], it starts the debugging
successfully. But still gives the same exception.

I think, when debugging is enabled, reloading the requested app is not
properly working.

[1]
https://github.com/wso2/carbon-uuf/blob/v1.0.0-m5/uuf-core/src/main/java/org/wso2/carbon/uuf/internal/UUFRegistry.java#L98

Thanks
Sudharma




-- 
Sudharma Subasinghe,
Software Engineer,
WSO2 Inc.
Email: sudhar...@wso2.com <hasi...@wso2.com>
Mobile : +94 710 565 157 <%2B94%20718%20210%20200>
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] [UUF] Pet store sample not working without last forwards slash

2016-05-26 Thread Sudharma Subasinghe
Hi Hemika,

I faced the same problem. I think, it is because the implementation says
"An URI must end with a slash."

[1]
https://github.com/wso2/carbon-uuf/blob/v1.0.0-m5/uuf-core/src/main/java/org/wso2/carbon/uuf/internal/util/RequestUtil.java#L29

On Thu, May 26, 2016 at 6:39 PM, Manuranga Perera <m...@wso2.com> wrote:

> Actually without slash one should redirect to the other , that's what
> tomcat does
>
> ___
> Dev mailing list
> Dev@wso2.org
> http://wso2.org/cgi-bin/mailman/listinfo/dev
>
>


-- 
Sudharma Subasinghe,
Software Engineer,
WSO2 Inc.
Email: sudhar...@wso2.com <hasi...@wso2.com>
Mobile : +94 710 565 157 <%2B94%20718%20210%20200>
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] [UUF] Referring correspond client side .Js script with Handlebars template

2016-05-26 Thread Sudharma Subasinghe
Thank you for the response.

On Thu, May 26, 2016 at 2:21 PM, Hemika Kodikara <hem...@wso2.com> wrote:

> Hi Rasika/SajithAR,
>
> Thanks for the explanation.
>
> Regards,
> Hemika
>
> Hemika Kodikara
> Software Engineer
> WSO2 Inc.
> lean . enterprise . middleware
> http://wso2.com
>
> Mobile : +9477762
>
> On Thu, May 26, 2016 at 2:19 PM, Rasika Perera <rasi...@wso2.com> wrote:
>
>> Hi Hemika,
>>
>> {{#headOther}} is a block helper. This allows you to add anything between
>>  tags. For instance;
>>
>> {{#headOther}}
>> 
>> {{/headOther}}
>>
>> You can use this helper whenever other helpers "title, css, headJs" is
>> not sufficient.
>>
>> On Thu, May 26, 2016 at 2:07 PM, Hemika Kodikara <hem...@wso2.com> wrote:
>>
>>> Hi SajithAR,
>>>
>>> What kind of implementations/uses can be done through the {{#headOther}} 
>>> placeholder
>>> ?
>>>
>>> Regards,
>>> Hemika
>>>
>>> Hemika Kodikara
>>> Software Engineer
>>> WSO2 Inc.
>>> lean . enterprise . middleware
>>> http://wso2.com
>>>
>>> Mobile : +9477762
>>>
>>> On Thu, May 26, 2016 at 2:04 PM, SajithAR Ariyarathna <sajit...@wso2.com
>>> > wrote:
>>>
>>>> We changed names of some Handlebars helpers to make them short whilst
>>>> being self-descriptive. I have updated the description of 1.0.0-M5 release
>>>> [1], please refer it.
>>>>
>>>> [1] https://github.com/wso2/carbon-uuf/releases/tag/v1.0.0-m5
>>>>
>>>> Thanks.
>>>>
>>>> On Thu, May 26, 2016 at 1:42 PM, Hemika Kodikara <hem...@wso2.com>
>>>> wrote:
>>>>
>>>>> Hi Sudharma,
>>>>>
>>>>> It seems they have been changed [1]. Can you try with "headJs" instead
>>>>> of "headerJs".
>>>>>
>>>>> [1] -
>>>>> https://github.com/wso2/carbon-uuf/commit/2f95a6cd27604f033268bbd4dd807c75d993b18a
>>>>>
>>>>> Regards,
>>>>> Hemika
>>>>>
>>>>> Hemika Kodikara
>>>>> Software Engineer
>>>>> WSO2 Inc.
>>>>> lean . enterprise . middleware
>>>>> http://wso2.com
>>>>>
>>>>> Mobile : +9477762
>>>>>
>>>>> On Thu, May 26, 2016 at 1:12 PM, Sudharma Subasinghe <
>>>>> sudhar...@wso2.com> wrote:
>>>>>
>>>>>> Hi,
>>>>>>
>>>>>> I successfully loaded client side .Js script with Handlebars template
>>>>>> with 1.0.0-M4 release. I used the approach as following in the
>>>>>> "process-details.hbs" template.
>>>>>>
>>>>>> {{headerJs "/js/process-details.js"}}
>>>>>>
>>>>>> Now I am getting following exception for the same approach with 1.0.0-M5 
>>>>>> release.
>>>>>>
>>>>>> [2016-05-26 12:49:27,353] ERROR 
>>>>>> {org.wso2.carbon.uuf.internal.UUFRegistry} - An unexpected error 
>>>>>> occurred while serving for request '/bpmn-explorer/bpmn/process'. 
>>>>>> com.github.jknack.handlebars.HandlebarsException: 
>>>>>> components/root/fragments/process-details/process-details.hbs:1:2: 
>>>>>> java.lang.IllegalArgumentException: Cannot evaluate the variable/helper 
>>>>>> 'headerJs'.
>>>>>> components/root/fragments/process-details/process-details.hbs:1:2
>>>>>>  at 
>>>>>> org.wso2.carbon.uuf.handlebars.helpers.runtime.MissingHelper.apply(MissingHelper.java:36)
>>>>>>  at 
>>>>>> com.github.jknack.handlebars.internal.Variable.merge(Variable.java:166)
>>>>>>  at 
>>>>>> com.github.jknack.handlebars.internal.BaseTemplate.apply(BaseTemplate.java:128)
>>>>>>  at 
>>>>>> com.github.jknack.handlebars.internal.TemplateList.merge(TemplateList.java:94)
>>>>>>  at 
>>>>>> com.github.jknack.handlebars.internal.BaseTemplate.apply(BaseTemplate.java:128)
>>>>>>  at 
>>>>>> com.github.jknack.handlebars.internal.BaseTemplate.apply(BaseTemplate.java:116)
>>>>>>  a

[Dev] [UUF] Referring correspond client side .Js script with Handlebars template

2016-05-26 Thread Sudharma Subasinghe
read.run(Thread.java:745)
Caused by: java.lang.IllegalArgumentException: Cannot evaluate the
variable/helper 'headerJs'.
... 47 more

How do we can refer client side .Js script with Handlebars template?

-- 
Sudharma Subasinghe,
Software Engineer,
WSO2 Inc.
Email: sudhar...@wso2.com <hasi...@wso2.com>
Mobile : +94 710 565 157 <%2B94%20718%20210%20200>
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] [UUF] Exception encountered while processing request for Sample apps

2016-05-25 Thread Sudharma Subasinghe
I fixed the issue after changing carbon-uuf-maven-plugin version to 1.0.0-m3

On Wed, May 25, 2016 at 2:27 PM, Sudharma Subasinghe <sudhar...@wso2.com>
wrote:

>
> Hi,
>
> I got the following exception while running samples under UUF 1.0.0-M5
> release.
>
> [2016-05-25 14:24:12,594] ERROR
> {org.wso2.msf4j.internal.router.ChannelChunkResponder} - Resource method
> threw an exception java.lang.reflect.InvocationTargetException
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> at java.lang.reflect.Method.invoke(Method.java:497)
> at
> org.wso2.msf4j.internal.router.HttpMethodInfo.invoke(HttpMethodInfo.java:95)
> at
> org.wso2.msf4j.internal.router.HttpDispatcher.channelRead0(HttpDispatcher.java:53)
> at
> org.wso2.msf4j.internal.router.HttpDispatcher.channelRead0(HttpDispatcher.java:31)
> at
> io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:105)
> at
> io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:308)
> at
> io.netty.channel.AbstractChannelHandlerContext.access$600(AbstractChannelHandlerContext.java:32)
> at
> io.netty.channel.AbstractChannelHandlerContext$7.run(AbstractChannelHandlerContext.java:299)
> at
> io.netty.util.concurrent.DefaultEventExecutor.run(DefaultEventExecutor.java:36)
> at
> io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:110)
> at
> io.netty.util.concurrent.DefaultThreadFactory$DefaultRunnableDecorator.run(DefaultThreadFactory.java:137)
> at java.lang.Thread.run(Thread.java:745)
> Caused by: org.wso2.carbon.uuf.exception.MalformedConfigurationException:
> Cannot find the value of 'defaultTheme' in the root component
> configurations.
> at
> org.wso2.carbon.uuf.api.Configuration.getDefaultThemeName(Configuration.java:82)
> at org.wso2.carbon.uuf.core.App.(App.java:52)
> at
> org.wso2.carbon.uuf.internal.core.create.AppCreator.createApp(AppCreator.java:153)
> at
> org.wso2.carbon.uuf.internal.UUFRegistry.lambda$loadApps$12(UUFRegistry.java:145)
> at
> org.wso2.carbon.uuf.internal.UUFRegistry$$Lambda$58/518009976.apply(Unknown
> Source)
> at
> java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193)
> at
> java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193)
> at
> java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:175)
> at java.util.Iterator.forEachRemaining(Iterator.java:116)
> at
> java.util.Spliterators$IteratorSpliterator.forEachRemaining(Spliterators.java:1801)
> at
> java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:512)
> at
> java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:502)
> at
> java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:708)
> at
> java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
> at
> java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:499)
> at
> org.wso2.carbon.uuf.internal.UUFRegistry.loadApps(UUFRegistry.java:149)
> at org.wso2.carbon.uuf.internal.UUFRegistry.serve(UUFRegistry.java:81)
> at
> org.wso2.carbon.uuf.connector.ms.UUFMicroservice.execute(UUFMicroservice.java:105)
> at
> org.wso2.carbon.uuf.connector.ms.UUFMicroservice.get(UUFMicroservice.java:93)
> ... 15 more
>
> Any thought on this is appreciated.
>
> Thanks
> Sudharma
> --
> Sudharma Subasinghe,
> Software Engineer,
> WSO2 Inc.
> Email: sudhar...@wso2.com <hasi...@wso2.com>
> Mobile : +94 710 565 157 <%2B94%20718%20210%20200>
>



-- 
Sudharma Subasinghe,
Software Engineer,
WSO2 Inc.
Email: sudhar...@wso2.com <hasi...@wso2.com>
Mobile : +94 710 565 157 <%2B94%20718%20210%20200>
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


[Dev] [UUF] Exception encountered while processing request for Sample apps

2016-05-25 Thread Sudharma Subasinghe
Hi,

I got the following exception while running samples under UUF 1.0.0-M5
release.

[2016-05-25 14:24:12,594] ERROR
{org.wso2.msf4j.internal.router.ChannelChunkResponder} - Resource method
threw an exception java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at
org.wso2.msf4j.internal.router.HttpMethodInfo.invoke(HttpMethodInfo.java:95)
at
org.wso2.msf4j.internal.router.HttpDispatcher.channelRead0(HttpDispatcher.java:53)
at
org.wso2.msf4j.internal.router.HttpDispatcher.channelRead0(HttpDispatcher.java:31)
at
io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:105)
at
io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:308)
at
io.netty.channel.AbstractChannelHandlerContext.access$600(AbstractChannelHandlerContext.java:32)
at
io.netty.channel.AbstractChannelHandlerContext$7.run(AbstractChannelHandlerContext.java:299)
at
io.netty.util.concurrent.DefaultEventExecutor.run(DefaultEventExecutor.java:36)
at
io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:110)
at
io.netty.util.concurrent.DefaultThreadFactory$DefaultRunnableDecorator.run(DefaultThreadFactory.java:137)
at java.lang.Thread.run(Thread.java:745)
Caused by: org.wso2.carbon.uuf.exception.MalformedConfigurationException:
Cannot find the value of 'defaultTheme' in the root component
configurations.
at
org.wso2.carbon.uuf.api.Configuration.getDefaultThemeName(Configuration.java:82)
at org.wso2.carbon.uuf.core.App.(App.java:52)
at
org.wso2.carbon.uuf.internal.core.create.AppCreator.createApp(AppCreator.java:153)
at
org.wso2.carbon.uuf.internal.UUFRegistry.lambda$loadApps$12(UUFRegistry.java:145)
at
org.wso2.carbon.uuf.internal.UUFRegistry$$Lambda$58/518009976.apply(Unknown
Source)
at
java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193)
at
java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193)
at
java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:175)
at java.util.Iterator.forEachRemaining(Iterator.java:116)
at
java.util.Spliterators$IteratorSpliterator.forEachRemaining(Spliterators.java:1801)
at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:512)
at
java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:502)
at
java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:708)
at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
at
java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:499)
at
org.wso2.carbon.uuf.internal.UUFRegistry.loadApps(UUFRegistry.java:149)
at org.wso2.carbon.uuf.internal.UUFRegistry.serve(UUFRegistry.java:81)
at
org.wso2.carbon.uuf.connector.ms.UUFMicroservice.execute(UUFMicroservice.java:105)
at
org.wso2.carbon.uuf.connector.ms.UUFMicroservice.get(UUFMicroservice.java:93)
... 15 more

Any thought on this is appreciated.

Thanks
Sudharma
-- 
Sudharma Subasinghe,
Software Engineer,
WSO2 Inc.
Email: sudhar...@wso2.com <hasi...@wso2.com>
Mobile : +94 710 565 157 <%2B94%20718%20210%20200>
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


[Dev] [Architecture] [BPS] [UUF] Developing BPMN Explorer UI using UUF for BPS

2016-05-19 Thread Sudharma Subasinghe
Hi all,

I am working on developing BPMN explorer ui using Unified UI Framework.

The existing BPMN explorer ui is for BPS which has built on C4 and it is
used Jaggery. So, I am working on BPMN explorer ui for BPS which is to be
released on C5.

We need to implement business logics in backend. For example, I need to
send request to backend from browser, and from backend to BPS. Is there
functionality to achieve it in UUF?

Any idea on this is appreciated.

Thanks
Sudharma

-- 
Sudharma Subasinghe,
Software Engineer,
WSO2 Inc.
Email: sudhar...@wso2.com <hasi...@wso2.com>
Mobile : +94 710 565 157 <%2B94%20718%20210%20200>
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


[Dev] [GSoC-2015] Proposal 4: ESB - JMS 2.0 support for transports and inbound endpoint

2015-03-10 Thread Sudharma Subasinghe
Hi,

I am Sudharma  Priyadarshani from Department of Computer Science and
Engineering, University of Moratuwa. Currently I am an intern at WSO2.

I went through the GSoC proposal list and interested in proposal [1]. I am
looking forward to contribute  to the project.

[1]
https://docs.wso2.com/display/GSoC/Project+Proposals+for+2015#ProjectProposalsfor2015-Proposal4:ESB-JMS2.0supportfortransportsandinboundendpoint

Thank you.


-- 
Sudharma Priyadarshani
Software Engineer Intern
+94 710565157
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev