/// <summary>
 /// Store the given <see cref="TrackingContext"/> into the <paramref name="messageContext"/>.
 /// </summary>
 /// <param name="messageContext">
 /// Message context to store the <paramref name="trackingContext"/> into.
 /// </param>
 /// <param name="trackingContext">
 /// The <see cref="TrackingContext"/> to be stored into the <paramref name="messageContext"/>.
 /// </param>
 public static TrackingContext SetTrackingContext(this IBaseMessageContext messageContext, TrackingContext trackingContext)
 {
     if (messageContext == null)
     {
         throw new ArgumentNullException(nameof(messageContext));
     }
     messageContext.SetProperty(TrackingProperties.ProcessActivityId, trackingContext.ProcessActivityId);
     messageContext.SetProperty(TrackingProperties.ProcessingStepActivityId, trackingContext.ProcessingStepActivityId);
     messageContext.SetProperty(TrackingProperties.MessagingStepActivityId, trackingContext.MessagingStepActivityId);
     return(trackingContext);
 }
        public void Execute(IBaseMessageContext context)
        {
            context.EnsureFileOutboundTransport();

            var outboundTransportLocation = context.GetProperty(BtsProperties.OutboundTransportLocation);
            var rootPath = Path.GetDirectoryName(outboundTransportLocation);

            if (rootPath.IsNullOrEmpty() && IO.Path.IsNetworkPath(outboundTransportLocation))
            {
                var fileName = Path.GetFileName(outboundTransportLocation);
                if (!fileName.IsNullOrEmpty())
                {
                    rootPath = outboundTransportLocation.Remove(outboundTransportLocation.Length - fileName.Length);
                }
            }
            if (rootPath.IsNullOrEmpty())
            {
                throw new InvalidOperationException("Root path was expected to be found in BtsProperties.OutboundTransportLocation context property.");
            }

            var subPathAndFile = context.GetProperty(BizTalkFactoryProperties.OutboundTransportLocation);

            if (subPathAndFile.IsNullOrEmpty())
            {
                throw new InvalidOperationException(
                          "Target sub path and file name were expected to be found in BizTalkFactoryProperties.OutboundTransportLocation context property.");
            }
            context.SetProperty(BtsProperties.OutboundTransportLocation, Path.Combine(rootPath !, subPathAndFile));
        }
        public void Execute(IBaseMessageContext context)
        {
            context.EnsureSftpOutboundTransport();

            // enabling IsDynamicSend is required
            context.SetProperty(BtsProperties.IsDynamicSend, true);

            var folder           = context.GetProperty(SftpProperties.FolderPath);
            var subFolderAndFile = context.GetProperty(BizTalkFactoryProperties.OutboundTransportLocation);

            if (subFolderAndFile.IsNullOrEmpty())
            {
                throw new InvalidOperationException(
                          "Target sub folder and file name were expected to be found in BizTalkFactoryProperties.OutboundTransportLocation context property.");
            }
            var subFolder = Path.GetDirectoryName(subFolderAndFile);
            var file      = Path.GetFileName(subFolderAndFile);

            context.SetProperty(SftpProperties.FolderPath, Path.Combine(folder, subFolder !).Replace('\\', '/'));
            context.SetProperty(SftpProperties.TargetFileName, file);
        }
        public void Execute(IBaseMessageContext context)
        {
            context.EnsureSftpOutboundTransport();

            var builder          = new UriBuilder(context.GetProperty(BtsProperties.OutboundTransportLocation));
            var folder           = context.GetProperty(SftpProperties.FolderPath);
            var subFolderAndFile = context.GetProperty(BizTalkFactoryProperties.OutboundTransportLocation);

            if (subFolderAndFile.IsNullOrEmpty())
            {
                throw new InvalidOperationException(
                          "Target sub folder and file name were expected to be found in BizTalkFactoryProperties.OutboundTransportLocation context property.");
            }
            builder.Path = Path.Combine(folder, subFolderAndFile);
            context.SetProperty(BtsProperties.OutboundTransportLocation, builder.ToString());
        }
コード例 #5
0
 public void Execute(IBaseMessageContext context)
 {
     context.SetProperty(TrackingProperties.Value1, "Plugin has been executed.");
 }
コード例 #6
0
 public static IBaseMessageContext SetValue3(this IBaseMessageContext context, string value)
 {
     context.SetProperty(TrackingProperties.Value3, value);
     return(context);
 }
コード例 #7
0
 public static IBaseMessageContext SetProcessName(this IBaseMessageContext context, string processName)
 {
     context.SetProperty(TrackingProperties.ProcessName, processName);
     return(context);
 }
 public static IBaseMessageContext SetMap <T>(this IBaseMessageContext context) where T : TransformBase
 {
     context.SetProperty(BizTalkFactoryProperties.MapTypeName, typeof(T).AssemblyQualifiedName);
     return(context);
 }
 public static IBaseMessageContext SetOutboundTransportLocation(this IBaseMessageContext context, string outboundTransportLocation)
 {
     context.SetProperty(BizTalkFactoryProperties.OutboundTransportLocation, outboundTransportLocation);
     return(context);
 }
 public static IBaseMessageContext SetEnvironmentTag(this IBaseMessageContext context, string environmentTag)
 {
     context.SetProperty(BizTalkFactoryProperties.EnvironmentTag, environmentTag);
     return(context);
 }
 public static IBaseMessageContext SetCorrelationToken(this IBaseMessageContext context, string correlationToken)
 {
     context.SetProperty(BizTalkFactoryProperties.CorrelationToken, correlationToken);
     return(context);
 }
 public static IBaseMessageContext SetSenderName(this IBaseMessageContext context, string senderName)
 {
     context.SetProperty(BizTalkFactoryProperties.SenderName, senderName);
     return(context);
 }
 public static IBaseMessageContext SetReceiverName(this IBaseMessageContext context, string receiverName)
 {
     context.SetProperty(BizTalkFactoryProperties.ReceiverName, receiverName);
     return(context);
 }
 public static IBaseMessageContext SetCorrelationId(this IBaseMessageContext context, string correlationId)
 {
     context.SetProperty(Subscribable.BizTalkFactoryProperties.CorrelationId, correlationId);
     return(context);
 }