in

wWorkflow.net

Erik Westermann, Komplett Systems test

dispatches

Erik Westermann's blog about BizTalk, Commerce Server, Integration, Writing (technical and otherwise). All content is Copyright, 2008, Erik Westermann. Permission required to duplicate. Citations appreciated.

June 2008 - Posts

  • Why BizTalk?

    Overview

    In my article "BizTalk Server In 47 Words or Less" described BizTalk Server is a versatile platform for building business process automation and integration solutions. While articles that explain BizTalk or describe how to do something with it are great, they assume that you have already made the decision to use BizTalk Server in your project or organization. This article discusses integration, its benefits, and how BizTalk Sever can help you exploit those benefits.

    Integration and Connected Systems


    Today's demanding business environment changes quickly based on consumer demand and opinion, new technologies, and economic conditions. Environmental changes and political events can also play a key role in a business's ability to continue to operate and succeed. As a result, succeeding in today's environment is based on one key factor: an organization's ability to adapt to often rapidly changing conditions.

    The web-centric nature of most communications makes paper-based systems supported by fax, phone, or email slow, inefficient, and - more importantly - incompatible with most business' customers and suppliers. Businesses that serve end-users, or consumers, are finding that their customers demand fast and easy access to information and services using devices like computers and mobile phones.

    Expanding your team? Want to ensure candidates have the skills you need? Want to make sure your assessment of a candidate is right? We can conduct a technical inteview or review a resume - even evaluate the result of your technical testing.


    Contact Erik Westermann for more information (+1 416-809-1453).

    Businesses must shift from manual to automated trading supported by broadly used communications methods and formats to remain competitive and responsive to their trading partners and end users. Automated trading drives the need to interconnect systems, information, and processes; effective and efficient automated trading relies on integration.

    Integration blends applications and data, via communication, to enable sharing of information between applications within a company and between businesses. Integrated applications are also flexible enough to adapt to changing business needs because they are often loosely coupled (don't directly rely on each other).  The phrase "connected systems" describes integrated applications that communicate using standardized, broadly available and broadly used methods and formats.

    Connected systems drive business process automation because business processes represent the beginning and end-points of intra and inter-business (or application) communications. An example of business process automation is linking an organization's Customer Relationship Management (CRM) system with it's Order system: the order system supports transactions and handles the lifecycle of an order, while the CRM system manages customer relationships by maintaining, for example, the details about historical contact (date of last order, support tickets, emails, etc).

    Rudimentary Adoption of Connected Systems

    While many may lead you to believe that integration is difficult to achieve, it is actually relatively easy. Start with an idea about the kind of functionality and information you want to make available for your customers and trading partners (suppliers). Conceptually draw lines between your existing applications and islands of information to surface information and perhaps add new applications or systems to provide functionality to your clients and trading partners. At the end of this process you end up with a framework for your integration project.

    Taking a short-term approach, you could engage a team of developers to connect your existing applications by creating new custom applications. The overall approach could be to buy a new server that you use to develop and host the new custom applications.  This approach results in a ‘good-enough' solution that meets yours, your client's, and trading partner's current needs.

    The new applications that connect your existing ones increase the complexity of your IT infrastructure. The number of inter-connections between applications grows rapidly as you add new applications to remain responsive and competitive. The complexity of your IT infrastructure drives up on-going maintenance costs since you'll require staff with specialized skills to minimize on-going development costs to add features like better reliability, scalability, security, and compliance with the United States' Sarbanes-Oxley Act (SOX) and its Canadian equivalent, the Multi Instrument 52-109 rules.

    A Better Approach

    The rudimentary approach to adopting integrated, connected systems clearly focuses on short-term needs. A better approach integrate other software throughout the business, both within and between organizations based on broadly available frameworks, platforms, communications methods, and data formats. The benefits of this approach include:

    • Better agility - automated business processes are easier to maintain since they don't require a specialized IT skill set - resulting in faster time-to-market; broadly available technologies advance with current market needs like compliance, reliability and performance.
    • Better alignment with Customer and Trading Partners' needs - as a result of faster time-to-market your organization can efficiently deliver solutions that meet your customers and trading partners' needs without significant lead times.
    • Lower IT costs - using broadly available frameworks, platforms, and communications methods makes it possible to use readily available hardware, software, and - possibly more importantly - hire/use readily available, skilled developers and consultants

    Organizations that efficiently adapt to changing conditions through better agility and better alignment with their customers' and trading partners' needs remain profitable and competitive. Business models drive profitability and competitiveness.

    Connected Systems Simplified

    Simplification and consistency are at the center of realizing efficiency and agility. Taking an abstract view, connected systems have three main functions:

    Function

    Description

    Workflow

    Workflow is a representation of a business process. The checkout process when you buy something is an example of a simple workflow.

    Communications

    Communications connect the workflow with outside entities like other applications, people, and your trading partners.

    Messaging

    Messaging represents the content that gets communicated between systems. Message traits like format, importance, and sensitivity can affect message content.

    The following diagram describes the functions in the context of an order system:

    The figure shows a customer placing an order (the web-based order system is not shown). The order system generates a message and sends it to your organization via the internet. Your system processes the message by acquiring more information about the customer, completes the order (perhaps process the credit card transaction), and then updates an inventory system and supplier. Each function gets handled on its own thereby making it possible to maintain it on its own (and make it more efficient).

    BizTalk Server provides excellent support for process agility by making it easier to express business processes based on the three preceding, essential functions. I am not suggesting that BizTalk Server solves all business process and integration problems; however, it can play a key role in alleviating problems.

    Deciding to Use BizTalk and BizTalk's Influence

    While enterprise architects usually consider and recommend using BizTalk, business users (stakeholders) sometimes recommend using BizTalk after consulting with outside subject matter experts and other consultants. As introduced in the preceding sections, Business users' interests in using BizTalk are based on attempting to better position their organization to control development and ongoing maintenance costs while improving process agility because BizTalk, as a platform, makes it easier to deliver process and integration solutions.

    BizTalk Server makes it easier to deliver process and integration solutions because it narrows down the field of possible design implementation approaches, based on the three major functions of connected systems (workflow, communications, and messaging). Among the reasons that BizTalk makes it easier to deliver process and integration solutions is its declarative programming model. The declarative programming model makes it easier to express workflows in terms of the underlying business process thus lowering the risk of misinterpreting the process during implementation.

    BizTalk provides a range of other services besides a declarative programming model. Some of BizTalk's major features include:

    • Adapter-based communications.
    • Strong support for transformations.
    • Support for effectively unlimited types of data through transformations and pipelines.
    • Durable messaging using the proven publish-subscribe model.
    • Highly scalable and customizable performance model.
    • Flexible and direct support for deployment.
    • A Business Rules Engine that supports versioning, in-flight change, and is very scalable.
    • Business Activity Monitoring that surfaces business information at run-time (for example, number of new orders per hour).
    • Integration with a broad range of security architectures.
    • Broad industry support through a strong, focused developer community, subject matter experts, consulting houses, and independent consultants.

    BizTalk also supports the popular "learn while being productive" paradigm. It's possible to read a book or the review product documentation and work through the SDK samples, and learn about BizTalk while creating simple solutions. Note that this approach (learn while being productive) works well for simple solutions and some prototypes.

    A functioning, supportable solution still requires a solid architecture, design, and implementation. If you learn about BizTalk Server, create a solution, and decide to use your work by putting into productive use, I highly recommend that you have the architecture, design, implementation, and deployment reviewed by an experienced consultant, consulting firm, or staff member. Mistakes can be costly to find and repair once the solution is in use. And, as with any other tool, when it is used in the right way and for the right purpose, the only limitation is imagination.

    Conclusion

    Today's fast-paced, web-centric customers and trading partners demand a connected systems approach. BizTalk Server, when used for the right applications and in the right way, helps agile businesses realize efficiencies and meet their clients' and trading partners' needs and demands. BizTalk supports the popular "learn while being productive" paradigm. However, consultants and consulting firms have developed business process integration skill-sets and service offerings to help organizations of any size realize the benefits of connected systems even more efficiently.

     

    Posted Jun 27 2008, 08:58 PM by Erik with no comments
    Filed under:
  • Hello, MacBook Pro

    I own(ed) a Dell notebook. Lots of memory, lots of disk space, lots of processing power, and an nVidia graphics card.

    I bought the Dell notebook last year and it is now slowly dyeing. The display is fuzzy - it comes and goes and, no, it is not the driver. The hard drive is developing bad sectors - a few more each day. Time for something new.

    Like most people, I value my money and it's obvious that the Dell notebook was not a wise choice, since I am out more that $2,000 and without a functioning notebook - or warranty. Having experienced their customer service, or lack thereof, I took this opportunity to do something about it and do something different.

    I researched the usual notebook vendors - Toshiba ad HP (I don't consider others because I need something reliable). Both companies have great notebooks but all their current models are lacking in one way or another.

    The MacBook Pro caught my eye - I know two people that have them and are very happy with them. So, I took the plunge and am now a happy owner of a MacBook Pro.

    I am using  the MacBook Pro as my primary development platform, thanks to VMWare's Fusion. If you have tried VMWare on windows, you'll be familiar with how sluggish and hot Windows-based most systems become (unless you happen to be carrying around a handful of processors and several feet of memory).

    I ported my primary Windows XP development system to a virtual machine using VMWare's free Converter - it takes a snapshot of a physical system and creates a VMWare image. I copied the resulting files to the MacBook Pro and started the VM using VMWare Fusion. I was up and running in less time than it takes to boot the original, physical, XP-based system!

    VMWare has a feature called Unity. If you are used to running a virtual machine on Windows, you have not seen anything like VMWare Fusion's Unity. Unity tightly integrates the VM into Leopard to the point where you can start something like Word or Visual Studio and have it running in another window - right next to regular Mac apps (as in, not running in a virtual machine window)!

    If you are having trouble imaging what this looks like, check this video:

    http://www.youtube.com/watch?v=JIApJMzGzDQ

    So far, my MacBook Pro worked from the moment I started it, it's fast, graphics are great, and I am wondering why I even second-guessed myself before I bought it.

    Posted Jun 20 2008, 07:47 PM by Erik with no comments
    Filed under: ,
  • Sandcastle - Get It Working

    I started using Microsoft's Sandcastle earlier today. Sandcastle generates HTML and, ultimately, CHM (compile help) files so that you can create documentation for your solutions. The resulting output looks is in the well-known MSDN style.

    Sandcastle, Microsoft's successor to the popular NDoc, generates documentation based on comments developers put into their code. Sandcastle is smart enough to extract summaries, remarks, and a lot of other information from source code. The output it generates could be a great starting point for more complete documentation (or complete documentation if the comments in your code are that complete).

    Sandcastle uses HTML help, so integrating it is relatively easy, and I assume that you could put your documentation online, since it also generates HTML source files for you.

    After downloading Sandcastle I looked through an article that describes how to create your first CHM. Completing the 12 steps is relatively straight-forward - you just need to keep your paths straight.

    As nice as it is to test, I had work to do, so I tried to apply the steps to an existing project. As with most new software, Sandcastle is hiding a few secrets from us so your chances of actually getting this to work are relatively small.

    Expanding your team? Want to ensure candidates have the skills you need? Want to make sure your assessment of a candidate is right? We can conduct a technical inteview or review a resume - even evaluate the result of your technical testing.


    Contact Erik Westermann for more information (+1 416-809-1453).

    (By the way, I tried DocProject and finally gave up on it. DocProject attempts to make Sandcastle easy - I think it actually works on only a few of the world's PCs)

    After much experimenting, I managed to get it to work. My solution correctly extracts summaries, parameter documentation, and remarks - other techniques I tried did not extract this information.

    I won't bore you with the painful details about how my solution works. I will tell you that you can get a copy here and that the output is an HTML Help project - use HTML Help 1.x to compile into documentation bliss.

    Use the batch program as follows:

    wWorkflow_Sandcastle YourAssembly.dll

    Do this after you copy your assembly's dependent DLLs into the same folder as your assembly - everything needs to be in one folder (there is a reason for this - fortunately I am not part of that reason).

    If everything works, after a few minutes you will find a file called "test.hhp" in the Output folder. Double-click that file and select File - Compile. You should be able to open your compiled Help file when it is finished compiling.

    One key finding is that the comments XML file that the compiler produces must be called ‘comments.xml' - it's also interesting that the output CHM file is test.chm and I was not able to change it. I assume that the file names are somewhere in a configuration or XSL file - I'll leave that for someone more patient to find :)

    Posted Jun 18 2008, 08:29 PM by Erik with no comments
    Filed under:
  • Loosing Weight: Trial & Error - Trial Wins

    This is a non-technical, personal post.

    I knew, about two years ago, that I was overweight. I have never had issues with being overweight - in fact, I was often underweight until about the age of 20 - instead of dieting to loose weight, I often had to be in a diet to gain weight.

    Things changed and I ended up on the opposite side of the fence and found myself about 60 pounds overweight. At the time, my doctor mentioned my weight during my regular visits and check-ups. My family mentioned that I was looking a little heavy (an understatement), and friends said that I was showing signs of prosperity (meaning, I had the ‘good fortune' of being in a position to eat too much).

    I went on a self-imposed diet that started in November and ended in April:

    • I lost 55 pounds (the last 5-10 pounds are still hanging on)
    • 18 months after the end of my diet, I have not gained even one pound
    • My diet spanned three birthdays (including mine) and Christmas
    • If it not obvious enough, my diet was in the winter (it is not easy to diet in the winter)
    • The spring and summer of 2007 were great!

    Here is my diet story:

    Consulting with various BMI calculators and reading a lot of health-related articles confirmed that I weighed too much. As is typical of people my age, I do not exercise enough, work a lot, and eat too much for my lifestyle. The situation is more interesting because I am a vegetarian (I became a vegetarian about 15 years ago). Being vegetarian has its issues, but too much fat in my diet was not one of them - so I felt that I was better off than most overweight people I know since the source of extra calories was likely not from the food I ate during meals.

    Like many others, I tried several times to loose weight. I started out stupid, so to speak, since I had no idea where to start. Obviously I had to lower my daily caloric intake, but had no idea how to do that effectively enough to loose weight. I ate less for about two months and did not loose any weight at all. The good news is that I did not gain weight, so I was at least going in the right direction.

    Motivated by being able to sustain my weight, I started to research various diets and other weight-loss methods. Although exercise is a core component of any weight loss program, I knew I would not be able to get in enough exercise to be able to make a significant difference while I was trying to loose weight.

    I want to make it clear that I did not ignore the effect of exercise. I knew I wanted to loose weight during a period of about 4-6 months and also knew that I would not be able to add new activities to my day-to-day life. I did, however, make more conscious efforts to walk more, take the stairs instead of the elevator, and work more around my home (gardening, heavy cleaning, repairs etc).

    As a result of my research I found -

    • The average adult caloric intake is 2,000 calories per day
    • A diet is considered to be healthy when the goal is to loose 1-2 pounds per week
    • At my activity level, 1,500 calories per day could result in meeting the weekly goal of 1-2 days pounds per week

    Technically, there are reasons for weekly goal of loosing 1-2 pounds per week; however, I was not convinced psychologically. More research followed but the consensus was demotivatingly the same everywhere.  A simple idea fortunately convinced me and, fortunately, restored some of my motivation:

    It took a long time to gain weight, so it might take a long time to loose the weight.

    I wanted to do something to get started, so I came up with a short-term plan:

    • Learn about the number of calories I am consuming daily.
    • Learn about foods that can help me loose weight.
    • Learn about techniques that can help me loose weight.

    I found I was consuming about 3,000 to 5,000 calories on an average day. The extra calories (those that put me above 2,000 per day) came from bread (170 calories per slice), cheese (about 90-120 calories per serving - and I often had multiple servings), snacks (easily in the neighborhood of 300 calories per serving), and soft drinks (roughly 120-180 calories per 250ml - depending on which I consumed of course).

    So now I know I can make some small changes that could have a significant effect, over the long term, on my diet. Super!

    Next, I had to find foods that could help me loose weight yet provide good nutritional value (I was particular about this since I previously had issues with the absence of iron and certain vitamins in my diet). I found a brand of bread (Hollywood Bread) and another brand of cheese that have just 30 calories per slice each - great!

    I also learned that, in my case, consuming things relatively high in protein can help to reduce hunger. I found this be experimenting with the things I ate and being aware of how hungry I felt at different times of the day. It took about a week to figure it out.

    I focused on looking for foods that had a high ration of protein to calories. I allow eggs in my diet, so egg whites were perfect. An egg has about 90 calories - a similar quantity of egg whites has just 30 calories (specifically I stuck with a brand called Egg Creations).

    Margarine is one of the seemingly innocuous dietary components that I overlooked. I found and started using one brand of margarine that has about 30 calories per teaspoon - compared to 90 calories for a regular margarine I was happy!

    I also found that my pre-diet lunch was particularly calorie-rich and protein light - I often took instant or canned soups along with bread, or went out to for lunch. I found canned soups that are high in protein (lentil soup is very high) and low in calories. I also decided to introduce fish into my vegetarian diet since tuna is also high in protein and relatively low in calories. I used a fat free mayonnaise to make a really simple tuna salad.

    I am accustomed to snacking, from my days of having to gain weight, and felt that my morale would be higher if I could continue to eat something at odd times of the day. I found that rice cakes worked well for me - each has just 40 calories. Fat free yogurts and puddings were treats and helped my morale a great deal. Later, towards the end of my diet, I replaced rice cakes with a sports bar (200 calories but has about 20 grams of protein - the sports bar easily held me over to dinner).

    As for soft drinks, I avoided those completely - even diet soft drinks. I did this more for psychological reasons - it was easier for me to maintain my diet knowing that one day I would be able to drink soft drinks again - when I don't have to count their calories. Near the end of my diet, when things where tasting really flat and boring (since I ate roughly the same thing everyday), I added about 1/8 (maybe 1/10) of a cup of a soft drink to a cup of water - although heavily diluted, it was a nice treat and broke the monotony.

    Finally, I found that the following techniques worked well for me:

    • Drink about 2 liters of water per day
    • Drink one cup of water for each cup of coffee
    • Take vitamin B - specifically a type of vitamin B-12 that dissolves under tongue

    It's known that drinking water satiates appetite, so that's a simple change (after you get used to it, it is really not bad - in fact, I found that I feel so much better when I drink enough). Coffee is a diuretic, so drinking another cup of water for each cup of coffee makes sense. The last point, vitamin B was very helpful.

    Vitamin B - specifically B12 - boosts metabolic rate, so it is a relatively easy way of inducing yourself to burn more calories throughout the day. As with everything, there are risks with this - it affects anxiety, sleep patterns, and a variety of other areas if you are not careful - but if you can get it to work for you then this is a big plus.

    So, armed with this, I started my diet. I tracked my progress and ended up with something like this in terms of weight loss:

    • Week 1: 5 pounds
    • Week 2: 5 pounds
    • Week 3: 3 pounds
    • Week 4: 4 pounds
    • Etc

    The initial weeks' weight loss is typical since there's a significant dietary change. Weeks three and four established the pattern for the rest of my diet - sometimes double the weekly goal even though I was at 1,500 calories per day.

    I tracked calories my keeping track of the things I ate, looked up the calories and took a total at the end of the day. I counted calories for about 6 weeks - enough time to get a good idea of my daily intake and increase my awareness of my intake.

    I should note that I know for a fact that my net daily caloric intake often dipped to as low as 850 calories. My intake was so low because I simply was not hungry enough to eat. I have a tendency to forget to eat when I am not hungry, so I sometimes simply forgot to have diner or lunch. The day after dipping so low was just like any other day - I did not compensate the next day.

    I also got into the habit of ‘trading calories' - even though I finished my diet about 18 months ago, I still do this. When I trade calories, I allow myself a treat or meal that is relatively high in calories and trade that for other calories later.

    For example, I enjoy certain snacks from a local coffee shop. When I have one or two of the snacks (which are easily in the neighborhood of 300 calories each), I trade those calories by having a calorie reduced breakfast and lunch. My goal is to keep my daily intake to within 2,000 calories and about 35 grams of protein, so this approach works well for me.

    As for exercise, I occasionally go cycling but my day to day activities make more of a difference. I commute by public transit - so I choose to stand most of the time, I take the stairs when possible, go for brisk walks (I try to walk after work  - about 3km), and work more around my home.

    So, in the end, I was on a diet for about six months and lost 55 pounds and have kept it off for 18 months. The diet caused lifestyle changes - I still prefer fat free yogurt, low calorie snacks, and my daily lunch is surprisingly small - I also check most nutrition labels and choose low calorie, high protein foods. The tradeoff is that I eat ‘regular' foods for breakfast and dinner, I can enjoy snacks like cookies, chocolate and ice cream in moderation, and I feel great!

    One last note: I am still trying to loose the last persistent 5-10 pounds, but I am not too concerned about them. My weight fluctuates within that 5-10 pound range, so I am happy.

  • Understanding BTS - Consolidated and Lots of Views

    I have consolidated all of the articles to date in the Learning BizTalk Series in one article at CodeProject! It is one large article containing the same great content you have come to enjoy from the series here.

    I wanted to make the article more broadly available and put everything that I have so far into one place. There series is continuing here and at CodeProject - you'll see it here first, of course :)

    So far the article has enjoyed more than 700 views since it was published two days ago. To put it into perspective, the most popular article in this series has been Understanding the Publish-Subscribe Model - it toped 700 views in about 7 days - the CodeProject artice did that in two -- not bad!

    Architectural reviews, project assessment, Proof of Concepts, and technical and end-user documentation. Just a few of the remote services that Komplett Systems offers. Contact Erik Westermann for more information (+1 416-809-1453). 

    Thank you for helping make these articles a success!

    Posted Jun 14 2008, 04:03 PM by Erik with no comments
    Filed under:
  • Demonstrating Publish-Subscribe - Part 1 of 3

    My previous post about Understanding The BizTalk Publish-Subscribe Model has been a huge success! That article has had the largest number of visits by users and search engines that I have seen on this site - thank you for helping to make the article so popular!

    As always, I am interested in your feedback. Contact me using the Contact link, rate the article, or link to my article(s).

    This post continues the series about getting to know BizTalk Server by providing a downloadable sample and walkthrough. This is the first of three samples that support the series. If you have not read the previous articles, here they are in order:

     

    1. Understanding BizTalk Declarative Programming
    2. Understanding Type-Safety
    3. Understanding the Publish-Subscribe Model
    4. Understanding BizTalk's Extensibility

     

    Fist, a commercial break:

    Get One Month Free Windows 2003 Server Hosting with just 10 hours prepaid consulting! This is a Windows 2003 Server with IIS, ASP.NET and the .NET Framework - you get complete control and can get your solution running Fast! Certain limitations apply - contact Erik Westermann at +1 416-809-1453 for details.

    A classic sample BizTalk application demonstrates the orchestration engine because the orchestration designer is interesting to look at and makes it easy to understand how the solution works. Since BizTalk is so flexible Other, less obvious, approaches are possible too and these less obvious approaches offer more features over the simpler ones.

    One classic example of a solution built using message-oriented system like BizTalk is content based routing. Content based routing (CBR) inspects a message for certain content (perhaps a specific value in a certain field) and routes the message to one out of possibly several destinations. CBR is like a C# ‘switch' statement: execute a particular case clause based on the result of evaluating the condition in the ‘switch' statement.

    The sample application that I'll demonstrate looks like this:

    This sample demonstrates several core features:

    • Declarative programming
    • Type safety
    • Publish-subscribe

    The idea is simple: Accept a message, transform the message into another type, and send the message a destination based on the value in the RouteTo field.

    There are three variations of the sample:

    • Transform and Route using an orchestration (I demonstrate this technique here)
    • Transform at the Receive Port and, using an orchestration, route to the destination
    • Without orchestrations - accept a non-routable message, transform, and route

    All three solutions demonstrate BizTalk's publish-subscribe model; however, the last version (the one that does not use orchestrations) highlights publish-subscribe since it is based purely on port configurations (that are backed by BizTalk's publish-subscribe model).

    Architectural reviews, project assessment, Proof of Concepts, and technical and end-user documentation. Just a few of the remote services that Komplett Systems offers. Contact Erik Westermann for more information (+1 416-809-1453). 

    I'll walk you through the solution first - skip to the Installation and Use section if you are impatient.

    The demonstration begins by accepting a specific type of message (XML instance document), transforms the message into another type, inspects the message, and decides where to send the new message (the message can end up in one out of two places).

    A sample of the input message type is:

    <ns0:CbrSampleMain xmlns:ns0="http://BizTalkSample_CbrMain_wWorkflow...">

      <Destination>A</Destination>

    </ns0:CbrSampleMain>

    Based on what you have learned so far, the input message's type is: http://BizTalkSample_CbrMain_wWorkflow...#CbrSampleMain (combination of namespace and name of the root node). You trigger processing by copying one of the sample files into the FileDrops\Inbound folder. The File adapter reads the contents of the file and passes it onto a pipeline. The pipeline confirms that the file contains a message type that our solution can accept and forwards it to the logical port called receiveMainInboundPort.

    The logical port serves as binding point for an adapter like the File adapter. You could change the adapter to MSMQ without having to change or redeploy the solution.

    The receive shape, rcvMainInbound triggers the orchestration because it is an Activating receive. The shape that follows is Construct Message which in turn contains a Transform shape. The Construct Message shape tells BizTalk that the orchestration is creating a new message type using the shape(s) that it contains. BizTalk ensures, at compile time, that the orchestration does in fact create the message type it declares.

    The Transform shape invokes a Map (which is really a compiled version of an XSL) that transforms the original message into a new format. The new format has a structure that is similar to the original message, except that the names of the nodes and namespace have changed:

    <ns0:CbrSampleMainRoutable xmlns:ns0=" http://wWorkflow.net/Samples/Schemas">

      <RouteTo>A</RouteTo>

    </ns0:CbrSampleMainRoutable >

    A Decide shape follows - its role is to route the new message to one of two places. If the RouteTo node contains "A", the message gets delivered to the sndDestA Send shape, otherwise the message gets delivered to the sndDestB Send shape. Each Send shape is bound to its own logical send port. Each Send port is bound to a send Port that uses the File adapter to deliver its message to its output folder within the FileDrops folder.

    The Decide shape inspects the value of the RouteTo field using an alias or synonym which is referred to as a Promoted Property. A promoted Property is a special kind of alias used to describe a location in an XML document (known as an XPath statement). There is another type of alias called a Distinguished Field that behaves in a seemingly way to a Promoted Property (there is a significant difference though). You are not limited to using these aliases to inspect values in an XML document - you could use the BizTalk xpath function to check the value.

    Code reviews, developer training and more! Get your project on track today - contact Erik Westermann today (+1 416-809-1453 or click the Contact link)

    If you wanted to use the xpath function, the call would look something like this:

    testValue = xpath(Inbound,"string(/*[local-name()='RoutableMessageSimple' and namespace-uri()='http://wWorkflow.net/Samples/Schema']/*[local-name()='RouteTo' and namespace-uri()='']/)");

    I think the expression in the decide shape (which uses the Promoted Property) is easier to read:

    Outbound(BizTalkSample_CbrMain_wWorkflow.PropertySchema.RouteTo) == "A"

    One thing you might have noticed is that the orchestration does not validate the input message - so what happens when you send the wrong type of file to the orchestration?

    BizTalk will only activate the orchestration when the correct type of message appears at the receive location. BizTalk reads all files that appear in the Inbound folder but sends only valid files to the orchestration. A valid file is one that contains an XML document that has the type http://BizTalkSample_CbrMain_wWorkflow...#CbrSampleMain message type. XML documents that are not of the correct type get consumed and end up being deleted - BizTalk also logs an error in the Application Event Log.

    Installing and Using the Sample

    Installation is simple. I assume the following:

    • Your system's main drive is drive C
    • You have BizTalk Server 2006 installed on your system (local)
    • BizTalk Server 2006 works
    • You have Visual Studio 2005 installed and working

    Your system is ready if you have successfully worked with the BizTalk SDK samples or some BizTalk labs on your system. If you have not done either of these things, try the BizTalk SDK Sample called HelloWorld - you are in great shape if that sample works without changing anything.

    1. Download and unzip this file to your system's C:\ folder. The unzip process creates a new folder called C:\Samples\wWorkflow.

    2. Using a Visual Studio Command prompt, navigate to the solution folder by typing the following command:

    cd C:\samples\wWorkflow\BizTalkSample-CbrMain-wWorkflow

    3. Now type the following command to setup and start the solution:

    Setup <enter>

    4. You'll see a lot of messages scrolling by - inspect the output for errors.

    The solution will be running if everything went well.

    5. The BizTalkSample-CbrMain-wWorkflow\FileDrops folder contains two sample files (the both begin with "NonRoutableMessage"). Copy (be careful not to Move) one of the files to the Inbound folder.

    BizTalk should pickup the file within a minute, and a new file should appear in the DestinationA or DestinationB folder (depending on which file you copied).

    If the solution does not work, or you are impatient, you can read through a sample output file by opening RoutableMessage-Main_output.xml.

    Remove the solution by doing the following:

    1. Click the following on your Start menu:


    Start - All Programs - Microsoft BizTalk Server 2006 - BizTalk Server Administration

    2. Open the BizTalk Server 2006 Administration Folder

    3. Open the BizTalk Group folder

    4. Open the Applications folder

    5. Find the CbrSampleMain folder and right-click it

    6. Select Stop

    7. Select Full Stop from three options

    8. Click Stop

    9. Using a Visual Studio Command prompt, navigate to the solution folder by typing the following command:

    cd C:\samples\wWorkflow\BizTalkSample-CbrMain-wWorkflow

    10. Now type the following command to setup and start the solution:

    Cleanup <enter>

    You should not see any messages in red. If you do, try steps five to ten again.

    The next article in this series will demonstrate the same type of solution; however, it will push transformation of the inbound message to the Receive Port so that the orchestration only works with the routable message type. The final version removes the orchestration comlpetely - instead relying only on port configuration.

    As always, I am interested in your feedback. Contact me using the Contact link, rate the article, or link to my article(s).

     

    Posted Jun 10 2008, 11:13 PM by Erik with no comments
    Filed under:
  • Path to Clarity - Via Stupidity?

    After many years of reading strictly technical books, magazines, and other articles I am turning my attention to non-technical books and essays. Specifically, great authors like Fyodor Dostoyevsky.

    I am reading a few books concurrently because, while it is a pleasure to read Dostoyevsky, I feel I need to clear my mind for him to appreciate the details and nuances in his writing. It's a nice break to switch to something "lighter" (if you can call it that - I am reading Orhan Pamuk, and C.S. Lewis) so that I can maintain my focus.

    I am primarily reading Dostoyevsky's "The Brothers Karamazov" - a rich, engaging, and inviting story about a family that includes three bothers and their father. Many passages have a clarity that is completely absent from technical writing. One such passage stands out is about stupidity. The passage describes stupidity in the sense of simply not knowing - not a derogatory sense at all. Here is the passage:

    "...the greater the stupidity, the closer to the matter at hand. The greater the stupidity, the greater the clarity. Stupidity is brief and guideless, while wit equivocates and hides. Wit is a scoundrel, while stupidity is honest and sincere."

    The three sentences really permeate into the nuances of what it means to be stupid - in other words, the simple absence of knowledge without excuses.

    Often our own prejudices (preconceptions or mental models) stand in the way of our ability to clearly realize understanding. It often takes a lot of time to gain the perspective necessary to not only realize what's happening, but also shed our preconceptions. My takeaway from this - step back, look at something new with little context for a while and see it for what it is.

More Posts
Powered by Community Server (Non-Commercial Edition), by Telligent Systems