BizTalk Server Orchestration - Problem using PromotedProperties and CorrelationSets

This is Interesting: Free IT Magazines  
Home > Archive > BizTalk Server Orchestration > April 2006 > Problem using PromotedProperties and CorrelationSets





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 Problem using PromotedProperties and CorrelationSets
Dourn

2006-04-27, 7:25 am

Hi all.
I have a question regarding PromotedProperties and Correlation Sets,
relating to a problem we’re having, using BTS 2004.
From what I can tell, this problem seems to be due to a flaw in BizTalk.

The synopsis of the problem is: Promoted Context Properties that don’t come
from the message body (i.e. use MessageContextPropertyBase) lose their
IsPromoted flag when going from an orchestration's Send Port back into the
MessageBox.

My question is: is this right? And why would BizTalk choose to do this?

The situation:
I'm using a Scatter-Gather pattern - I have a Flat-File pipeline which
debatches a single Flat-File message into multiple XML messages, each of
which cause an orchestration to run which updates a single node in each of
the messages (the scatter part).

I then have a second orchestration that uses correlation to gather the
messages back into a single message.
The only common property on the messages is a SequenceNumber which is in the
Header of the flat file.

I created a PropertySchema.xsd, added a SequenceNumber element, and set its
"Property Schema Base" to "MessageContextPropertyBase" so that it’s available
in the Context Properties of the Message Body.
I then promoted the SequenceNumber property in the Header schema.
I have a receive pipeline that uses this Header schema and a Body schema.

The pipeline correctly debatches the flat file into multiple XML messages.
I have an orchestration that subscribes to these messages – multiple
instances of the orchestration will execute.
Using HAT, I can see that for an incoming message into the first
orchestration, the SequenceNumber property appears in the Message Context,
has its value set correctly, and has the IsPromoted flag set to true.
The Orchestration updates some data in the message, and then uses a Direct
send port to send the message back to the MessageBox.

I have a second orchestration that uses a CorrelationSet. The orchestration
is correlated on SequenceNumber, and also on another property in the
MessageBody which is set in the first orchestration.
I was noticing that the second orchestration never fires, and that I get
Event messages indicating that no subscriber could be found for the messages
coming out of the first orchestration.

When I hook the Receive pipeline directly up to the second orchestration,
the subscriptions work correctly.
I used SubscriptionViewer to check the subscriptions to the second
orchestration, and then compared this with the Context Properties on the
suspended messages in HAT. This is when I noticied that the reason that the
subscription wasn't being met was that the IsPromoted flag had been set to
false on the SequenceNumber ContextProperty, meaning that that property was
no longer available to correlate on.

The BizTalk Architect here says that this is by design - in BTS 2004,
properties that don’t come form the Message Body (e.g. Header properties)
will lose their IsPromoted flag if an orchestration is the component writing
the message to the MessageBox (but doesn't happen when a Pipeline/Receive
Port is the component writing the message to the Message Box).
The possible solutions seem to be:

1) In BTS 2004, map the incoming schema to a new schema that includes the
Header Property in a new node, and promote this node value.
2) In BTS 2006, call a pipeline from within the orchestration to
“re-promote” the property.

Both of these seem a bit… messy… to me.
Anyone know of another solution?

I’ve tried using Correlated Port, Partner Ports, and using the Call and
Start Orchestration shapes – in all cases, I can’t correlate on this property.

Cheers,
Dourn.
Dourn

2006-04-27, 7:25 am

Well, a friend helped me out, and gave me a solution to use that doesn't
involve new schemas, or calling a pipeline (he'd had the same problem).

Is based on this post here:
http://blogs.msdn.com/dhtoran/archi.../07/436395.aspx

In a nutshell, there are two things that can promote properties (i.e. set
IsPromoted to true): a pipeline, and a correlation set.
So I created a correlation set using the properties I need promoted, and
initialised this set in the Send port of the orchestration.
Seems to work a treat.

Still doesn't answer my orginal question of Why the properties are demoted...!

Cheers,
Dourn.
Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com