开发者

Setting the output file name in a biztalk send port

Good afternoon,

I'm trying to set the output file name in a send port and the available file name macros won't quite work.

I need something of the form "file.YYYYMMDD_HHMMSS". There's a datetime combined macro (with the wrong format), a time only macro, but no date only macro.

I don't have an orchestration for this process.

Is there any way I can set the file name from within a map or a pi开发者_如何学编程peline?

Thanks!


You can achieve filename in this format YYYYMMDD_HHMMSS using following.

Use expression shape in orchestration and create four variables.

varDateTime=System.DateTime.Now; //varDateTime is datetime type
strDate=varDateTime.ToString("yyyyMMdd"); //strDate is string type
strTime=varDateTime.ToString("HHmmss"); //strTime is string type
outboundfilename= ""+strDate + " _  " +strTime +" "; //outboundfilename is the string variable.

Use the following code in Message Assignment Shape

msgOutbound(FILE.ReceivedFileName)=outboundfilename+".xml";
//File extension can be any based on your requirement. I have xml file type.

You don't need custom pipeline to do this.


You can do it with a custom pipeline or an orchestration but not with a map. Info on building a custom pipeline can be found here:

BizTalk MSDN Blogs


This can be set by setting the FILE.ReceivedFileName (instead of BTS.ReceiveFileName).


You can create a custom pipeline component to be placed on the send side (say encode stage), and then set the BTS.ReceiveFileName property to the custom file name value that needs to be set.

After this is done, you can use the %SourceFileName% macro in the Send Port. You can also refer to this MSDN forum link for more details

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