Promoting reoccurring elements – Part III

Hi all

So, first I had a post about
promoting reoccurring elements where I discussed 4 options for promoting an element
that can occur multiple times in the input. Then I had a post about
how you can pseudo do it in BizTalk 2000/2002.

This post is about two things:

  1. Another way of doing it that doesn’t work
  2. Writing the custom pipeline component that was my second suggestion in my first
    post
    .

First issue

As discussed in my first
post
, if you change the XPath of the promoted property in the schema (either by
clicking the ellipsis as I wrote about or manually editing the XSD) to add the “[1]”,
you get this compilation error:

Node "ElementWhereNumber1IsPromoted" – The promoted property field or one
of its parents has Max Occurs greater than 1. Only nodes that are guaranteed to be
unique can be promoted as property fields.

But, since I couldn’t get the “[1]” to work in BizTalk 2000/2002 when editing my second
post
I used the position function instead. So i started wondering if that might
work in BizTalk 2006 R2. It doesn’t, though. It compiles just fine, and I really had
my hopes up, but at runtime you get this error:

There was a failure executing the receive pipeline: "Microsoft.BizTalk.DefaultPipelines.XMLReceive,
Microsoft.BizTalk.DefaultPipelines, Version=3.0.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
Source: "XML disassembler" Receive Port: "ReceivePort3" URI: "C:\Projects\Blog
Entries\PrommotingReoccurringElementsEditXSD\Instances\In\*.xml" Reason: Unexpected
XPath format:

So i had to drop that idea again.

Second issue

I decided to write the custom pipeline component that I discussed in my first
post
.

The main code is easy – just three properties:

  1. Name of the property
  2. Namespace of the property
  3. XPath

You can download it at http://eebiztalkpipelinecom.codeplex.com/ where
I have just made my initial release.



eliasen

Interview with Brian Loesged

A week ago Brian Loesgen was in town presenting at the Developer Summit here in Stockholm. Brian was kind enough to present at the BizTalk User Group in Sweden, and we pulled our resources to deliver a joint session on BizTalk Server Development best practices and BizTalk Server Administration best practices. The presentation was recorded and should be available on Channel 9 shortly. The next evening we had a second BizTalk User Group meeting with Paolo Salvatory who is a BizTalk Ranger (I know they have changed that title but “BizTalk Ranger” sounds way too cool to deprecate).
On the Saturday we took the boat to Waxholm for lunch, together with Julie Lerman and my wife. I hit upon the idea of adding some interviews to BloggersGuides.net, so I popped into the local tech shop and got a video camera for 599 SEK ($75) and recorded a short interview with Brian Loesgen.
Among the subjects we discussed are BizTalk ESB Guidance 2.0, Oslo, and also some tips for creating and maintaining a successful user group. The quality is not that great, mostly due to my camera skills, I hope to get better results when Stephen Thomas is in town in June. (I have to admit the interview idea was heavily inspired by Richard Seroter’s excellent Four Questionsseries on his blog.)
The interview is here.

Speaking at Northwest Arkansas Code Camp 2009, and you can join remotely

At 3:30 today I’ll be speaking at the Northwest Arkansas Code Camp 2009 about Concurrency in .NET 4.0.  Not in NWA?  No worries.  These guys have all the rooms setup with LiveMeeting, and are going to be making the content available during the day. If you’d like to join, just enter the LiveMeeting associated with each room at the Code Camp, you can find the links to them here.

Come, join in the fun, ask questions, and learn something today!

My Oslo “M” end-to-end demo

As part of my “M” end-to-end presentation in Stockholm last week, I came up with a way to walk through MSchema, MGrammar, MGraph and Intellipad that went over really well with the conference attendees. They “got” what I was talking about, rather than walking out with glazed-over eyes, so. As I’d put so much work into it and it seemed to resonate well with the audience, I thought I should record it and push it out to the world.

