Sep 292006


Back in the day (BizTalk 2002) the incremental numbers in the HL Segments were something that an average developer did not need to worry about.

However, vcialis 40mg see with newer versions comes enhancements, medicine generic built in tools that make it easier and quicker to develop the same solution. HL Numbering however is actually harder. Microsoft has decided that it is not going to modify any of the data inside of the Transaction using the HIPAA adapter. I had to create a process that would do the numbering.

The trick was to get the numbers to increment regardless of where in the transaction the work was being done. I used some simple C# code to create a constant variable and increment the number.

I created a self contained orchestration that would accept a Claim (institutional or professional) re number it and then send it back. I did this so I can do my mapping logic and then finally plug this in.

Sep 262006

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’])”);


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();


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

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: 

StringWriter=new System.IO.StringWriter();
XmlTextWriter=new System.Xml.XmlTextWriter(StringWriter);

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);


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:

tempBeforeXML=(System.Xml.XmlDocument) tempBeforeXML.CloneNode(true);
XmlNode = tempBeforeXML.CreateNode (System.Xml.XmlNodeType.Element,”ns1″,”Record”,”http://appendexample.record/“);

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.

Sep 252006

Here are the instructions on how to create xml objects and then reuse them in a different schema.

  1. Create your object that you want to reuse in a schema
  2. In the properties of the object, cialis type in objectType in the Data Structure Type
  3. Create your ‘real’ schema and in the Schema node’s properties, abortion click the elipse on Imports and browse to the schema defined in Step 1
  4. Create the real object and in the Data Structure Type, choose the complex type that was created in Step 2
Sep 222006


A recent post was written about attempting to query the DTADB database to capture data and send it to a particular customer. I suggested that this is a purpose in Business Activity Monitoring. I have created a sample application that demonstrates some of the powers of BAM.

In this example orders are processed by Biztalk, doctor and key data elements are extracted and sent to the BAMPrimaryImport database.

Another orchestration takes the information in the database and creates a report and sends it out to the customer.


Setup Instructions:

  1. Download this file.
  2. Run the following command from a dos prompt to create the necessary BAM objects: TrackingBM.exe deploy ..BAMReportingActivityInfo.xml
  3. Run the extractBAM.sql against the BAMPrimaryImportDb
  4. Deploy the solution
  5. Modify the binding.xml file to represent your enviornment
  6. Bind the ports using the Deployment wizard.
  7. Enlist the orchestrations
  8. Drop Order 1.xml, Order 2.xml, and Order 3.xml into the Input folder
  9. Wait and then drop the Confirmation 1.xml, Confirmation 2.xml, and Confirmation 3.xml into the Input folder
  10. Drop the Trigger.xml file into the input file and in the output folder there should be an email xml file that shows various BAM data.

This actually goes against my better concience on at least 2 fronts:

  • BizTalk has the ability to do a lot of things, but sometimes it shouldn’t. I know of some people think that it is better than sliced bread, but a more elegant solution would be to use SQLReporting services that would go against the BAMPrimaryImportDB
  • It uses a trigger file to kick off the report, there could be a better way, with a proper stored proc to do some marking of the data so no duplicate reports get run
Sep 192006

I am tired of constantly having to look up what the macros are for BizTalk

Coordinated Universal Time (UTC) date time in the format YYYY-MM-DDThhmmss (for example, viagra 40mg 1997-07-12T103508).
UTC date time in the format YYYYMMDDhhmmsss, look where sss means seconds and milliseconds (for example, 199707121035234 means 1997/07/12, 10:35:23 and 400 milliseconds).
Local date time plus time zone from GMT in the format YYYY-MM-DDThhmmssTZD, (for example, 1997-07-12T103508+800).
Name of the destination party. The value comes from the message context property BTS.DestinationParty.
Globally unique identifier (GUID) of the message in BizTalk Server. The value comes directly from the message context property BTS.MessageID.
Name of the file from where the File adapter read the message. The file name includes the extension and excludes the file path, for example, Sample.xml. When substituting this property, the File adapter extracts the file name from the absolute file path stored in the FILE.ReceivedFileName context property. If the context property does not have a value, for example, if a message was received on an adapter other than the File adapter, the macro will not be substituted and will remain in the file name as is (for example, C:Drop\%SourceFileName%).
Name of the source party from which the File adapter received the message.
Qualifier of the source party from which the File adapter received the message.
UTC time in the format hhmmss.
Local time plus time zone from GMT in the format hhmmssTZD (for example, 124525+530).
Sep 192006

This also can work for multiple outputs to BizTalk Map also.

A recent post was asked how to take multipe messages and merge them into an output message structure. This actually puzzed me while I was learning the way BizTalk worked. Here is a simple example of how it works, sildenafil and how to implement it…

  1. The first thing this orchestration does is start off by consuming a trigger message.
  2. It then constructs the calls to the two stored procedures
  3. Then it calls the stored procedures and gets the responses from the stored procedures.
  4. It then takes the two responses and invokes the map. Here is the picture of the input arguments to the map:
  5. This is what the map looks like after you create the map with the multiple inputs:
  6. It then creates the file an sends the resulting file out.
  7. Here is the complete view of the orchestration:

Setup Instructions:

  1. Extract this file
  2. In the Properties of the project point to a strong named key file and set the BizTalkMgmtDB to your server
  3. Run the included sql script against the Northwind database to create the stored procedures
  4. Deploy the project
  5. create 4 ports
    • One input using Default XML pipeline and pointing to ..MultipleInputInput directory
    • Two Static Solicit/Response ports pointing to the Nortwind database and setting the Document Target Namespace to be http://storedprocx/ (X being the number of the stored proc), hospital  setting default xml as both the Send and Receive pipelines
    • One send port, medicine setting the default xml pipline and pointing to the ..MultipleInputOutput directory
  6. Bind the logical ports to the physical ports created in step 5
  7. Start the orchestration, drop the trigger in the Input directory, and you are good to go 
Sep 182006

I was helping Alberto on this flat file problem. I thought that I had created the flat file schema correctly to parse this correctly.
Sample File

However when I would validate the schema I was constantly getting the following message: “The element ‘OuterLoop’ has incomplete content. List of possible elements expected: ‘KLoop, viagra ZRecord’.” This was the resulting xml output:
Sample File XML

However, cure I knew that the schema was set up correctly. I fiddled with it for quite a while, thumb until I went to the Schema object and changed the Parse Optimization from Speed to Complexity.

It then parsed correctly and here is the result:
Sample File XML that is Correct

After seaching this is the closest definition I can find on the difference between Speed and Complexity:
“In speed mode, the parser tries to fit data as it appears in the stream. In complexity mode, the flat-file parsing engine uses both top-down and bottom-up parsing, and tries to fit data more accurately.”

Sep 072006


To extend the previous post, cialis the following question was asked: How can the flat file parser consume a positional file when the end of each record might not be the length that is defined.

This actually is a very common occurrence, check as I have had to deal with it, ed it mainly has to do with transfers from mainframes to windows based machines.

I deviated from the original file a little:

I enabled Allow Early Termination: