8 Replies Latest reply on Feb 15, 2013 7:17 AM by Arik

    Replaying inner scope activity from the outermost scope

    shivs08
      All,

      I have two scopes, scope b and scope c nested inside a scope A. I am catching the fault in the outermost catch handler of scope A. From here based on certain logic I need to replay faulted scope b or c. When I
      am trying to do that , It is not replaying. However If I keep the replay scope activity in the catch block of the scope b and scope c , it is able to replay these scopes.

      Please let me know if replay scope from outermost scope catch handler does not work to replay the inner nested scopes.

      Thanks,
      Shiv.
        • 1. Re: Replaying inner scope activity from the outermost scope
          shivs08
          Any inputs on this ??

          Thanks,
          Shiv
          • 2. Re: Replaying inner scope activity from the outermost scope
            Abhinav
            Shiv,
            IMHO you need to throw faults, catch them in every scope(B & C level in your case), rethrow them in the catch/catchall at level A again, then use Replay Activity.

            Regards,
            Abhinav Gupta
            • 3. Re: Replaying inner scope activity from the outermost scope
              983134
              Hi
              shiv
              The thing you are trying for is similar to throwing a ball to one side and expecting the ball to be coming from other side. . .

              You are catching the fault at scope A and when catch block contains the replay activity then the fault is automatically thrown to the same block for which one you have kept the catch block. . . . .

              Thanks
              SHARATH. . .
              • 4. Re: Replaying inner scope activity from the outermost scope
                shivs08
                I m doing it in this way only.

                Fault thrown by B & C are caught in the catch handler of these blocks and rethrown.

                After this the outermost catch handler is catching it. From the fault payload, it is getting the information from which scope it is thrown (i.e b or c) and then replayScope activity is used to replay that scope
                This is not working as of now.
                • 5. Re: Replaying inner scope activity from the outermost scope
                  shivs08
                  @ Sharath ....

                  I could not get what you want to say in the below line posted by you

                  "You are catching the fault at scope A and when catch block contains the replay activity then the fault is automatically thrown to the same block for which one you have kept the catch block. . . . ."

                  Could you elaborate on this ...

                  -- Shiv
                  • 6. Re: Replaying inner scope activity from the outermost scope
                    Arik
                    Shiv,

                    A replay activity is actually a Throw fault.
                    When you hit a replay activity you are throwing a fault. So, when you use a replay activity, inside a scope (with a catch), it gets to the catch activity.
                    When you use a replay activity inside a scope (without a catch), and it's inside another scope, then you will get to the catch activity of the outer scope.
                    You can't achieve what you want in that way.
                    What you can do is: initial a variable in some points of your process (let's say before scopes b,c). When you will get an error, you will be thrown to the outer scope(a) to replay it. According to the variable, you will know which scopes to process with if conditions.
                    (or something like that...I don't know what should the process do)


                    Arik
                    • 7. Re: Replaying inner scope activity from the outermost scope
                      shivs08
                      Hi Arik,

                      "A replay activity is actually a Throw fault.
                      When you hit a replay activity you are throwing a fault. So, when you use a replay activity, inside a scope (with a catch), it gets to the catch activity"


                      Before I hit the above problem, I have tried keeping replayscope acitivity in the catch block of faulted scope and it replayed the scope without any issues.
                      Please note that i did not have any parent scope or any other catch handler at this time.

                      If your above statement is true, then replayscope activity should have thrown fault and in the absence of any parent fault handler my bpel process should have faulted out.

                      In fact from the time when I was in oracle , I still remember the bug in which we pointed out that to replay scopes we are using kind of while loops for scope and want to get rid of this coding..
                      and in the bug it was updated that the similar things will be taken care by replayscope activity in future releases.

                      So in my opinion, the replayscope activity should generate the code after compilation of bpel process which should be nothing else but a while loop kind of logic to replay the scopes ....

                      -- Shiv
                      • 8. Re: Replaying inner scope activity from the outermost scope
                        Arik
                        Shin,



                        I'm really sorry as I did some mixing with the examples and explanations. If you put a Replay activty in a scope then yes, it will act as a while. But, if you will add a catch activty to the scope, it will change the replay activty behavior, and it will use to throw an exception. So, unless there is a bug, using inner and outer scopes to replay it will not work as wish. It will also make it harder to manage faults.