BizTalk Server General - Flat File Problem

This is Interesting: Free IT Magazines  
Home > Archive > BizTalk Server General > March 2006 > Flat File Problem





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 Flat File Problem
Gary

2006-03-14, 5:52 pm

Hi All,

I am currently working on a project where we receive a flat file which
contains no header or trailer but multiple records in the file. We are
wrapping the FFDasm in a custom pipeline so we can dynamically set the schema
property.

What we are wanting to do is use a sequential convoy to enforce sequencing.
Therefore we have figured that we could do this by counting the records in
the flat file and then updating the stream by inserting our own header record
before calling the FFDasm disassemble method.

We have currently hard coded the head so our file is as follows:

RecordCount2
Rec....... etc
Rec....... ect

We have assigned a schema to the DocumentSpecName and also a header schema
to the HeaderSpecName. Our problem is we dont know how to get the value from
the Header in an orchestration. We have tried promoting the RecordCount
property in the header schema and setting the promoted element to
MessagePropertyContextBase and we have set the PreserveHeader property to
true in the pipeline component but it doesn't seem to be populated in the
orchestration.

Can anyone give us a clue with this one please?

Cheers,
Gary
Leonid Ganeline

2006-03-14, 5:52 pm

Hi Gary,
As I can remember the header information is not accessible inside the Orch.
It is only immutable transfering from receive port to the send port.
Why do you use a header schema?
If you anyway use a custom pipeline you can add a node with a record ID to
the body schema.
Keep in mind that XmlDisassembler component promotes nodes to the context.
No XmlDisassembler - no promotion.

--

Regards,

Leonid Ganeline
BizTalk developer
Vancouver
http://geekswithblogs.net/leonidganeline
===================================


"Gary" <Gary@discussions.microsoft.com> wrote in message
news:B924A764-3FAC-48D7-813C-AC182E8A4D9D@microsoft.com...
> Hi All,
>
> I am currently working on a project where we receive a flat file which
> contains no header or trailer but multiple records in the file. We are
> wrapping the FFDasm in a custom pipeline so we can dynamically set the
> schema
> property.
>
> What we are wanting to do is use a sequential convoy to enforce
> sequencing.
> Therefore we have figured that we could do this by counting the records in
> the flat file and then updating the stream by inserting our own header
> record
> before calling the FFDasm disassemble method.
>
> We have currently hard coded the head so our file is as follows:
>
> RecordCount2
> Rec....... etc
> Rec....... ect
>
> We have assigned a schema to the DocumentSpecName and also a header schema
> to the HeaderSpecName. Our problem is we dont know how to get the value
> from
> the Header in an orchestration. We have tried promoting the RecordCount
> property in the header schema and setting the promoted element to
> MessagePropertyContextBase and we have set the PreserveHeader property to
> true in the pipeline component but it doesn't seem to be populated in the
> orchestration.
>
> Can anyone give us a clue with this one please?
>
> Cheers,
> Gary



Greg Forsythe

2006-03-14, 5:52 pm

