You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ofbiz.apache.org by Ritz123 <ri...@gmail.com> on 2008/07/23 00:47:38 UTC

How does service event type work

Hi,

This is probably a basic question - but I could understand how it works.

I am looking at controller.xml file in e-commerce application. Specific line
is

<request-map uri="emailorder">
        <security https="true" direct-request="false"/>
        <event type="service" path="async" invoke="sendOrderConfirmation"/>
...

I see that event is of type service, so the service is invoked when the uri
is called. However what I dont understand is how are the contexts, both
dispatch context and the values context for the service IN variables, passed
in this case? 

Will appreciate any pointers
-- 
View this message in context: http://www.nabble.com/How-does-service-event-type-work-tp18600427p18600427.html
Sent from the OFBiz - User mailing list archive at Nabble.com.


Re: How does service event type work

Posted by Ritz123 <ri...@gmail.com>.
Thanks Adrian for the reply.

Feel stupid now, now I recall that event handles have the house keeping
logic for the event, so for the completion of the thread the context is
built in the ServiceEventHandler.java. 


Adrian Crum wrote:
> 
> All of that is handled automatically by the request handler and the 
> service engine. The request handler will pass the request parameters to 
> the service engine. The service engine will put those parameters in the 
> context along with some other objects, like userLogin, locale, timeZone, 
> etc.
> 
> -Adrian
> 
> Ritz123 wrote:
>> Thanks for the reply BJ.
>> 
>> Not sure if I was clear in my question. I know where the service is
>> defined,
>> I also know how services are called etc. But what I dont understand in
>> this
>> case is where is how is the context passed? e.g every service call needs
>> context to be passed so in this case, who is creating the context and
>> where,
>> is the question.
>> 
>> 
>> BJ Freeman wrote:
>>> look for:
>>> http://docs.ofbiz.org/display/OFBTECH/Framework+Introduction+Videos+and+Diagrams
>>> #6 Service Definitions and Implementations
>>> then if you have a xml editor that reads the xsd files you will see
>>> choices.
>>> usually events are in
>>> like:
>>> script/org/ofbiz/example/example/ExampleServices.xml
>>>
>>>
>>> Ritz123 sent the following on 7/22/2008 3:47 PM:
>>>> Hi,
>>>>
>>>> This is probably a basic question - but I could understand how it
>>>> works.
>>>>
>>>> I am looking at controller.xml file in e-commerce application. Specific
>>>> line
>>>> is
>>>>
>>>> <request-map uri="emailorder">
>>>>         <security https="true" direct-request="false"/>
>>>>         <event type="service" path="async"
>>>> invoke="sendOrderConfirmation"/>
>>>> ...
>>>>
>>>> I see that event is of type service, so the service is invoked when the
>>>> uri
>>>> is called. However what I dont understand is how are the contexts, both
>>>> dispatch context and the values context for the service IN variables,
>>>> passed
>>>> in this case? 
>>>>
>>>> Will appreciate any pointers
>>>
>>>
>> 
> 
> 

-- 
View this message in context: http://www.nabble.com/How-does-service-event-type-work-tp18600427p18601340.html
Sent from the OFBiz - User mailing list archive at Nabble.com.


Re: How does service event type work

Posted by Adrian Crum <ad...@hlmksw.com>.
All of that is handled automatically by the request handler and the 
service engine. The request handler will pass the request parameters to 
the service engine. The service engine will put those parameters in the 
context along with some other objects, like userLogin, locale, timeZone, 
etc.

-Adrian

Ritz123 wrote:
> Thanks for the reply BJ.
> 
> Not sure if I was clear in my question. I know where the service is defined,
> I also know how services are called etc. But what I dont understand in this
> case is where is how is the context passed? e.g every service call needs
> context to be passed so in this case, who is creating the context and where,
> is the question.
> 
> 
> BJ Freeman wrote:
>> look for:
>> http://docs.ofbiz.org/display/OFBTECH/Framework+Introduction+Videos+and+Diagrams
>> #6 Service Definitions and Implementations
>> then if you have a xml editor that reads the xsd files you will see
>> choices.
>> usually events are in
>> like:
>> script/org/ofbiz/example/example/ExampleServices.xml
>>
>>
>> Ritz123 sent the following on 7/22/2008 3:47 PM:
>>> Hi,
>>>
>>> This is probably a basic question - but I could understand how it works.
>>>
>>> I am looking at controller.xml file in e-commerce application. Specific
>>> line
>>> is
>>>
>>> <request-map uri="emailorder">
>>>         <security https="true" direct-request="false"/>
>>>         <event type="service" path="async"
>>> invoke="sendOrderConfirmation"/>
>>> ...
>>>
>>> I see that event is of type service, so the service is invoked when the
>>> uri
>>> is called. However what I dont understand is how are the contexts, both
>>> dispatch context and the values context for the service IN variables,
>>> passed
>>> in this case? 
>>>
>>> Will appreciate any pointers
>>
>>
> 

