共用方式為


Business Rules Authorization Tool Updated, Funky Problem With Custom Promoted Property

Just finished up a week-long POC for one of my favorite accounts up in north LA. Now that I have 6 spare minutes, wanted to post an update to my Business Rules Authorization Manager tool and note a really random BizTalk thing I came across this week.

I cleaned up the Rules Authorization Manager a bit, adding support for securing vocabularies as well as rule sets, and, actually adding exception catching code. Some people actually like their exceptions handled. Go figure. You can download the RAM tool here.

My POC this week consisted of getting duplicate records out of Siebel, processing them, making recommendations on which ones to keep (using Business Rules) and then making a final update to Siebel. Fun stuff. Since each SQL Adapter query grabbed a individual group of duplicates, I needed some way to know when all the duplicates had been yanked. I didn't want to process all the duplicates via a singleton orchestration, but rather spread the processing out. So, I implemented a variation of the Scatter-Gather pattern where I process each cluster of duplicates asynchronously, but then when that cluster is done, I throw the message direct bound to the MessageBox. Then, I have a simple singleton convoy orchestration who just listens for the clusters and if a minute has passed (using combination of loop shape, listen shape, delay shape), then I assume I've got all the clusters and move on to the next process step. Now, that's not foolproof, and for a *real* application I'd probably want a better validation (e.g. database counter) that all the clusters have been received instead of a simple timer.

That all said, I needed a way for the "Gather" orchestration to only subscribe to completed cluster of duplicates. And the schema I used was generated by SQL Server, so I didn't want to muck around with the database to add some sort of "status" flag. SO what I did was create a simple receive pipeline component that created a new promoted property called "ClusterStatus" and defaulted it to "Processing". Now I have a promoted field that the singleton orchestration can subscribe on. Each processing orchestration then sets the "ClusterStatus" to "Completed" before dumping it back to the MessageBox for the singleton to pick up. HOWEVER, when I started it up, my processing orchestrations all barfed and said "no subscribers found" when calling the direct bound send shape. After digging around, I saw that my promoted property "ClusterStatus" was still in my outbound message, but had gotten demoted to context-only. Ugh! I broke down and engaged the wisdom of Marty Waz, and he suggested creating a correlation set, and initializing on that direct bound send back to the MessageBox. Brilliant. This forces the context value back into a promoted state, and now the singleton could see it.

Not sure anyone will ever have this problem, but it drove me nuts, and this was a bizarre yet logical way to fix my problem.

Technorati Tags: BizTalk

Comments

  • Anonymous
    June 20, 2006
    I believe that when using messagebox direct binding, you only need to promote a property via a correlation set when the promoted property does not appear as a value in the message schema - i.e. when the promoted property's Property Schema Base property in the property schema is set to MessaageContextPropertyBase. When the promoted property does exist in the message schema (i.e. the promoted property's Property Schema Base property in the property schema is set to MessageDataPropertyBase, or is blank), you don't need to promote it via a correlation set - the act of publication to the messagebox automatically properly promotes all promoted properties that exist in the message itself. I wish there was a way of making the stuff I've just written understandable. Just as I wish there was a way of hurrying up Kevin Lam to finish his excellent series of articles on direct binding - the only one I don't know is the one he's got left - the self-correlating type..... ;)
  • Anonymous
    June 22, 2006
    Yeah, looks like that's the case.  If you have a context-only promoted value, you may have to initialize a correlation set in order to get that value promoted, regardless of whether it's DirectBound or out via an adapter.
  • Anonymous
    August 08, 2006
    I recently suffered through this exact same problem while attempt to implement a similar processing scenario.  It took me a lot of blog-reading before I found Charles Young's post:
    http://geekswithblogs.net/cyoung/articles/19546.aspx

    It's nice to see I'm not the only one... :)

  • Anonymous
    August 14, 2006
    The comment has been removed
  • Anonymous
    August 15, 2006
    The comment has been removed