2 Replies Latest reply on Feb 25, 2008 8:12 AM by b_

    Difference between .cancel() and .compensate() BusinessAgree

    b_

      Hi,

      Could anyone please explain the difference between the .cancel() and the .compensate() methods exposed in the BusinessAgreementWithParticipantCompletionParticipant interface.

      In the api, it is suggested that both are invoked when the transaction has cancelled. The .compensate method is invoked when the UserBusinessActivity.cancel() is invoked.

      However it is not clear to me when the .cancel() method in the BusinessAgreementWithParticipantCompletionParticipant interface is invoked. Isn't it sort of redundant to the compensate method?

        • 1. Re: Difference between .cancel() and .compensate() BusinessA
          jhalliday

          Cancel is a transaction from the active state, whereas compensate is a transition from the completed state. In short, it depends where in the lifecycle the tx aborts. See the state diagram on page 8 of the WS-BusinessActivity spec.

          • 2. Re: Difference between .cancel() and .compensate() BusinessA
            b_

            Thanks,

            From what i understand when the .cancel() is invoked on the participant, the transaction aware web service is either currently executing the business logic or else haven't started executing the business logic yet. (The participant cannot have informed the coordinator that it has completed.)
            Am i right?

            What is still not clear to me is in what circumstance is the .cancel() method invoked?