|
Home > Archive > BizTalk Server Orchestration > August 2004 > How to create custom macro similar to %MESSAGEID%
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
How to create custom macro similar to %MESSAGEID%
|
|
| Girija 2004-06-20, 11:09 pm |
| Hi,
I am trying to FTP xml messages to a folder, after receiving and transforming messages from MSMQT. When posting the xml messages, I need to create file names with format [SRNUMBER]_timestamp.xml.
Where SRNUMBER is a value of a distinguished element in the incoming schema.
The standard macros we have in BizTalk 2004 do not serve this purpose.
Is there a way to overwrite %MESSAGEID% within the orchestration?
or is there a way to declare %SRNUMBER%, somewhere?
I use the standard FTP adapter with the Target file name property specifying the file name mask.
| |
| Bill Chesnut 2004-06-20, 11:09 pm |
| Girija,
This is the way I have done it for File & Ftp.
This uses the HelloWorld SDK Sample.
In your orchestration set the FILE.ReceiveFileName to what you want the file
name to be in a Message Assignment Shape after you create the outbound
message:
InvoiceMessage(FILE.ReceivedFileName) = "Test12345.xml" 'This could be more
complicated
in your send port under FILE Transport Properties
File name: %SourceFileName%
Hope this helps you.
Bill Chesnut
"Girija" <Girija@discussions.microsoft.com> wrote in message
news:D0C6CF7A-561D-4234-9727-3E390257A22B@microsoft.com...
> Hi,
> I am trying to FTP xml messages to a folder, after receiving and
transforming messages from MSMQT. When posting the xml messages, I need to
create file names with format [SRNUMBER]_timestamp.xml.
> Where SRNUMBER is a value of a distinguished element in the incoming
schema.
> The standard macros we have in BizTalk 2004 do not serve this purpose.
> Is there a way to overwrite %MESSAGEID% within the orchestration?
> or is there a way to declare %SRNUMBER%, somewhere?
>
> I use the standard FTP adapter with the Target file name property
specifying the file name mask.
>
| |
| Neal Walters 2004-08-11, 5:52 pm |
| I recently did a demo of this in class and it was remarkable easy thanks to
Bill's post.
I was receive a "StubbornPO" and converting it to an 'EasyPO" using a
Transform shape (map). I added a Message-Assignment shape after the
Transform and added the following line of code:
mEasyPO(FILE.ReceivedFileName) = mEasyPO.PONumber + ".xml";
Note that "PONumber" was a distinguished field in my schema.
I suppose if you wanted to further add the %MessageID%.xml in the send port,
you could leave the ".xml" out in the orchestration code above (you probably
don't want two .xml's in your filename). I did prefix the message with
additional text and the additional text got added just fine in front of the
"FILE.ReceivedFileName". So for example in my send port I set filename =
"OrchLargePO_%SourceFileName%" and since my PO number was STU-002 the
ultimate filename was "OrchLargePO_STU-002.xml".
Later I will see what effect this has on HAT and tracking.
Too Cool!
Neal Walters
http://Biztalk-Training.com
| |
| Johann Höchtl 2004-08-13, 5:51 pm |
| Neal Walters wrote:
> I recently did a demo of this in class and it was remarkable easy thanks to
> Bill's post.
>
>
> I was receive a "StubbornPO" and converting it to an 'EasyPO" using a
> Transform shape (map). I added a Message-Assignment shape after the
> Transform and added the following line of code:
>
> mEasyPO(FILE.ReceivedFileName) = mEasyPO.PONumber + ".xml";
>
> Note that "PONumber" was a distinguished field in my schema.
>
> I suppose if you wanted to further add the %MessageID%.xml in the send port,
> you could leave the ".xml" out in the orchestration code above (you probably
> don't want two .xml's in your filename). I did prefix the message with
> additional text and the additional text got added just fine in front of the
> "FILE.ReceivedFileName". So for example in my send port I set filename =
> "OrchLargePO_%SourceFileName%" and since my PO number was STU-002 the
> ultimate filename was "OrchLargePO_STU-002.xml".
>
>
> Later I will see what effect this has on HAT and tracking.
This realy is the way to go. FILE.ReceivedFileName is also the way to
go, when you want to change the file name of an FTP-port ....
>
> Too Cool!
>
> Neal Walters
> http://Biztalk-Training.com
>
|
|
|
|
|