Discussion:
How to set messages name at Outgoing Ports URI?
(too old to reply)
Alex
2004-07-28 14:45:39 UTC
Permalink
Hi,
Currently , In my orchestrations port URI I am using
"....\%MessageID%.txt" name and it comes to really weird -
looking name, like:{A9EF1FB4-4A03-4970-A5FF-
17BFD9DE0E79}.txt
Is any way that I can use an original source file name,
because it also unique?

Also, How can I see original message in native format when
it is been processed by BT2004?

Thank you,
Alex.
Yossi Dahan
2004-07-28 15:12:13 UTC
Permalink
Just use %SourceFileName% instead.

To see the message in the native format set the tracking to "before receive"
and than save the message through the HAT. it should appear in its native
format

Yossi
Post by Alex
Hi,
Currently , In my orchestrations port URI I am using
"....\%MessageID%.txt" name and it comes to really weird -
looking name, like:{A9EF1FB4-4A03-4970-A5FF-
17BFD9DE0E79}.txt
Is any way that I can use an original source file name,
because it also unique?
Also, How can I see original message in native format when
it is been processed by BT2004?
Thank you,
Alex.
Alex
2004-07-28 15:59:01 UTC
Permalink
Yossi,
Thank you!

Alex.
Alex
2004-07-28 18:19:20 UTC
Permalink
I got %SourceFileName%.txt as a result. It seems like
context property does not have a value, which is strange
becouse I use flat-file standatd adapter and original
file's name does not contain any problematic characters
and it is like
20040709NYE-20.txt
Any clue why SourceFileName macros is blank?

Alex.
Bill Chesnut
2004-07-29 13:20:42 UTC
Permalink
Alex,

You must set it in your orchestration,
outmessage(File.ReceiveFileName) = inmessage(File.ReceiveFileName)
in a message assignment shape, you could set it to anything this is just an
example of setting it to the same as the received file name.

Bill Chesnut
BizTalk MVP
Post by Alex
I got %SourceFileName%.txt as a result. It seems like
context property does not have a value, which is strange
becouse I use flat-file standatd adapter and original
file's name does not contain any problematic characters
and it is like
20040709NYE-20.txt
Any clue why SourceFileName macros is blank?
Alex.
Alex
2004-07-29 15:10:07 UTC
Permalink
Hello Bill,
Thank you for the tip.
My orchestration is really simple and it has this
structure:

Port_Incoming ->
-> Receive_Shape(Activate=True; Message=SUN_Instance)->
-> Constract_Shape(Message Constructed=SAP_Instance) +
Transform_Shape(Input Messages=SUN_Instance; Output
Messages=SAP_Instance) ->
-> Send_Shape (Message=SAP_Instance)->
-> Port_Outgoing

Now I have to include the message assignment shape, so I
can do it inside of my Constract_Shape but before
transform shape and my orchestration will looks like this:

Port_Incoming ->
-> Receive_Shape(Activate=True; Message=SUN_Instance)->
-> Constract_Shape(Message Constructed=SAP_Instance) +
+ Message_Assignment_Shape( expression:
SAP_Instance(Schemas.ReceiveFileName)=SUN_Instance
(Schemas.ReceiveFileName);) +
+ Transform_Shape(Input Messages=SUN_Instance; Output
Messages=SAP_Instance) ->
-> Send_Shape (Message=SAP_Instance)->
-> Port_Outgoing


However, for my "assigns shape" expression I got an error.
SAP_Instance(Schemas.ReceiveFileName)=SUN_Instance
(Schemas.ReceiveFileName); - "Identifier ReceiveFileName
does not exist in Schemas!"

Where "Schemas.SUN" and "Schemas.SAP" is a namespace for
my schemas and Schemas is a my schemas and map project's
name.

Do you know what am I missing?

Alex.
Bill Chesnut
2004-07-30 00:02:33 UTC
Permalink
Alex,

it should be:

SAP_Instance(File.ReceiveFileName)=SUN_Instance(File.ReceiveFileName);

Bill Chesnut
BizTalk MVP
Post by Alex
Hello Bill,
Thank you for the tip.
My orchestration is really simple and it has this
Port_Incoming ->
-> Receive_Shape(Activate=True; Message=SUN_Instance)->
-> Constract_Shape(Message Constructed=SAP_Instance) +
Transform_Shape(Input Messages=SUN_Instance; Output
Messages=SAP_Instance) ->
-> Send_Shape (Message=SAP_Instance)->
-> Port_Outgoing
Now I have to include the message assignment shape, so I
can do it inside of my Constract_Shape but before
Port_Incoming ->
-> Receive_Shape(Activate=True; Message=SUN_Instance)->
-> Constract_Shape(Message Constructed=SAP_Instance) +
SAP_Instance(Schemas.ReceiveFileName)=SUN_Instance
(Schemas.ReceiveFileName);) +
+ Transform_Shape(Input Messages=SUN_Instance; Output
Messages=SAP_Instance) ->
-> Send_Shape (Message=SAP_Instance)->
-> Port_Outgoing
However, for my "assigns shape" expression I got an error.
SAP_Instance(Schemas.ReceiveFileName)=SUN_Instance
(Schemas.ReceiveFileName); - "Identifier ReceiveFileName
does not exist in Schemas!"
Where "Schemas.SUN" and "Schemas.SAP" is a namespace for
my schemas and Schemas is a my schemas and map project's
name.
Do you know what am I missing?
Alex.
Alex
2004-07-30 13:43:52 UTC
Permalink
Bill,
I tried this and still I got an error:
"The expression you have entered is invalid" while
compiling and "Identifier "File" does not exist in
"Orchestration name"; Are you missing an assembly
reference?"
I opened an "Object browser" and I learned that
File.ReceivedFileName class is a member of "BizTalk
Default schemas" namespace and I did not see it in my
Orchestration project.
So, I manually added this reference to Orchestration
project references, however I still have the same error
and If I try to use "Word completion" or "Object
completion" ikons at the left-top corner of Expression
editor, I have only "Microsoft.BizTalk.XLANGs.BTXEngine"
and "Microsoft.BizTalk.DefaultPipelines" two references I
had from the beginning.
Maybe the problem here is with my solution structure. I
have 4 project together in 1 solution:
1 for .VB component I use with my Functoid
2. Orchestrations
3. Pipelines
4. Schemas

