Hi
How can I promote the filename which is entered from the UI in a custom send pipeline to the %Sourcefilename% of the adapter. How can I do this?
Thanks
Technology Tips and News
Hi
How can I promote the filename which is entered from the UI in a custom send pipeline to the %Sourcefilename% of the adapter. How can I do this?
Thanks
Normally receiving adapter sets ReceivedFileName property (e.g. FILE, FTP). If you wants to overwrite the existing value by entering in the pipeline properties and
stored in to property bag, you can change these values:
By writing in context:
pInMsg.Context.Write("ReceivedFileName", "http://schemas.microsoft.com/BizTalk/2003/file-properties", PrependData);
or promote it (if required):
pInMsg.Context.Promote("ReceivedFileName", "http://schemas.microsoft.com/BizTalk/2003/file-properties", PrependData);
Later you can use the macro %SourceFileName% in the send adapter.
Be aware macros are case sensitive.
Thanks
So what is the difference if I write in context or promote it. I just need the value of the filename that is entered in the UI of custom send pipeline to be available on the File adapter %SourceFileName% on the Send port.
Also in Send pipeline in what stage should this component be used.
Hello btsserv
If you use Context.Promote then the field is identified as Promoted field and can access in the ports for filter expressions.
And if you use Context.Write then it is just writing to message context and is distinguished field which cannot be used in filter expressions in ports
Cheers
Hi,
You need to promote the filename at your pipeline level so that you can apply the Micros used at your send port .
inmsg.Context.Promote("ReceivedFileName", "http://schemas.microsoft.com/BizTalk/2003/file-properties", filename);
Thanks
Abhishek
Thanks
In the pInMsg.Context.Promote("ReceivedFileName", "http://schemas.microsoft.com/BizTalk/2003/file-properties", filename)
Is the second parameter the target namespace of the schema? As I am getting the below error
There was a failure executing the send pipeline: "CustomSendPipeline.Filenamepipeline, CustomSendPipeline, Version=1.0.0.0, Culture=neutral, PublicKeyToken=c49f22a4f8802776" Source: "SourceFilename" Send Port: "SNP_Custompipeline" URI: "C:\New folder\%SourceFileName%.xml" Reason: Loading property information list by namespace failed or property not found in the list. Verify that the schema is deployed properly.
Yes I am promoting in the send pipeline because I need to assign the FileName value entered in the UI of the custompipline to the %SourceFileName% of the file adapter.
I think I am going wrong with the code in the IBaseMessage Execute() method given below(what do I need to code in this method)
public IBaseMessage Execute(IPipelineContext pc, IBaseMessage inmsg)
{
inmsg.Context.Promote("ReceivedFileName", "http://CustomSendPipeline.PWFileSchema", this.FileName);
return inmsg;
}
Thanks
Hold on everyone!
You do not have to Promote FILE.ReceivedFileName to use the %SourceFileName% macro.
ReceivedFileName is simply written to the Context. You should use this code:
public IBaseMessage Execute(IPipelineContext pc, IBaseMessage inmsg) { inmsg.Context.Write("ReceivedFileName", "http://schemas.microsoft.com/BizTalk/2003/file-properties", this.FileName); return inmsg; }Also note, you must use the FILE (as in FILE.ReceivedFileName) namespace which is http://schemas.microsoft.com/BizTalk/2003/file-properties. You cannot use a custom namespace, even if it defines ReceiveFileName, since %SourceFileName% only reads from the build in property.
Yes I am promoting in the send pipeline because I need to assign the FileName value entered in the UI of the custompipline to the %SourceFileName% of the file adapter.
I think I am going wrong with the code in the IBaseMessage Execute() method given below(what do I need to code in this method)
public IBaseMessage Execute(IPipelineContext pc, IBaseMessage inmsg)
{inmsg.Context.Promote("ReceivedFileName", "http://CustomSendPipeline.PWFileSchema", this.FileName);
return inmsg;
}Thanks
Hold on everyone!
You do not have to Promote FILE.ReceivedFileName to use the %SourceFileName% macro.
ReceivedFileName is simply written to the Context. You should use this code:
public IBaseMessage Execute(IPipelineContext pc, IBaseMessage inmsg) { inmsg.Context.Write("ReceivedFileName", "http://schemas.microsoft.com/BizTalk/2003/file-properties", this.FileName); return inmsg; }Also note, you must use the FILE (as in FILE.ReceivedFileName) namespace which is http://schemas.microsoft.com/BizTalk/2003/file-properties. You cannot use a custom namespace, even if it defines ReceiveFileName, since %SourceFileName% only reads from the build in property.
Hold on everyone!
You do not have to Promote FILE.ReceivedFileName to use the %SourceFileName% macro.
ReceivedFileName is simply written to the Context. You should use this code:
public IBaseMessage Execute(IPipelineContext pc, IBaseMessage inmsg) { inmsg.Context.Write("ReceivedFileName", "http://schemas.microsoft.com/BizTalk/2003/file-properties", this.FileName); return inmsg; }Also note, you must use the FILE (as in FILE.ReceivedFileName) namespace which is http://schemas.microsoft.com/BizTalk/2003/file-properties. You cannot use a custom namespace, even if it defines ReceiveFileName, since %SourceFileName% only reads from the build in property.
Hold on everyone!
You do not have to Promote FILE.ReceivedFileName to use the %SourceFileName% macro.
ReceivedFileName is simply written to the Context. You should use this code:
public IBaseMessage Execute(IPipelineContext pc, IBaseMessage inmsg) { inmsg.Context.Write("ReceivedFileName", "http://schemas.microsoft.com/BizTalk/2003/file-properties", this.FileName); return inmsg; }Also note, you must use the FILE (as in FILE.ReceivedFileName) namespace which is http://schemas.microsoft.com/BizTalk/2003/file-properties. You cannot use a custom namespace, even if it defines ReceiveFileName, since %SourceFileName% only reads from the build in property.
Hold on everyone!
You do not have to Promote FILE.ReceivedFileName to use the %SourceFileName% macro.
ReceivedFileName is simply written to the Context. You should use this code:
public IBaseMessage Execute(IPipelineContext pc, IBaseMessage inmsg) { inmsg.Context.Write("ReceivedFileName", "http://schemas.microsoft.com/BizTalk/2003/file-properties", this.FileName); return inmsg; }Also note, you must use the FILE (as in FILE.ReceivedFileName) namespace which is http://schemas.microsoft.com/BizTalk/2003/file-properties. You cannot use a custom namespace, even if it defines ReceiveFileName, since %SourceFileName% only reads from the build in property.
Hold on everyone!
You do not have to Promote FILE.ReceivedFileName to use the %SourceFileName% macro.
ReceivedFileName is simply written to the Context. You should use this code:
public IBaseMessage Execute(IPipelineContext pc, IBaseMessage inmsg) { inmsg.Context.Write("ReceivedFileName", "http://schemas.microsoft.com/BizTalk/2003/file-properties", this.FileName); return inmsg; }Also note, you must use the FILE (as in FILE.ReceivedFileName) namespace which is http://schemas.microsoft.com/BizTalk/2003/file-properties. You cannot use a custom namespace, even if it defines ReceiveFileName, since %SourceFileName% only reads from the build in property.
Hold on everyone!
You do not have to Promote FILE.ReceivedFileName to use the %SourceFileName% macro.
ReceivedFileName is simply written to the Context. You should use this code:
public IBaseMessage Execute(IPipelineContext pc, IBaseMessage inmsg) { inmsg.Context.Write("ReceivedFileName", "http://schemas.microsoft.com/BizTalk/2003/file-properties", this.FileName); return inmsg; }Also note, you must use the FILE (as in FILE.ReceivedFileName) namespace which is http://schemas.microsoft.com/BizTalk/2003/file-properties. You cannot use a custom namespace, even if it defines ReceiveFileName, since %SourceFileName% only reads from the build in property.