>
> Stub will wrap the REST API calls

I don't understand what you mean by a stub, but we shouldn't be repeating
the same problem we have with C4 where you need to hand-write a wrapper
around service calls.

On Fri, May 20, 2016 at 6:16 AM, Sudharma Subasinghe <[email protected]>
wrote:

> +1
> will work on that idea. Thank you for the guidance.
>
> On Fri, May 20, 2016 at 3:28 PM, SajithAR Ariyarathna <[email protected]>
> wrote:
>
>> As per our offline discussion (with Chathura), packing a stub with the
>> 'BPMN-explorer' UI feature is the correct approach here. Stub will wrap the
>> REST API calls (means it will call the REST API behalf of you) and you can
>> call the stub in your server-side JS (via Nashorn).
>>
>> Thanks.
>>
>> On Fri, May 20, 2016 at 2:56 PM, Sudharma Subasinghe <[email protected]>
>> wrote:
>>
>>> Hi Sajith,
>>>
>>> We have to build the BPMN-explorer to deploy in PC(Process Center) too.
>>> Since PC does not contain BPMN engine we cannot take data from osgi
>>> service. When deploying it in PC we have to depend on BPS BPMN RestAPI.
>>>
>>> On Fri, May 20, 2016 at 12:33 PM, Chathura Ekanayake <[email protected]>
>>> wrote:
>>>
>>>> Yes, we will have to go with REST calls. We need to run UI-backend and
>>>> server in separate jvms, when running the BPMN explorer in PC.
>>>>
>>>> Regards,
>>>> Chathura
>>>>
>>>> On Fri, May 20, 2016 at 11:28 AM, Nandika Jayawardana <[email protected]
>>>> > wrote:
>>>>
>>>>> In case of BPS, what we develop is similar to a web application which
>>>>> should be independent of the BPS backend. Idea is that this component has
>>>>> to be packaged into PC ( process center ) as well as BPS. Hence, native
>>>>> OSGi call's is not sufficient for our requirement.
>>>>>
>>>>> Regards
>>>>> Nandika
>>>>>
>>>>> On Fri, May 20, 2016 at 11:17 AM, Rasika Perera <[email protected]>
>>>>> wrote:
>>>>>
>>>>>> Hi,
>>>>>>
>>>>>> We have came up with this best practise. There are basically two
>>>>>> scenarios;
>>>>>>
>>>>>> 1. When the back-end is belongs to your product(eg. calling BPS
>>>>>> runtime).
>>>>>>
>>>>>> We assume that you have written your JAX-RS based on an OSGi service.
>>>>>> JAX-RS will *not* hold any business logic and act as API interface(Facade
>>>>>> Pattern). In this case making a network call(AJAX) from UI to your own VM
>>>>>> is discouraged. You should use callOsgiService() function on the server
>>>>>> side Js.
>>>>>>
>>>>>> 2. When the back-end is external(eg. calling Twitter API).
>>>>>>
>>>>>> Here we don't provide any server side feature for handling HTTP calls
>>>>>> because this will again abuse and use to call own VM back-ends. You can
>>>>>> simply write AJAX calls from UI using $.ajax() in jquery or 
>>>>>> XMLHttpRequest
>>>>>> in client-side Js.
>>>>>>
>>>>>> * In the edge cases that you really need to make HTTP calls from the
>>>>>> server side Js, you can initiate; apache commons 'HttpClient' or
>>>>>> java.net 'URLConnection' through Nashorn.
>>>>>>
>>>>>> * Also you might still need to write JAX-RS APIs for your OSGi
>>>>>> services for customers.
>>>>>>
>>>>>> Thanks,
>>>>>> Rasika
>>>>>>
>>>>>> On Fri, May 20, 2016 at 10:42 AM, Chathura Ekanayake <
>>>>>> [email protected]> wrote:
>>>>>>
>>>>>>> So there is not separation between UI back-end and the actual server
>>>>>>> (e.g. BPS runtime)? i.e. both always run in the same jvm?
>>>>>>>
>>>>>>> On Thu, May 19, 2016 at 11:47 PM, Manuranga Perera <[email protected]>
>>>>>>> wrote:
>>>>>>>
>>>>>>>> Yes, you will be able to call OSGi services.
>>>>>>>>
>>>>>>>> On Thu, May 19, 2016 at 12:53 PM, Hemika Kodikara <[email protected]>
>>>>>>>> wrote:
>>>>>>>>
>>>>>>>>> Hi All,
>>>>>>>>>
>>>>>>>>> For clarification, does this mean we will be able to invoke a
>>>>>>>>> service side function(through nashorn) upon client request ? As in 
>>>>>>>>> when a
>>>>>>>>> user clicks a button, we can call a server side function ?
>>>>>>>>>
>>>>>>>>> Regards,
>>>>>>>>> Hemika
>>>>>>>>>
>>>>>>>>> Hemika Kodikara
>>>>>>>>> Software Engineer
>>>>>>>>> WSO2 Inc.
>>>>>>>>> lean . enterprise . middleware
>>>>>>>>> http://wso2.com
>>>>>>>>>
>>>>>>>>> Mobile : +94777688882
>>>>>>>>>
>>>>>>>>> On Thu, May 19, 2016 at 3:43 PM, SajithAR Ariyarathna <
>>>>>>>>> [email protected]> wrote:
>>>>>>>>>
>>>>>>>>>> Hi Sudharma,
>>>>>>>>>>
>>>>>>>>>> In the browser (client-side), you can do AJAX calls to the
>>>>>>>>>> necessary REST APIs. However, doing HTTP requests from UI backend 
>>>>>>>>>> (which
>>>>>>>>>> runs on the server-side) to REST APIs (which also runs on the 
>>>>>>>>>> server-side)
>>>>>>>>>> is not recommended. Instead of that you should call OSGi services. 
>>>>>>>>>> Calling
>>>>>>>>>> OSGI services from server-side JS will be available in the next 
>>>>>>>>>> milestone
>>>>>>>>>> of UUF.
>>>>>>>>>>
>>>>>>>>>> Thanks.
>>>>>>>>>>
>>>>>>>>>> On Thu, May 19, 2016 at 2:21 PM, Sudharma Subasinghe <
>>>>>>>>>> [email protected]> wrote:
>>>>>>>>>>
>>>>>>>>>>> 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: [email protected] <[email protected]>
>>>>>>>>>>> Mobile : +94 710 565 157 <%2B94%20718%20210%20200>
>>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> --
>>>>>>>>>> Sajith Janaprasad Ariyarathna
>>>>>>>>>> Software Engineer; WSO2, Inc.;  http://wso2.com/
>>>>>>>>>>
>>>>>>>>>> _______________________________________________
>>>>>>>>>> Architecture mailing list
>>>>>>>>>> [email protected]
>>>>>>>>>> https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> --
>>>>>>>> With regards,
>>>>>>>> *Manu*ranga Perera.
>>>>>>>>
>>>>>>>> phone : 071 7 70 20 50
>>>>>>>> mail : [email protected]
>>>>>>>>
>>>>>>>> _______________________________________________
>>>>>>>> Dev mailing list
>>>>>>>> [email protected]
>>>>>>>> http://wso2.org/cgi-bin/mailman/listinfo/dev
>>>>>>>>
>>>>>>>>
>>>>>>>
>>>>>>> _______________________________________________
>>>>>>> Dev mailing list
>>>>>>> [email protected]
>>>>>>> http://wso2.org/cgi-bin/mailman/listinfo/dev
>>>>>>>
>>>>>>>
>>>>>>
>>>>>>
>>>>>> --
>>>>>> With Regards,
>>>>>>
>>>>>> *Rasika Perera*
>>>>>> Software Engineer
>>>>>> M: +94 71 680 9060 E: [email protected]
>>>>>> LinkedIn: http://lk.linkedin.com/in/rasika90
>>>>>>
>>>>>> WSO2 Inc. www.wso2.com
>>>>>> lean.enterprise.middleware
>>>>>>
>>>>>> _______________________________________________
>>>>>> Dev mailing list
>>>>>> [email protected]
>>>>>> http://wso2.org/cgi-bin/mailman/listinfo/dev
>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>> --
>>>>> Nandika Jayawardana
>>>>> WSO2 Inc ; http://wso2.com
>>>>> lean.enterprise.middleware
>>>>>
>>>>
>>>>
>>>> _______________________________________________
>>>> Dev mailing list
>>>> [email protected]
>>>> http://wso2.org/cgi-bin/mailman/listinfo/dev
>>>>
>>>>
>>>
>>>
>>> --
>>> Sudharma Subasinghe,
>>> Software Engineer,
>>> WSO2 Inc.
>>> Email: [email protected] <[email protected]>
>>> Mobile : +94 710 565 157 <%2B94%20718%20210%20200>
>>>
>>
>>
>>
>> --
>> Sajith Janaprasad Ariyarathna
>> Software Engineer; WSO2, Inc.;  http://wso2.com/
>>
>
>
>
> --
> Sudharma Subasinghe,
> Software Engineer,
> WSO2 Inc.
> Email: [email protected] <[email protected]>
> Mobile : +94 710 565 157 <%2B94%20718%20210%20200>
>
> _______________________________________________
> Architecture mailing list
> [email protected]
> https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture
>
>


-- 
With regards,
*Manu*ranga Perera.

phone : 071 7 70 20 50
mail : [email protected]
_______________________________________________
Architecture mailing list
[email protected]
https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture

Reply via email to