BizTalk 2010 Real World Example - Part 1

Introduction

I wanted to write this blog for the benefit of anyone trying to dip their toes in the BizTalk pond. BizTalk is a great tool and has many different uses. The example that I will present is based on my work at the Dept. of Corrections. This example will be broken out into 4 different parts, each describing a part of BizTalk that everyone will basically use when building a project of this kind. This example will cover Schemas, Mapping, Consuming an WCF Service through a Orchestration and Deploying a project to the Admin Console. This example takes in consideration that you are familiar with BizTalk components.

Background

OK, as part of DOC's ongoing enterprise integration strategy to use a common mechanism to communicate among all the internal application and external 3rd party vendors, we need to come up with a common way to get information about offenders to our partners that was easy to understand, as well as easy to implement internally. After a lot of analysis and some Bing searches, we came up with a collection of commonly used elements that described an offender. This schema was called... wait for it, Common Offender or CO. CO is based on a Dept of Justice standard called National Information Exchange Model (NIEM). NIEM is a Federal, State, Local and Tribal inter-agency initiative providing a foundation for seamless information exchange. It leverages the data exchange standards through XML schemas implemented by the Global Justice Information Sharing Initiative (Global) and extends the Global Justice XML Data Model (GJXDM).

After we stabilized CO, our first test with it was to integrate our Partner Pharmacy Services to our OMS (Offender Management System). The requirement was to send all offender information to the partner, if the offender was a new intake, being transfer to another institutions or being released. Now that we have to background out of the way, let's start the example.

Setting up your environment

The first thing we need to do is setup our environment. You will need to install the BizTalk 2010 development components from the DVD onto your development PC. After the install is complete, I highly recommend that you install the BizTalk Software Factory. This example will use the software factory. I usually like software factories because it will define your project by best practices. Don't forget you will need a BizTalk development server. OK, let's design the schema.

Design Common Offender Schema

Remember, creating a schema is defining a structure of the data, it is very similar to creating a table in database. Designing schema plays a vital role in Integration projects. I will now walk you through the Common Offender Schema design in BizTalk 2010.

Common Offender Example

To give you a more in depth look at Common Offender, take a look below at the base example.

<ns0:Offender xmlns:ns0=https://Doc.Schemas.CommonOffender/2011/2>
  <DocType>100</DocType>
  <LastUpdatedDate>3/1/2011</LastUpdatedDate>
  <PersonSurName>Spinella</PersonSurName>
  <PersonGivenName>John</PersonGivenName>
  <PersonMiddleName>Robert</PersonMiddleName>
  <PersonSuffixName></PersonSuffixName>
  <DOCnumber>55458547</DOCnumber>
  <PersonDigitalImage></PersonDigitalImage>
  <PersonName>
    <PersonAlternateName>
      <PersonNameType></PersonNameType>
      <PersonFullName>John R. Spinella</PersonFullName>
    </PersonAlternateName>
  </PersonName>
  <BirthDates>
    <EventDate>
      <BirthType></BirthType>
      <PersonBirthDate>11/30/1972</PersonBirthDate>
      <PersonAgeMeasure>38</PersonAgeMeasure>
    </EventDate>
  </BirthDates>
  <SubjectStatus>
    <reportingOrganizationText>Red Onion</reportingOrganizationText>
    <EarliestReleaseDate></EarliestReleaseDate>
    <Status>In-Custody</Status>
    <StatusDate>3/1/2011</StatusDate>
    <Location>
      <LocationName>Red Onion</LocationName>
      <Unit>E</Unit>
      <Wing>4</Wing>
      <Room>223</Room>
      <Bed>4</Bed>
    </Location>
  </SubjectStatus>
  <PersonPhysicalDetails>
    <PersonEyeColorText>Brown</PersonEyeColorText>
    <PersonHairColorText>Black</PersonHairColorText>
    <PersonHeightMeasure>5'8"</PersonHeightMeasure>
    <PersonWeightMeasure>192</PersonWeightMeasure>
    <PersonSexText>Male</PersonSexText>
    <PersonRaceText>White</PersonRaceText>
  </PersonPhysicalDetails>
  <Convictions/>
  <LocationHistory/>
  <DisciplinaryReports/>
</ns0:Offender>

DocType Explanation
100 This is the initial state of a CO, which is processed by the Intake.
101 This is the second state of a CO, which is processed by the Transfer.
102 This is the last state of a CO, which is processed by the Released.

As you can see, the schema is broken down into distinct parts describing the offender. Each describing a part of the offender identity. I do not include gang information in this schema but you can extend this schema very easily to meet any part of your business. You see that I use a internal variable through the schema. I went down this route because we were going for a routing mechanism based on the Message Broker pattern.

Next part in the series will be showing you how to match up the Common Offender schema to destination schemas in the BTS Mapper.  I will also include code in the next post.

Happing Coding

John