Rather than modifying the flat file why don't you promote the property
yourself in your custom pipeline component.
baseMessage.Context.Promote("RecordCount", "Your RecordCount property
namespace", record count value);
You can do this just before returning from GetNext()

This would be much easier than modifying the input data, using a header
schema and relying on the FFDasm to promote the property for you.

The FFDasm will promotes properties
And you can promote properties from the Header into the message context, and
have access to them in the orchestration. If the input message is split by
the FFDasm each message will contain the header properties.

Greg


"Leonid Ganeline" <leo_gan_57@hotmail.com> wrote in message
news:%23$B2qd6RGHA.256@TK2MSFTNGP14.phx.gbl...
> Hi Gary,
> As I can remember the header information is not accessible inside the
> Orch. It is only immutable transfering from receive port to the send port.
> Why do you use a header schema?
> If you anyway use a custom pipeline you can add a node with a record ID to
> the body schema.
> Keep in mind that XmlDisassembler component promotes nodes to the context.
> No XmlDisassembler - no promotion.
>
> --
>
> Regards,
>
> Leonid Ganeline
> BizTalk developer
> Vancouver
> http://geekswithblogs.net/leonidganeline
> ===================================
>
>
> "Gary" <Gary@discussions.microsoft.com> wrote in message
> news:B924A764-3FAC-48D7-813C-AC182E8A4D9D@microsoft.com...
>
>



Gary

2006-03-15, 7:48 am

I have tried this morning to go down the route of promoting the property just
before returning from GetNext() i.e.

newMsg.Context.Promote("RecordCount", propertyschema namespace, value);

I have set the RecordCount property in the schema file to be
MessageContextPropertyBase

The property value is not set and debugging an orchestration using the
orchestration debugger I cannot see this property anywhere. However if I look
at the consumed message from the biztalk admistration screen I can see that
the property is promoted in this. It seems to me that the property is
promoted on the consumed message but once it gets into an orchestration then
the promoted property is lost.

Any ideas?

Thanks


"Greg Forsythe" wrote:

> Rather than modifying the flat file why don't you promote the property
> yourself in your custom pipeline component.
> baseMessage.Context.Promote("RecordCount", "Your RecordCount property
> namespace", record count value);
> You can do this just before returning from GetNext()
>
> This would be much easier than modifying the input data, using a header
> schema and relying on the FFDasm to promote the property for you.
>
> The FFDasm will promotes properties
> And you can promote properties from the Header into the message context, and
> have access to them in the orchestration. If the input message is split by
> the FFDasm each message will contain the header properties.
>
> Greg
>
>
> "Leonid Ganeline" <leo_gan_57@hotmail.com> wrote in message
> news:%23$B2qd6RGHA.256@TK2MSFTNGP14.phx.gbl...
>
>
>

Greg Forsythe

2006-03-16, 7:48 am

If you can see the property in the message context of the consumed message,
then it should be available for use by the orchestration.
What are you doing with the promoted property in the orchestration.
Have you deployed the Biztalk Assembly that contains the property schema
that contains this property.
Does the property name and namespace you use in the pipeline component match
those in the property schema

Greg


"Gary" <Gary@discussions.microsoft.com> wrote in message
news:1A257D61-BB46-4A97-BBC0-628A5EA36865@microsoft.com...[vbcol=seagreen]
>I have tried this morning to go down the route of promoting the property
>just
> before returning from GetNext() i.e.
>
> newMsg.Context.Promote("RecordCount", propertyschema namespace, value);
>
> I have set the RecordCount property in the schema file to be
> MessageContextPropertyBase
>
> The property value is not set and debugging an orchestration using the
> orchestration debugger I cannot see this property anywhere. However if I
> look
> at the consumed message from the biztalk admistration screen I can see
> that
> the property is promoted in this. It seems to me that the property is
> promoted on the consumed message but once it gets into an orchestration
> then
> the promoted property is lost.
>
> Any ideas?
>
> Thanks
>
>
> "Greg Forsythe" wrote:
>


Gary

2006-03-21, 3:09 am

Hi Greg,

Thanks for your response. In the orchestration I have simply created a
variable of type string and in an expression shape I have assigned the
variable to the value of the promoted property i.e.

RecCount = Message(promotedproperty);

When I debug the orchestration the RecCount variable is null. I think from
what you say I have done about 95% correct and I'm just tripping up on
something small. I'll have a look around again this week and see if I can
solve it.

Thanks,
Gary

"Greg Forsythe" wrote:

> If you can see the property in the message context of the consumed message,
> then it should be available for use by the orchestration.
> What are you doing with the promoted property in the orchestration.
> Have you deployed the Biztalk Assembly that contains the property schema
> that contains this property.
> Does the property name and namespace you use in the pipeline component match
> those in the property schema
>
> Greg
>
>
> "Gary" <Gary@discussions.microsoft.com> wrote in message
> news:1A257D61-BB46-4A97-BBC0-628A5EA36865@microsoft.com...
>
>
>

Gary

2006-03-21, 8:02 am

Hi, thanks for your help.

I have managed to solve the problem. It was the namespace I was using to
write the context. Having read an article on microsoft I thought that when
writing a property to the context it was creating a distinguished property
which would have used the namespace
http://schemas.microsoft.com/BizTal...inguishedFields

this was where I was going wrong, I needed to use the property schema
namespace which had the property defined.

Thanks.
Gary

"Gary" wrote:
[vbcol=seagreen]
> Hi Greg,
>
> Thanks for your response. In the orchestration I have simply created a
> variable of type string and in an expression shape I have assigned the
> variable to the value of the promoted property i.e.
>
> RecCount = Message(promotedproperty);
>
> When I debug the orchestration the RecCount variable is null. I think from
> what you say I have done about 95% correct and I'm just tripping up on
> something small. I'll have a look around again this week and see if I can
> solve it.
>
> Thanks,
> Gary
>
> "Greg Forsythe" wrote:
>
Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com