Caveat: although this is based on the now-current Oslo SDK, we are still pretty early on in the dev life cycle, so change is pretty much assured. As such, if you’re watching this in the year 2010, some of the things I say and do may no longer be applicable. However, for those here and now and interested in learning more about the Oslo modeling platform, I think you’ll find it of interest.

I had to do it at a fairly high resolution in order to fit everything I wanted to and still have the “code” legible (if you have a DSL that looks like a human language, is it still called “code”?).

The video is available here as an MP4, and here as an AVI.

Enjoy, and as always, comments and feedback are welcome.

Technorati Tags: Oslo,MUrl,M,Intellipad,models,DSL

The "Benefits" of Singularity… Thoughts on the Events of the Week

Even before the events of  early this week, we were fielding questions about a homogenous hardware / software approach.  Apple being the obvious example – clearly there is a segment that is willing to pay significantly more for a closed hardware / software experience.  The argument is an interesting one and is something that is intriguing at first blush.  Having a singular or very limited set of hardware to test against could decrease a variety of expenses such as development and testing. You could even argue acceleration in go to market because there wouldn’t be a handoff between the software side and the hardware side.  While you’re basking in additional benefits, let me paint you another picture.


Moments after Jimmy Stewart’s character George Bailey cried “I wish I was never born” he found himself in a strange, and far less wonderful life.  Pottersville is mostly a slum with a single land owner in town, the residents are disgruntled, all the houses look the same and every dollar earned or spent flows to and from a single entity.  Sure, queue up the haters, a Microsoft guy telling everyone what the world looks like with complete vertical consolidation will strike some as odd.


Here’s the realityThere are over 400,000 Microsoft partners worldwide. This diverse ecosystem includes hardware providers of all shapes and sizes, system integrators, ISVs, value-added resellers, hosters, distributors and many, many others. One of my favorite moments over the course of the year is spending time with our partner advisory council where folks from HP to SolidSoft get together and tell us how we can better meet customer needs. Here’s what I know for sure – the innovation we collectively deliver to customers is a reflection of the collective IQ and RD spend across those hundreds of thousands of partners. The strength of our offering and our ability to meet customer needs is predicated on the relationships that we have and the competition that is created from innovation.


What’s my view on the events of the week?  No thanks, Mr. Potter.   Beyond vertical singularity, I’ll save my thoughts on the future of Java for another day.

Regex.Replace not working when loading replace string from form.

I needed to do a replace using System.RegularExpressions.Regex.Replace() but was finding that if I passed the replacement string from a form, it would not correctly account for the Hexadecimal values I specified correctly. I noticed Expresso was having this same issue shown below:

Instead of replacing \r\n (Carriage Return Line Feed) with a “,” (Hex 2C), it was replacing it with the literal. I noticed this only happened when you passed the replace string in through a form; it would not happen if you hard coded Regex.Replace(“\r\n”,”\x2C”) into your .NET code.

I had to create a method that cleaned up all HEX replace strings from a form. If you have a better way of doing this, please comment.

