Exemplo n.º 1
0
        public async Task Handle(NoeOfferResponse message, IMessageHandlerContext context)
        {
            if (message.NoeOfferAccepted)
            {
                log.InfoFormat("Recieved NoeOfferResponse, NoeOfferAccepted flag TRUE for {0} ({1}), sending NoeResponse",
                               message.NoeId, message.SagaId);
                Data.NoeOfferAccepted = message.NoeOfferAccepted;
            }
            else
            {
                log.InfoFormat("Recieved NoeOfferResponse, NoeOfferAccepted flag FALSE for {0} ({1}), sending NoeResponse",
                               message.NoeId, message.SagaId);
                Data.NoeOfferAccepted = message.NoeOfferAccepted;
            }
            //
            // No matter what this workflow is ending
            //
            var request = new NoeResponse(message);

            request.Status = Constants.ZSUS_SAGA_MARKED_COMPLETE;
            var options = new SendOptions();

            options.SetDestination(Constants.ZSUS_NOE_RESPONSE_ENDPOINT);
            await context.Send(request, options).ConfigureAwait(false);
        }
Exemplo n.º 2
0
 public async Task Handle(NoeApproveResponse message, IMessageHandlerContext context)
 {
     if (message.NoeApproved)
     {
         log.InfoFormat("Recieved NoeApproveResponse, NoeApproved flag TRUE, sending NoeNegotiationRequest for {0} ({1})",
                        message.NoeId, message.SagaId);
         Data.NoeApproved = message.NoeApproved;
         var request = new NoeNegotiationRequest(message);
         var options = new SendOptions();
         options.SetDestination(Constants.ZSUS_NOE_NEGOTIATION_REQUEST_ENDPOINT);
         await context.Send(request, options).ConfigureAwait(false);
     }
     else
     {
         log.InfoFormat("Recieved NoeApproveResponse, NoeApproved flag FALSE for {0} ({1}), sending NoeResponse",
                        message.NoeId, message.SagaId);
         Data.NoeApproved = message.NoeApproved;
         var request = new NoeResponse(message);
         request.Status = Constants.ZSUS_SAGA_MARKED_COMPLETE;
         var options = new SendOptions();
         options.SetDestination(Constants.ZSUS_NOE_RESPONSE_ENDPOINT);
         await context.Send(request, options).ConfigureAwait(false);
     }
 }