コード例 #1
0
        public override bool Compensate(WorkLog item, RoutingSlip routingSlip)
        {
            object reservationId = item.Result["reservationId"];

            Logger.Message($"Cancelled flight {reservationId}.");

            return(true);
        }
コード例 #2
0
ファイル: ActivityHostT.cs プロジェクト: fossabot/Items
        public override Boolean AcceptMessage(Uri?uri, RoutingSlip routingSlip)
        {
            var activity = new T();

            if (activity.CompensationQueueAddress.Equals(uri))
            {
                ProcessBackwardMessage(routingSlip);
                return(true);
            }
            if (activity.WorkItemQueueAddress.Equals(uri))
            {
                ProcessForwardMessage(routingSlip);
                return(true);
            }
            return(false);
        }
コード例 #3
0
 public void ProcessBackwardMessage(RoutingSlip routingSlip)
 {
     if (routingSlip.IsInProgress)
     {
         // UndoLast can put new work on the routing slip
         // and return false to go back on the forward
         // path.
         if (routingSlip.UndoLast())
         {
             // recursion stands for passing context via message
             // the routing slip can be fully serialized and passed
             // between systems .
             _send(routingSlip.CompensationUri, routingSlip);
         }
         else
         {
             _send(routingSlip.ProgressUri, routingSlip);
         }
     }
 }
コード例 #4
0
 public void ProcessForwardMessage(RoutingSlip routingSlip)
 {
     if (!routingSlip.IsCompleted)
     {
         // if the current step is successful, proceed
         // otherwise go to the Unwind path
         if (routingSlip.ProcessNext())
         {
             // recursion stands for passing context via message
             // the routing slip can be fully serialized and passed
             // between systems.
             _send(routingSlip.ProgressUri, routingSlip);
         }
         else
         {
             // pass message to unwind message route
             _send(routingSlip.CompensationUri, routingSlip);
         }
     }
 }
コード例 #5
0
 public abstract bool AcceptMessage(Uri?uri, RoutingSlip routingSlip);
コード例 #6
0
ファイル: Activity.cs プロジェクト: fossabot/Items
 public abstract bool Compensate(WorkLog item, RoutingSlip routingSlip);