public string CleanUpRegexReplaceStringFromForm(string str_DataFromForm) { // \n The newline character. (ASCII 10) str_DataFromForm = str_DataFromForm.Replace("\\n", "\n"); // \r The carriage return character. (ASCII 13) str_DataFromForm = str_DataFromForm.Replace("\\r", "\r"); // \t The tab character. (ASCII 9) str_DataFromForm = str_DataFromForm.Replace("\\t", "\t"); // \x2C The , character. str_DataFromForm = str_DataFromForm.Replace("\\t", "\t").Replace("\\x00","\x00"); // \x All other ASCII Characters str_DataFromForm = str_DataFromForm.Replace("\\x00","\x00"); str_DataFromForm = str_DataFromForm.Replace("\\x01","\x01"); str_DataFromForm = str_DataFromForm.Replace("\\x02","\x02"); str_DataFromForm = str_DataFromForm.Replace("\\x03","\x03"); str_DataFromForm = str_DataFromForm.Replace("\\x04","\x04"); str_DataFromForm = str_DataFromForm.Replace("\\x05","\x05"); str_DataFromForm = str_DataFromForm.Replace("\\x06","\x06"); str_DataFromForm = str_DataFromForm.Replace("\\x07","\x07"); str_DataFromForm = str_DataFromForm.Replace("\\x08","\x08"); str_DataFromForm = str_DataFromForm.Replace("\\x09","\x09"); str_DataFromForm = str_DataFromForm.Replace("\\x0A","\x0A"); str_DataFromForm = str_DataFromForm.Replace("\\x0B","\x0B"); str_DataFromForm = str_DataFromForm.Replace("\\x0C","\x0C"); str_DataFromForm = str_DataFromForm.Replace("\\x0D","\x0D"); str_DataFromForm = str_DataFromForm.Replace("\\x0E","\x0E"); str_DataFromForm = str_DataFromForm.Replace("\\x0F","\x0F"); str_DataFromForm = str_DataFromForm.Replace("\\x10","\x10"); str_DataFromForm = str_DataFromForm.Replace("\\x11","\x11"); str_DataFromForm = str_DataFromForm.Replace("\\x12","\x12"); str_DataFromForm = str_DataFromForm.Replace("\\x13","\x13"); str_DataFromForm = str_DataFromForm.Replace("\\x14","\x14"); str_DataFromForm = str_DataFromForm.Replace("\\x15","\x15"); str_DataFromForm = str_DataFromForm.Replace("\\x16","\x16"); str_DataFromForm = str_DataFromForm.Replace("\\x17","\x17"); str_DataFromForm = str_DataFromForm.Replace("\\x18","\x18"); str_DataFromForm = str_DataFromForm.Replace("\\x19","\x19"); str_DataFromForm = str_DataFromForm.Replace("\\x1A","\x1A"); str_DataFromForm = str_DataFromForm.Replace("\\x1B","\x1B"); str_DataFromForm = str_DataFromForm.Replace("\\x1C","\x1C"); str_DataFromForm = str_DataFromForm.Replace("\\x1D","\x1D"); str_DataFromForm = str_DataFromForm.Replace("\\x1E","\x1E"); str_DataFromForm = str_DataFromForm.Replace("\\x1F","\x1F"); str_DataFromForm = str_DataFromForm.Replace("\\x20","\x20"); str_DataFromForm = str_DataFromForm.Replace("\\x21","\x21"); str_DataFromForm = str_DataFromForm.Replace("\\x22","\x22"); str_DataFromForm = str_DataFromForm.Replace("\\x23","\x23"); str_DataFromForm = str_DataFromForm.Replace("\\x24","\x24"); str_DataFromForm = str_DataFromForm.Replace("\\x25","\x25"); str_DataFromForm = str_DataFromForm.Replace("\\x26","\x26"); str_DataFromForm = str_DataFromForm.Replace("\\x27","\x27"); str_DataFromForm = str_DataFromForm.Replace("\\x28","\x28"); str_DataFromForm = str_DataFromForm.Replace("\\x29","\x29"); str_DataFromForm = str_DataFromForm.Replace("\\x2A","\x2A"); str_DataFromForm = str_DataFromForm.Replace("\\x2B","\x2B"); str_DataFromForm = str_DataFromForm.Replace("\\x2C","\x2C"); str_DataFromForm = str_DataFromForm.Replace("\\x2D","\x2D"); str_DataFromForm = str_DataFromForm.Replace("\\x2E","\x2E"); str_DataFromForm = str_DataFromForm.Replace("\\x2F","\x2F"); str_DataFromForm = str_DataFromForm.Replace("\\x30","\x30"); str_DataFromForm = str_DataFromForm.Replace("\\x31","\x31"); str_DataFromForm = str_DataFromForm.Replace("\\x32","\x32"); str_DataFromForm = str_DataFromForm.Replace("\\x33","\x33"); str_DataFromForm = str_DataFromForm.Replace("\\x34","\x34"); str_DataFromForm = str_DataFromForm.Replace("\\x35","\x35"); str_DataFromForm = str_DataFromForm.Replace("\\x36","\x36"); str_DataFromForm = str_DataFromForm.Replace("\\x37","\x37"); str_DataFromForm = str_DataFromForm.Replace("\\x38","\x38"); str_DataFromForm = str_DataFromForm.Replace("\\x39","\x39"); str_DataFromForm = str_DataFromForm.Replace("\\x3A","\x3A"); str_DataFromForm = str_DataFromForm.Replace("\\x3B","\x3B"); str_DataFromForm = str_DataFromForm.Replace("\\x3C","\x3C"); str_DataFromForm = str_DataFromForm.Replace("\\x3D","\x3D"); str_DataFromForm = str_DataFromForm.Replace("\\x3E","\x3E"); str_DataFromForm = str_DataFromForm.Replace("\\x3F","\x3F"); str_DataFromForm = str_DataFromForm.Replace("\\x40","\x40"); str_DataFromForm = str_DataFromForm.Replace("\\x41","\x41"); str_DataFromForm = str_DataFromForm.Replace("\\x42","\x42"); str_DataFromForm = str_DataFromForm.Replace("\\x43","\x43"); str_DataFromForm = str_DataFromForm.Replace("\\x44","\x44"); str_DataFromForm = str_DataFromForm.Replace("\\x45","\x45"); str_DataFromForm = str_DataFromForm.Replace("\\x46","\x46"); str_DataFromForm = str_DataFromForm.Replace("\\x47","\x47"); str_DataFromForm = str_DataFromForm.Replace("\\x48","\x48"); str_DataFromForm = str_DataFromForm.Replace("\\x49","\x49"); str_DataFromForm = str_DataFromForm.Replace("\\x4A","\x4A"); str_DataFromForm = str_DataFromForm.Replace("\\x4B","\x4B"); str_DataFromForm = str_DataFromForm.Replace("\\x4C","\x4C"); str_DataFromForm = str_DataFromForm.Replace("\\x4D","\x4D"); str_DataFromForm = str_DataFromForm.Replace("\\x4E","\x4E"); str_DataFromForm = str_DataFromForm.Replace("\\x4F","\x4F"); str_DataFromForm = str_DataFromForm.Replace("\\x50","\x50"); str_DataFromForm = str_DataFromForm.Replace("\\x51","\x51"); str_DataFromForm = str_DataFromForm.Replace("\\x52","\x52"); str_DataFromForm = str_DataFromForm.Replace("\\x53","\x53"); str_DataFromForm = str_DataFromForm.Replace("\\x54","\x54"); str_DataFromForm = str_DataFromForm.Replace("\\x55","\x55"); str_DataFromForm = str_DataFromForm.Replace("\\x56","\x56"); str_DataFromForm = str_DataFromForm.Replace("\\x57","\x57"); str_DataFromForm = str_DataFromForm.Replace("\\x58","\x58"); str_DataFromForm = str_DataFromForm.Replace("\\x59","\x59"); str_DataFromForm = str_DataFromForm.Replace("\\x5A","\x5A"); str_DataFromForm = str_DataFromForm.Replace("\\x5B","\x5B"); str_DataFromForm = str_DataFromForm.Replace("\\x5C","\x5C"); str_DataFromForm = str_DataFromForm.Replace("\\x5D","\x5D"); str_DataFromForm = str_DataFromForm.Replace("\\x5E","\x5E"); str_DataFromForm = str_DataFromForm.Replace("\\x5F","\x5F"); str_DataFromForm = str_DataFromForm.Replace("\\x60","\x60"); str_DataFromForm = str_DataFromForm.Replace("\\x61","\x61"); str_DataFromForm = str_DataFromForm.Replace("\\x62","\x62"); str_DataFromForm = str_DataFromForm.Replace("\\x63","\x63"); str_DataFromForm = str_DataFromForm.Replace("\\x64","\x64"); str_DataFromForm = str_DataFromForm.Replace("\\x65","\x65"); str_DataFromForm = str_DataFromForm.Replace("\\x66","\x66"); str_DataFromForm = str_DataFromForm.Replace("\\x67","\x67"); str_DataFromForm = str_DataFromForm.Replace("\\x68","\x68"); str_DataFromForm = str_DataFromForm.Replace("\\x69","\x69"); str_DataFromForm = str_DataFromForm.Replace("\\x6A","\x6A"); str_DataFromForm = str_DataFromForm.Replace("\\x6B","\x6B"); str_DataFromForm = str_DataFromForm.Replace("\\x6C","\x6C"); str_DataFromForm = str_DataFromForm.Replace("\\x6D","\x6D"); str_DataFromForm = str_DataFromForm.Replace("\\x6E","\x6E"); str_DataFromForm = str_DataFromForm.Replace("\\x6F","\x6F"); str_DataFromForm = str_DataFromForm.Replace("\\x70","\x70"); str_DataFromForm = str_DataFromForm.Replace("\\x71","\x71"); str_DataFromForm = str_DataFromForm.Replace("\\x72","\x72"); str_DataFromForm = str_DataFromForm.Replace("\\x73","\x73"); str_DataFromForm = str_DataFromForm.Replace("\\x74","\x74"); str_DataFromForm = str_DataFromForm.Replace("\\x75","\x75"); str_DataFromForm = str_DataFromForm.Replace("\\x76","\x76"); str_DataFromForm = str_DataFromForm.Replace("\\x77","\x77"); str_DataFromForm = str_DataFromForm.Replace("\\x78","\x78"); str_DataFromForm = str_DataFromForm.Replace("\\x79","\x79"); str_DataFromForm = str_DataFromForm.Replace("\\x7A","\x7A"); str_DataFromForm = str_DataFromForm.Replace("\\x7B","\x7B"); str_DataFromForm = str_DataFromForm.Replace("\\x7C","\x7C"); str_DataFromForm = str_DataFromForm.Replace("\\x7D","\x7D"); str_DataFromForm = str_DataFromForm.Replace("\\x7E","\x7E"); str_DataFromForm = str_DataFromForm.Replace("\\x7F", "\x7F"); return str_DataFromForm; }

HIPAA Multiple Schema Hotfix 967945

For those of you who are using the multiple schema to split your claims up into individual messages, you might have come across the performance degradation issue with having those messages come into the message box.

This functionality worked fine using the Covast HIPAA Accelerator, but seemed to be a huge issue when migrating to R2.

This is the cause that Microsoft states:

The splitting behavior results in XML files that include not only the sub-document that you want, but also empty XML markup for all sibling sub-documents. Although the sibling sub-documents do not contain data, the behavior results in bloated output XML files and other inefficiencies that make processing very large EDI batches impossible.

I think it is interesting that something is impossible – wow!

To make the impossible possible again, you need to install hot fix 967945, you can download it in the View and request hotfix downloads link.

Poor visual studio integration

<Rant>

I came across the worst example of visual studio source control integration ever today. I was checking in some work and added the comment about the check in in the pending checkins box. I then pressed check in.

We use MKS source control (unfortunately)which then preceeded to display 75 confirmation boxes confirming that I was sure i wanted to check in and that I wanted to use the comment I had supplied in Visual Studio.

Note to anyone doing Visual Studio source control integration:

1. Integration into visual studio means that as a developer I dont really want to know much if anything about the source control system under the hood

2. Yes means yes. When I confirm that I want to check in dont ask me over and over again.

</Rant>