I do not know what else to do.

Alex.
Alex
2004-07-30 18:37:44 UTC
Permalink
Stupid me,
I just reasized,it should be in Upper case(FILE, not File).

SAP_Instance(FILE.ReceiveFileName)=SUN_Instance
(FILE.ReceiveFileName);

Alex.
Neal Walters
2004-09-30 14:51:03 UTC
Permalink
I got your code to work when receiving a file and sending a file - BUT - what
if I want to create a file dynamically? The %SourceFileName% macro does not
substitute unless an actual physical file is received. So if I create a new
message by using XMLDOC.Load("<root></root>") etc... then try to write out
the file, the send port does not substitute a variable for %SourceFileName%.

I was looking into other macros such as %DestinationParty% - but haven't got
that to work yet either. I'm about to do some searches on "custom macros" to
see if they are available.

Thanks in advance,
Neal Walters
http://Biztalk-Training.com - Free Biztalk Training Videos
Neal Walters
2004-09-30 15:05:07 UTC
Permalink
Here's the quote from the help regarding %SourceFileName%:

Name of the file from where the File adapter read the message. The file name
includes the extension and excludes the file path, for example, Sample.xml.
When substituting this property, the File adapter extracts the file name from
the absolute file path stored in the FILE.ReceivedFileName context property.
If the context property does not have a value, for example, if a message was
received on an adapter other than the File adapter, the macro will not be
substituted and will remain in the file name as is (for example,
C:\Drop\%SourceFileName%).

Neal Walters
http://Biztalk-Training.com
Samuel Kastberg
2004-10-15 11:35:50 UTC
Permalink
Hi Neal,

Did you solve this problem?
I did some research on my own and could use %DestinationParty%. What I did
was to create a new message just before saving and in the "Message
Assignment" used following code.
-----------------------------------------------------------------
NewMessage = MessageIncomming;
NewMessage(BTS.DestinationParty) = "SomeWildName";
-----------------------------------------------------------------

Configure the port with %DestinationParty%.

Samuel Kastberg
Callista Knowledgebase
Post by Neal Walters
I got your code to work when receiving a file and sending a file - BUT - what
if I want to create a file dynamically? The %SourceFileName% macro does not
substitute unless an actual physical file is received. So if I create a new
message by using XMLDOC.Load("<root></root>") etc... then try to write out
the file, the send port does not substitute a variable for
%SourceFileName%.
Post by Neal Walters
I was looking into other macros such as %DestinationParty% - but haven't got
that to work yet either. I'm about to do some searches on "custom macros" to
see if they are available.
Thanks in advance,
Neal Walters
http://Biztalk-Training.com - Free Biztalk Training Videos
Samuel Kastberg
2004-10-15 11:54:24 UTC
Permalink
The same kind of logic lets you use %SourceFileName%. Just assign it a value
at message creation if possible or create a copy.

Samuel Kastberg
Callista Knowledgebase
Post by Samuel Kastberg
Hi Neal,
Did you solve this problem?
I did some research on my own and could use %DestinationParty%. What I did
was to create a new message just before saving and in the "Message
Assignment" used following code.
-----------------------------------------------------------------
NewMessage = MessageIncomming;
NewMessage(BTS.DestinationParty) = "SomeWildName";
-----------------------------------------------------------------
Configure the port with %DestinationParty%.
Samuel Kastberg
Callista Knowledgebase
Post by Neal Walters
I got your code to work when receiving a file and sending a file - BUT -
what
Post by Neal Walters
if I want to create a file dynamically? The %SourceFileName% macro does
not
Post by Neal Walters
substitute unless an actual physical file is received. So if I create a
new
Post by Neal Walters
message by using XMLDOC.Load("<root></root>") etc... then try to write
out
Post by Neal Walters
the file, the send port does not substitute a variable for
%SourceFileName%.
Post by Neal Walters
I was looking into other macros such as %DestinationParty% - but haven't
got
Post by Neal Walters
that to work yet either. I'm about to do some searches on "custom
macros"
Post by Samuel Kastberg
to
Post by Neal Walters
see if they are available.
Thanks in advance,
Neal Walters
http://Biztalk-Training.com - Free Biztalk Training Videos
Loading...