Re: How does service event type work

Posted by BJ Freeman <bj...@free-man.net>.
if you look in
applications/order/servicedef/services.xml
for sendOrderConfirmation
which takes you eventually to the
org.ofbiz.order.order.OrderServices"
public static Map sendOrderConfirmNotification(DispatchContext ctx, Map
context) {

in short you don't have to worry about it. it is done for you and you
get it as context in the service (java)


Ritz123 sent the following on 7/22/2008 4:38 PM:
> Thanks for the reply BJ.
> 
> Not sure if I was clear in my question. I know where the service is defined,
> I also know how services are called etc. But what I dont understand in this
> case is where is how is the context passed? e.g every service call needs
> context to be passed so in this case, who is creating the context and where,
> is the question.
> 
> 
> BJ Freeman wrote:
>> look for:
>> http://docs.ofbiz.org/display/OFBTECH/Framework+Introduction+Videos+and+Diagrams
>> #6 Service Definitions and Implementations
>> then if you have a xml editor that reads the xsd files you will see
>> choices.
>> usually events are in
>> like:
>> script/org/ofbiz/example/example/ExampleServices.xml
>>
>>
>> Ritz123 sent the following on 7/22/2008 3:47 PM:
>>> Hi,
>>>
>>> This is probably a basic question - but I could understand how it works.
>>>
>>> I am looking at controller.xml file in e-commerce application. Specific
>>> line
>>> is
>>>
>>> <request-map uri="emailorder">
>>>         <security https="true" direct-request="false"/>
>>>         <event type="service" path="async"
>>> invoke="sendOrderConfirmation"/>
>>> ...
>>>
>>> I see that event is of type service, so the service is invoked when the
>>> uri
>>> is called. However what I dont understand is how are the contexts, both
>>> dispatch context and the values context for the service IN variables,
>>> passed
>>> in this case? 
>>>
>>> Will appreciate any pointers
>>
>>
> 


Re: How does service event type work

Posted by Ritz123 <ri...@gmail.com>.
Thanks for the reply BJ.

Not sure if I was clear in my question. I know where the service is defined,
I also know how services are called etc. But what I dont understand in this
case is where is how is the context passed? e.g every service call needs
context to be passed so in this case, who is creating the context and where,
is the question.


BJ Freeman wrote:
> 
> look for:
> http://docs.ofbiz.org/display/OFBTECH/Framework+Introduction+Videos+and+Diagrams
> #6 Service Definitions and Implementations
> then if you have a xml editor that reads the xsd files you will see
> choices.
> usually events are in
> like:
> script/org/ofbiz/example/example/ExampleServices.xml
> 
> 
> Ritz123 sent the following on 7/22/2008 3:47 PM:
>> Hi,
>> 
>> This is probably a basic question - but I could understand how it works.
>> 
>> I am looking at controller.xml file in e-commerce application. Specific
>> line
>> is
>> 
>> <request-map uri="emailorder">
>>         <security https="true" direct-request="false"/>
>>         <event type="service" path="async"
>> invoke="sendOrderConfirmation"/>
>> ...
>> 
>> I see that event is of type service, so the service is invoked when the
>> uri
>> is called. However what I dont understand is how are the contexts, both
>> dispatch context and the values context for the service IN variables,
>> passed
>> in this case? 
>> 
>> Will appreciate any pointers
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/How-does-service-event-type-work-tp18600427p18601072.html
Sent from the OFBiz - User mailing list archive at Nabble.com.


Re: How does service event type work

Posted by BJ Freeman <bj...@free-man.net>.
look for:
http://docs.ofbiz.org/display/OFBTECH/Framework+Introduction+Videos+and+Diagrams
#6 Service Definitions and Implementations
then if you have a xml editor that reads the xsd files you will see choices.
usually events are in
like:
script/org/ofbiz/example/example/ExampleServices.xml


Ritz123 sent the following on 7/22/2008 3:47 PM:
> Hi,
> 
> This is probably a basic question - but I could understand how it works.
> 
> I am looking at controller.xml file in e-commerce application. Specific line
> is
> 
> <request-map uri="emailorder">
>         <security https="true" direct-request="false"/>
>         <event type="service" path="async" invoke="sendOrderConfirmation"/>
> ...
> 
> I see that event is of type service, so the service is invoked when the uri
> is called. However what I dont understand is how are the contexts, both
> dispatch context and the values context for the service IN variables, passed
> in this case? 
> 
> Will appreciate any pointers