示例#1
0
        RoutingSlipBuilder CreateRoutingSlipBuilder <TLog>(TLog log, out ActivityLog activityLog)
            where TLog : class
        {
            if (_compensationAddress == null)
            {
                throw new RoutingSlipException("The activity does not have a compensation address");
            }

            RoutingSlipBuilder builder = CreateRoutingSlipBuilder();

            activityLog = builder.AddActivityLog(_activity.Name, _activityTrackingNumber, _compensationAddress, log);

            return(builder);
        }
示例#2
0
        public ExecutionResult ReviseItinerary <TLog>(TLog log, Action <ItineraryBuilder> itineraryBuilder)
            where TLog : class
        {
            if (_compensationAddress == null)
            {
                throw new RoutingSlipException("The activity does not have a compensation address");
            }

            RoutingSlipBuilder builder     = CreateReviseRoutingSlipBuilder();
            ActivityLog        activityLog = builder.AddActivityLog(_activity.Name, _activityTrackingNumber,
                                                                    _compensationAddress, log);

            return(ReviseItinerary(builder, activityLog.Results, itineraryBuilder));
        }
示例#3
0
        public ExecutionResult ReviseItinerary <TLog>(TLog log, IEnumerable <KeyValuePair <string, object> > variables,
                                                      Action <ItineraryBuilder> buildItinerary)
            where TLog : class
        {
            if (_compensationAddress == null)
            {
                throw new RoutingSlipException("The activity does not have a compensation address");
            }

            RoutingSlipBuilder builder     = CreateReviseRoutingSlipBuilder();
            ActivityLog        activityLog = builder.AddActivityLog(_activity.Name, _activityTrackingNumber,
                                                                    _compensationAddress, log);

            builder.SetVariables(variables);

            return(ReviseItinerary(builder, activityLog.Results, buildItinerary));
        }
示例#4
0
 protected virtual void Build(RoutingSlipBuilder builder)
 {
     builder.AddActivityLog(Context.Host, Activity.Name, Context.ExecutionId, Context.Timestamp, Duration);
 }