Send Request and Response to an existing event

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Send Request and Response to an existing event

bhargav.tri
Hi,
I want to pass the request and response to a simple method (
createCustomer) of an existing event (CustomerEvent.xml).

I am calling this event as a part of a service which is defined in my
services.xml file by using the "dispatcher.runsync " .

Could someone please let me know if this is doable and if so then how?

Bhargav
Software Engineer
Object Edge Inc.
Reply | Threaded
Open this post in threaded view
|

Re: Send Request and Response to an existing event

deb.panda
Hi,

Enlisted are some options below. Perhaps, I am not able to get the
bigscene, but here is my take. (Could you elaborate the scenario?)
Upon triggering the call, I hit the controller and there I can cascade the
request based on the response.

Request cascaded over from one event to another. (Events may be
simple/minilang or java or ajax)
Within controller.xml - Single pass
        <request-map uri="createcustomer">
                <security https="true" auth="true" />
                <event type="simple"
                        path=
"component://ecommerce/script/org/ofbiz/ecommerce/customer/CustomerEvents.xml"
                        invoke="createCustomer" />
                <response name="success" type="view" value="main" />
                <response name="error" type="view" value="newcustomer" />
        </request-map>

Within controller.xml - Multiple pass
The response statements can be cascaded to another request map.

        <request-map uri="processCustomerSettings">
        <security https="true" auth="false"/>
        <event type="simple" path="component://..../XYZ.xml" invoke=
"processCustomerSettings"/>
        <response name="success" type="request" value=
"createUpdateShippingAddressCheckout"/>
        <response name="error" type="view" value="OnePageCheckout"/>
      </request-map>
        <request-map uri="createUpdateShippingAddressCheckout">
                <security https="true" auth="false" />
                <event type="simple"
                        path="component://..../CustomerEvents.xml"
                        invoke="createUpdateCustomerAndShippingAddress" />
                <response name="success" type="request" value=
"setShippingOption" />
                <response name="error" type="view" value="OnePageCheckout"
/>
        </request-map>

Passing request method from within simple method to another.
  <call-bsh><![CDATA[
                java.util.ArrayList userMessagePices = new
java.util.ArrayList();
                String userFname = (String)
personContext.get("firstName");
                 .....
            XYZ.SmsServicesRegistration.smsServices(request, response,
userMessagePices, phoneNo.toString());
 
        ]]></call-bsh>
 </simple-method>

Thanks,
Dev



From:
[hidden email]
To:
[hidden email], [hidden email]
Date:
05/09/2012 04:06 AM
Subject:
Send Request and Response to an existing event



Hi,
I want to pass the request and response to a simple method (
createCustomer) of an existing event (CustomerEvent.xml).

I am calling this event as a part of a service which is defined in my
services.xml file by using the "dispatcher.runsync " .

Could someone please let me know if this is doable and if so then how?

Bhargav
Software Engineer
Object Edge Inc.

=====-----=====-----=====
Notice: The information contained in this e-mail
message and/or attachments to it may contain
confidential or privileged information. If you are
not the intended recipient, any dissemination, use,
review, distribution, printing or copying of the
information contained in this e-mail message
and/or attachments to it are strictly prohibited. If
you have received this communication in error,
please notify us by reply e-mail or telephone and
immediately and permanently delete the message
and any attachments. Thank you


Thanks,
Dev Panda