none
Reading source file name and writing the same for destination file.

    Question

  • Hi,

        I'm using BizTalk server 2010. How to read the source file name and use the same to write in the destination file? Below is the one I tried but got error,

    1. Used expression after transform shape and written

        MyOutPutMessage(BTS.receivedfileName) = MyInputMessage(BTS.receivedfilename);

    Regards,

    Kuppusamy S

    Monday, May 20, 2013 10:27 AM

Answers

  • HI

    i think you are writing code inside expression shape .

    You can not assign value to Message property .

    you can only write above expression inside Message Assignment Shape .

    • Marked as answer by Kuppusamy S Tuesday, May 21, 2013 8:48 AM
    Monday, May 20, 2013 12:45 PM
  • Hi Kuppu,

    You can do the followings:

    Receive:

    Received file name would be populated to the context, if you had used adapters like File,FTP

    Orchestration:

    Since you’re using a orchestration, while contructing the outbound message. Add the following code in the Message Assignment shape

    msgOut = msgIn;
    msgOut (FILE.ReceivedFileName) = msgIn (FILE.ReceivedFileName);

    Send:

    In the send port, in the file name section of the transport properties, give %SourceFileName%

    Following posts should guide you to achieve your requirement:

    How to change the Output file name in BizTalk File Adapters?

    Customize filename dynamically inside BizTalk Orchestration


    If this answers your question please mark it accordingly. If this post is helpful, please vote as helpful.

    • Marked as answer by Kuppusamy S Tuesday, May 21, 2013 8:48 AM
    Monday, May 20, 2013 3:12 PM
  • That is the correct syntax, however, you have to use a Message Assignment Shape.

    In the Orchestration Designer, drag a Message Assignment shape into the same Construct Shape as the Transform Shape, immediately below the Transform Shape.

    There, you will copy the property value from the input message to the output message and you should be all set.

    The File Adapter macros and their source are defined here (unchanged): http://technet.microsoft.com/en-us/library/ee267570%28v=bts.10%29.aspx

    • Marked as answer by Kuppusamy S Tuesday, May 21, 2013 8:48 AM
    Monday, May 20, 2013 7:26 PM

All replies

  • Hi

    use Macro %SourceFileName% at Send port FileName.


    its :

    Message_2(FILE.ReceivedFileName)=Message_1(FILE.ReceivedFileName);

    Not BTS.ReceivedFileName

    Monday, May 20, 2013 10:29 AM
  • Hi MG,

            Thank you for your time. Sorry, I'm new to BizTalk, learning basics through this forum and other blogs and trying to do tasks. Could you let me know what should be replaced for Message_2 and Message_1 keyword? Is it the messages I created in Orchestration view - messages?

    Regards,

    Kuppusamy S


    Monday, May 20, 2013 11:42 AM
  • yes it is message created in orchestration view .

    as per your message name it should be

    MyOutPutMessage(FILE.ReceivedFileName) = MyInputMessage(FILE.ReceivedFileName);

    Monday, May 20, 2013 12:01 PM
  • Hi MG,

               I coded in expression editor as mentioned above. When building, it throws error,

     The expression that you have entered is not valid.

     Two messages I created was ItemOutputMessage, ItemInputMessage.

     I coded as ItemOutPutMessage(FILE.ReceivedFileName) = ItemInputMessage(FILE.ReceivedFileName); I experienced intellisense when coding but still it throws error when building.

    Regards,

    Kuppusamy S


    Monday, May 20, 2013 12:36 PM
  • HI

    i think you are writing code inside expression shape .

    You can not assign value to Message property .

    you can only write above expression inside Message Assignment Shape .

    • Marked as answer by Kuppusamy S Tuesday, May 21, 2013 8:48 AM
    Monday, May 20, 2013 12:45 PM
  • Hi Kuppu,

    You can do the followings:

    Receive:

    Received file name would be populated to the context, if you had used adapters like File,FTP

    Orchestration:

    Since you’re using a orchestration, while contructing the outbound message. Add the following code in the Message Assignment shape

    msgOut = msgIn;
    msgOut (FILE.ReceivedFileName) = msgIn (FILE.ReceivedFileName);

    Send:

    In the send port, in the file name section of the transport properties, give %SourceFileName%

    Following posts should guide you to achieve your requirement:

    How to change the Output file name in BizTalk File Adapters?

    Customize filename dynamically inside BizTalk Orchestration


    If this answers your question please mark it accordingly. If this post is helpful, please vote as helpful.

    • Marked as answer by Kuppusamy S Tuesday, May 21, 2013 8:48 AM
    Monday, May 20, 2013 3:12 PM
  • That is the correct syntax, however, you have to use a Message Assignment Shape.

    In the Orchestration Designer, drag a Message Assignment shape into the same Construct Shape as the Transform Shape, immediately below the Transform Shape.

    There, you will copy the property value from the input message to the output message and you should be all set.

    The File Adapter macros and their source are defined here (unchanged): http://technet.microsoft.com/en-us/library/ee267570%28v=bts.10%29.aspx

    • Marked as answer by Kuppusamy S Tuesday, May 21, 2013 8:48 AM
    Monday, May 20, 2013 7:26 PM