Eric’s BizTalk 2004/2006 Blog

My BizTalk Experiences using Flat Files, InfoPath, BAM, BRE, BAS, HL7, HIPAA, WSS.

August 11, 2006

070-235 - I passed!

Filed under: BAM, BizTalk, BRE — eric @ 1:05 pm

I signed up for the test, and then proceeded to get swamped with everything but reviewing my weak points in BizTalk 2006.

This morning, I even attempted to cancel the test, but it was too late. I pleasantly surprised myself by actually passing! (Not the best score possible, but above 700 none-the-less)

Things that I remember from the test:

It was more centered on developing scenerios than on individual coding details like the 2004 test was.

Lots of BRE questions.

Lots of BAM questions.

A question regarding the error handling process.

A few setup questions.

A couple of web service questions

If you are planning on taking the test, be well versed in the development of entire business processes.

You can learn more about the test here.

Good Luck

August 4, 2006

Redmond Conferences

Filed under: BAM, BizTalk, HL7, HIPAA, InfoPath, SharePoint, BRE, SQL — eric @ 1:14 pm

I am heading up to Redmond for a couple of conferences:
mshug_techforum_masthead.gif
and
soabp_header.jpg

Let me know if you are going, it would be great to meet you! 

March 24, 2006

BizTalk Tidbits

Filed under: BAM, BizTalk, BRE — eric @ 9:13 am

I have a bunch of tidbits that I have found, and instead of creating a blog entry for each of them, I have put them all together into one big entry. I hope that there is something in this for everyone! 

Items Explained:
1. Using the Flat File Schema you can define custom date formats. One word of caution, in order to use this feature, you have to guarantee that the date is going to be present.
 

 

2. Using XPath, you can take advantage of features of XPath, namely count(), substring-before(), substring-after() and all other available XPath functions. Example:

MessageCount=(System.Int32)xpath(CompleteMsg,”count(/*[local-name()=’File’ and namespace-uri()=’http://AppendExample.File’]/*[local-name()=’Record’ and namespace-uri()=’http://AppendExample.Record’])”);

And

FirstName=xpath(IndividualMsg.BodyPart,”substring-before(/*[local-name()=’Record’ and namespace-uri()=’http://AppendExample.Record’]/*[local-name()=’Information’ and namespace-uri()='’]/@*[local-name()=’Name’ and namespace-uri()='’],’ ‘)”);

LastName=xpath(IndividualMsg.BodyPart,”substring-after(/*[local-name()=’Record’ and namespace-uri()=’http://AppendExample.Record’]/*[local-name()=’Information’ and namespace-uri()='’]/@*[local-name()=’Name’ and namespace-uri()='’],’ ‘)”);

3. Since there is no such thing as an Envelope Schema that can be used in a Flat File scenario, you can use XPath to extract internally the separate documents and manipulate the data as needed. Example:

xpathString=System.String.Format(”/*[local-name()=’File’ and namespace-uri()=’http://AppendExample.File’]/*[local-name()=’Record’ and namespace-uri()=’http://AppendExample.Record’][{0}]”,CurrentRecord);

tempXML=new System.Xml.XmlDocument();

tempXML=xpath(CompleteMsg,xpathString);

4. You don’t need to have a Construct Shape with an internal Message Assignment Shape, you can simply use the Construct Keyword; you can construct multiple messages at the same time. Example:                                    

construct AfterMsg,BeforeMsg
{
   AfterMsg=tempAfterXML;
   BeforeMsg=tempBeforeXML;
}

One word of caution though, if you are using the Tracking Profile Editor to capture data, it will not show as an option, so use this only if you are not going to use the TPE.

5. You can take a message and convert it into text for insertion into database columns:                                                                                                    

tempXMLData=IndividualMsg.BodyPart;
StringWriter=new System.IO.StringWriter();
XmlTextWriter=new System.Xml.XmlTextWriter(StringWriter);
tempXMLData.WriteTo(XmlTextWriter);
rawXmlData=StringWriter.ToString();

6. Using XPath, you can update attributes/elements. Example:  

xpathString=System.String.Format(”/*[local-name()=’Request’ and namespace-uri()=’http://exampleDataStore’]/*[local-name()=’sync’ and namespace-uri()=’http://exampleDataStore’]/*[local-name()=’after’ and namespace-uri()=’http://exampleDataStore’]/*[local-name()=’DataStore’ and namespace-uri()=’http://exampleDataStore’][{0}]/@*[local-name()=’FirstName’ and namespace-uri()='’]”,CurrentRecord);

xpath(tempDBInsertMsg,xpathString)=FirstName;

Word of caution though: you need to make sure that the attribute/element exists, xpath will not create it, just populate it.

7. Using Microsoft’s built in System.XML functionality; you can append data inside of an already existing xml structure. Example:

internalBeforeXmlDocument=IndividualMsg.BodyPart;
tempBeforeXML=(System.Xml.XmlDocument) tempBeforeXML.CloneNode(true);
XmlNode = tempBeforeXML.CreateNode (System.Xml.XmlNodeType.Element,”ns1″,”Record”,”http://appendexample.record/“);
XmlNode.InnerXml=internalBeforeXmlDocument.FirstChild.InnerXml;
tempBeforeXML.FirstChild.AppendChild(XmlNode);
BeforeMsg=tempBeforeXML;

8. Using Multi-part messages, you can call Business Rules to update ‘Context’ data, since the BRC cannot access the Context data, accessing the Context Part of the data serves the same purpose.

Here is the sample.

February 23, 2006

BAM, BRE, and too much time on my hands

Filed under: BAM, BizTalk, BRE — eric @ 7:58 am

Having a 5 hr flight twice a week had left me with enough time on my hands that I have an opportunity to explore some of the finer things of BizTalk. The first example is a client had asked me to have an Interchange router. Like almost all of the business I have been involved in, it is EDI. To give a 2 sentence description of EDI, an EDI document can have multiple Interchanges, each Interchange can have multiple Functional Groups, and each Functional Group can have multiple Transactions. Each Interchange starts with ISA and ends with IEA, each Functional Group starts with GS and ends with GE, and each Transaction starts with ST and ends with SE.
The client had wanted me to build an Interchange Router, take each interchange in the file and based on certain criteria send it to different locations. Also if it was an 856, some values in the ISA needed to be changed. If an interchange came from a particular vendor, it needed to be routed to a seperate location.

I put together the project, first building a Interchange, calling the schema single.xsd, I then imported it to the multiple interchange schema, oddly enough called Multiple.xsd. I created the flat file recieve pipeline and send pipeline that consumes and delivers their respective files. After the multiple interchange file is consumed, I create what I like to call is a context message. This message will be manipulated by the BRE. I then call the BRE (Server Info), instead of a Call Rule shape, I create an array, and send it the context message I just created which will retrieve the server name where the MessageBoxDB and BAMPrimaryImport data exists.
I then call the DirectEventStream and write the input file information directly to the BAMPrimaryImport database. Because I set the second argument of DirectEventStream to ‘0′ I need to flush it after it is completed.
I then split up the document, call a Business Rule (Router) to determine where the single interchange destination is, and make modifications to the interchange if it was a 856. I then took that specific information and logged it to BAM, and using a relationship, I was able to tie it into the file information.
You will have to use the BM.exe to deploy various bam views, and the Business Rules Deployment wizard to import the vocabularies and policies into the BRE.
Attached is my finalized project, which was over and above what the client was expecting, as now there is a log of what was received, and what was sent out.
Here is the link to the zipped 2K4 example