10 Replies Latest reply on Apr 30, 2014 11:47 AM by 2655429

    Reply to synchronous process

    2655429

      Hi Guys,

       

      I have a requirement where after sending the response back to calling webservice, I have to perform a series of tasks.

      The issue is that after sending the response, if any of the tasks fail then the 'SUCCESS' response is not sent rather the webservice gets a fault.

      Is there any way that I can avoid sending the fault even if the call to service after sending response fails.

       

      Thanks!

        • 1. Re: Reply to synchronous process
          user633446

          So the way i understand, you want to immediately send some response and then after processing the remaining logic you want to send fault if any!

          First of all, in order to respond in middle of a sync process you will need to dehydrate, add a wait timer with atleast 3seconds to get your reply activity invoked. After which when the remaining logic processing happens, if it fails add a Catch/Catch All to the scope and call back the client with fault details. You will need to callback as Client would have already closed its sync session with first response.

          1 person found this helpful
          • 2. Re: Reply to synchronous process
            vladodias

            Hi,

             

            I think you are looking for a Partial Processing Interaction Pattern in your BPEL Process...

             

            In partial processing, the client sends a request to a service and receives an immediate response, but processing continues on the service side. For example, the client sends a request to purchase a vacation package, and the service sends an immediate reply confirming the purchase, then continues on to book the hotel, the flight, the rental car, and so on.

             

            Have a look on this...

            http://docs.oracle.com/cd/E28280_01/dev.1111/e10224/bp_interact.htm#BABHHEHD

             

            Cheers,

            Vlad

            1 person found this helpful
            • 3. Re: Reply to synchronous process
              Riaan.Ingram

              You can have one BPEL service receive the transaction, asynchronously invoke a second (asynchronous one-way) service which does whatever you need it to do and then reply to the calling service. A catch across the asynchronous invoke should also make sure that if there are any http error codes or other transport problems then you'll still respond with a success.

              • 4. Re: Reply to synchronous process
                2655429

                Thanks for the replies! This is a kind of partial processing of the message where the end user wants to add a guest to the existing booking.

                Once success confirmation is sent, BPEL process has to insert the document (identity document details eg passport) into the database.

                So, I added a wait activity of 5 secs so that reply can be sent. But if the subsequent call fails, the instance of the process is in Running state only, it does not fault or complete.

                Now I have 2 questions -

                 

                a. Is this correct approach? Could there be an alternate approach to achieve this?

                b. Can running instances take a toll on the server? How can I make the instance fault/complete?

                • 5. Re: Reply to synchronous process
                  vladodias

                  a. Is this correct approach? There's never only one correct approach, but this doesn't look like the most adequate... Could there be an alternate approach to achieve this? There should be... see my questions below...

                  b. Can running instances take a toll on the server? Yes, but it is a feature available for you and that you should definitely use it if you have the right business need for it... How can I make the instance fault/complete? Go to EM and abort the instance...

                   

                  > user wants to add a guest to the existing booking

                  Can't it be modeled as a separated transaction? That would make more sense...

                   

                  > wait activity of 5 secs so that reply can be sent

                  Where the 5 secs come from?

                  • 6. Re: Reply to synchronous process
                    2655429

                    > user wants to add a guest to the existing booking

                    Can't it be modeled as a separated transaction? That would make more sense...

                     

                    -- Business does not want to maintain separate webservice calls. Currently they are managing all the related bunch of operations in the same webservice call by implementing PICK activity for each of the messages.

                    It will be like writing a new BPEL/Mediator just for one operation (inserting document details).

                     

                    > wait activity of 5 secs so that reply can be sent

                    Where the 5 secs come from?


                    -- I have put a wait acitivity (set it to 5 secs) after Reply to Client so that the response is sent to the calling service. Because if I do not put a Wait activity, and the subsequent call fails, the response of success guest addition is not sent.

                    Rather it sends error message to the calling service which will confuse the end user thinking that guest could not be added.

                    • 7. Re: Reply to synchronous process
                      vladodias

                      I'd suggest you to rethink your design...

                      • 8. Re: Reply to synchronous process
                        2655429

                        Ok...I was thinking of using events. As soon the reply is sent to the End User stating Guest has been added, a event will be pushed into JMS queue.

                        Thinking of writing a JMS adpater to read from the queue and process rest of the flow.

                        Eager to know your thoughts!

                        • 9. Re: Reply to synchronous process
                          vladodias

                          I think you are overcomplicating it... In my opinion the use case requires an asynchronous interaction... Riaan's idea above sounds good...

                          • 10. Re: Reply to synchronous process
                            2655429

                            Yes, it could be but right now I do not have much choice as I am changing the existing code. Async interaction is indeed a good idea to try though!

                            Thanks for all the suggestions and help!