How to achieve parallel processing in BizTalk Orchestration

Problem

The requirement is very straight , I need to start/execute two sub processes or BizTalk Orchestrations in parallel. Then wait for the response from each orchestration, and then proceed to end. If there is a sequence diagram it would be something

 image

Solution

The first thing which came into my mind is using parallel shape in BizTalk , but they do not start or execute two processes in parallel , Its a common mistake, there is a blog post The parallel shape DOES NOT give you concurrent parallel processing – a common mistake.

Also there is a very good blog post How Parallel Shape works , this is a very good read and explained in much detail about execution of parallel shape.

The solution was to use parallel shape to start two Orchestrations at same time and use ports to pass the response back from the child orchestrations back to the main orchestration.

Using parallel shape with self correlating ports and start orchestration

In Summary

In summary the solution looks like below

  • Main Orchestration Uses a parallel shape to starts two sub orchestrations
  • Main orchestration has two ports for each sub orchestrations to pass back the response. The Post gets passed as parameter in start orchestration shape

 image

  • the port has following setting

image

  • In summary the main orchestration looks like below

image

  • I have used some trace entries in both sub orchestrations so when they starts following comes in the trace

image

both the sub process gets started almost same timestamp .

Hope this helps to someone.

There is more to read

  1. How to Use Self-Correlating Direct Bound Ports

  2. Enterprise Integration Patterns Part-1 – Scatter and Gather using Self Correlating Port

BizTalk 2013 Installation & Configuration Steps

Quick Steps

Software Required

Below are software required to build a stand alone BizTalk 2013 beta developer/runtime server machine

  1. SQL 2008 SP1-http://www.microsoft.com/en-us/download/details.aspx?id=20302
  2. BizTalk 2013 Beta – http://www.microsoft.com/en-gb/download/details.aspx?id=35553
  3. VS 2012 Trial – Professional Edition –http://www.microsoft.com/visualstudio/eng/downloads
  4. SQL 20082 R2 Trial –http://www.microsoft.com/en-gb/download/details.aspx?id=6362
  5. SQL 2008  R2 SP1 –http://www.microsoft.com/en-us/download/details.aspx?id=26727
  6. Windows 2012 Trial –http://www.microsoft.com/en-us/server-cloud/windows-server/trial.aspx

    Installation Steps

Before installing BizTalk it is required to install following software’s on the machine

    • IIS
    • SQL Server 2008 R2
    • SQL Server 2008 R2 SP1
    • Visual Studio 2012 professional

    After downloading the software click  on the exe and provide a folder location to extract the installation files, Once the files are unzipped, go to the folder and run setup.exe and follow the steps/instructions on screen

image

Click Next

image Click Next

image

Click Next

image

Select the appropriate options and Click Next

image After Next

image

Once the installation finishes following should come

image

Launch the configuration of BizTalk

Configuration Steps

Select Custom Configuration. Provide SQL Server Instance name and Administrator Account details  and follow the steps

Setup SSO

image

Setup BizTalk Group

image

Setup BAM Runtime

 

Setup Business Rule Engine

image

Setup BAM Tools

image

Review Final Configurations and Press Next

imageThe configuration process will try to create the databases at this step and try to configure the BizTalk runtime and service accounts.

image

    There is lot more…

    BizTalk 2013 Beta- By Sarvana Kumar – http://blogs.biztalk360.com/biztalk-server-2013-beta/

BizTalk 2013 Beta Help Page –http://msdn.microsoft.com/en-us/library/jj248691(v=bts.80).aspx

BizTalk Server 2010 Cookbook: Review

Recently I had a chance to review BizTalk Server 2010 Cookbook by Steef-Jan. I really enjoyed reading the book.  I must say,It is well written and covers most of the important areas of BizTalk Server. The Book is equally interesting for Developers/Architects and Administrators.

In my opinion writing a technical book requires a lot of hard work and passion about the techonology, Steef-Jan has done a great job.

Structure

I really like the way the book is organised and my favourite is “There’s more” section. That is the thing which makes the book different. The structure is very nice and basic as:

  • Subject/problem – we first read about a topic or a problem/requirement
  • Getting ready       – then we see how we should get ready for the solution
  • How to do it         – then we see how to resolve the problem
  • How it works       – then we understand the solution
  • There’s more        – and yes there are more things related to our subject/problem/solution etc.
  • See also                 – this gives more information about the topic.

Chapters

  • Chapter 1– You will learn some of the most important things about starting/setting a BizTalk project & environment. Some of them are like
    • Requirement Gathering
    • Creating a solution Design
    • Tools to benchmark BizTalk Server Installation
    • Performance Analysis Tool (PAL)
    • SSO/MSDTC etc
  • Chapter 2– You will learn Patterns in this chapter, standard ways for designing BizTalk solutions. It is Well written with great examples.
  • Chapter 3– This is my favourite, You will learn about instrumentation/logging/tracing/error handling and in-depth about solution deployments.
  • Chapter 4–  You will learn about security and message encryption here. I really enjoyed reading this, it was very much useful for me.
  • Chapter 5–  The BizTalk and all about WCF. the examples are great and the subject is very clear.
  • Chapter 6–  All about BizTalk and AppFabric at one place. This was new for me, So I really enjoyed reading this chapter.
  • Chapter 7–  Very important one and well explained about BizTalk Server monitoring. This is very useful for the BizTalk administrators.
  • Chapter 8–  You will learn about BizTalk and the use of Business Rule Engine in BizTalk Solutions.
  • Chapter 9–  This is again very useful chapter dedicated for testing BizTalk solutions. MapTest framework and BizMock were new for me. I really enjoyed the examples, they were great!

My Conclusion

I would highly recommend this book to anyone who is working/interested or planing to work with BizTalk Server. This book is highly recommended for Developers as well as Administrators and Architects.

There is more

BizTalk Server community is  great! There is already some great review comments available about the Book, See the below list( there is no particular order). I would really recommend you to read them.

Thanks for reading 🙂

Introducing-Naushad Alam by Steef-Jan

Steef-Jan is a very well known person in BizTalk Community. He is BizTalk MVP and author of BizTalk 2010:Cookbook. He has been doing a series of post on “Introducing BizTalk Community Members” since couple of months in his blog.

He has posted an article about our chat on his blog “BizTalk Community series: Introducing Naushad Alam“. I am really happy and its an honor for me.

Thanks a lot Steef-Jan

BizTalk Server: Few basic changes for performance optimization

There are tons of recommendations and guidelines to tune the BizTalk Server to achieve the required performance, however there are few basic and very common things which we always miss while setting up a new environment

I have published a technet wiki article about “BizTalk Server: Tuning and Optimization” however below are few which is very basic and should always be kept in mind IMO.

  • Host Distribution Scheme : There should be a host creation schema for the BizTalk environment, before creating anew host , It is always necessary to decide the right Host Instance Node within a BizTalk group. following should be some basic points while creating a host instance and a new host
       1- Do we really need a new Host?
       2- What about using an existing Host and create a new Host Instance rather.
       3- What is the current load on target BizTalk node , where the new host instance is going to be created
       4- Always maintain a list of Host and they Host instance deployed by application. It will be easy to get the idea
  • Group Level Tracking – Group level tracking should be turned off.
  • BizTalk Database health – It is always necessary to keep an eye of the BizTalk group database server and its Jobs. Make sure the jobs are always running and there are no error in the SQL Agent logs.
  • Dedicated Tracking Host – There should be a dedicated Tracking host for BizTalk group.
  • Log and Data Files- data and log files of the BizTalk SQL server should always be on a separate drive.

Following are my main resources when i am dealing with Performance issues:

  1. General BizTalk Server Optimizations
  2. BizTalk Server: Performance Tuning & Optimization

Thanks for reading!

BizTalk Map using custom XSLT

Problem

There is a requirement to generate output XML based on the attributes of input XML:

Following is my Input xml schema

InputSchema

And our output schema looks like below

outputschema

I have to map the “Property” and its attribute “Name” based on the values and name of the input schema “Branch” record. for each “Branch” in the input there should be one record of the “Location” in the output schema.

For example if below is our input XML :

inputxml

Then my output XML should be like below

outputxml

If you see in the output XML the property and its values are populated on the basis of incoming records in “Branch”.

Solution

I would do following to achieve this requirement, My favorite custom XSLT in BizTalk Maps:

It is very easy to generate a Custom XSLT, BizTalk Map generates the basic code for the schema namespace etc and then we can always modify it.

Steps:

  • Add a new MAP in the BizTalk project
  • Choose the input schema and output schema
  • after this the MAP should look like below:

Map1

  • start mapping the elements and records from input to output. So simple
  • We have to map the value of “Availability” to the value of “Property” and the “Name” attribute should be populated with “Availability” , So I would simply connect “Availability” to “Property” and use a concatenation functoid to assign the attribute “Name” to “Availability” . My map Will look something like below:

map2

  • Now I will generate my basic XSLT code which i will further modify. I will validate the MAP and after the validation I will get the basic XSLT which i will modify.
  • Right Click on the map in the solution explorer and Click “Validate” , Check the Visual Studio output window, there will be a message something like below

map3

  • Open the XSL file highlighted and save that in the BizTalk solution . Now we can modify this XSL file and use in our MAP.
  • to use the XSL file in our MAP we would need to delete all the links which we have done in the above steps and use the “Custom XSLT Path” property of the BizTalk MAP,
  • Delete all the links in the map
  • Open the MAP property and select the path of the XSL file which we have saved earlier.
  • After that my map looks like below:

map4

  • And we can now test the map using our Input.
  • The final XSLT looks like below, which does all the mapping.

<xsl:output omit-xml-declaration=”yes” method=”xml” version=”1.0″ />
<xsl:template match=”/”>
<xsl:apply-templates select=”/s0:QueryInput” />
</xsl:template>
<xsl:template match=”/s0:QueryInput”>
<ns0:QueryResponse>
<xsl:for-each select=”s0:Branch”>
<xsl:variable name=”var:v1″ select=”userCSharp:StringConcat(&quot;OnOrder&quot;)” />
<xsl:variable name=”var:v2″ select=”userCSharp:StringConcat(&quot;ETA&quot;)” />
<xsl:variable name=”var:v3″ select=”userCSharp:StringConcat(&quot;Availability&quot;)” />
<ns0:Location>
<ns0:Name>
<xsl:value-of select=”@Name” />
</ns0:Name>
<ns0:Quantity>
<xsl:value-of select=”s0:Availability/text()” />
</ns0:Quantity>
<ns0:Property>
<xsl:attribute name=”Name”>
<xsl:value-of select=”$var:v3″ />
</xsl:attribute>
<xsl:value-of select=”s0:Availability/text()” />
</ns0:Property>
<ns0:Property>
<xsl:attribute name=”Name”>
<xsl:value-of select=”$var:v1″ />
</xsl:attribute>
<xsl:value-of select=”s0:OnOrder/text()” />
</ns0:Property>
<ns0:Property>
<xsl:attribute name=”Name”>
<xsl:value-of select=”$var:v3″ />
</xsl:attribute>
<xsl:value-of select=”s0:ETA/text()” />
</ns0:Property>
<xsl:value-of select=”./text()” />
</ns0:Location>
</xsl:for-each>
</ns0:QueryResponse>
</xsl:template>
<msxsl:script language=”C#” implements-prefix=”userCSharp”><![CDATA[
public string StringConcat(string param0)
{
return param0;
}

]]></msxsl:script>
</xsl:stylesheet>

Hope it helps!

Thanks for reading!

Windows 8 Beta Download

Windows 8 Beta version for community preview is out,Great Job by Microsoft! It is really amazing, You can download the ISO from here

While downloading the iso , Feel free to watch & enjoy the awesome preview here

Also there is a complete technet page for Windows 8, here, with lots of other options for the product.

Dont forget to see the product details page here .

Go grab it and start playing , Its really awesome!!

Thanks for reading!

New Technet wiki “BizTalk Server:Performance Tuning & Optimization”

In the series of Technet WIki articles , I have published my another article today “BizTalk Server: Performance Tuning & Optimization” It is all about BizTalk Server performance optimization and tuning. The article features following things which might be helpful while working with performance tuning and optimization with BizTalk Server product.

  • Identifying Performance bottlenecks
  • Guide of resolving performance issues
  • MSDN articles and Guide about performance tuning
  • Various articles about optimizing BizTalk server code and solutions
  • Links to various Blog Posts about tuning and optimization

Feel free to read and contribute!!

Thanks for reading!

My New Article on Technet-Microsoft BizTalk Server:ESB Survival Guide

In the series of Technet WIki articles , I have published my another article today “Microsoft BizTalk Server:ESB Survival Guide“. It is all about BizTalk Server and ESB. The article features following things which might be helpful while working with ESB and BizTalk.

  • Installation and Configuration of ESB
  • Links to various Blog Posts about configuration issues and Samples
  • MSDN links for the installation and Overview

Feel free to read and contribute!!

Thanks for reading!

BizTalk Schema to use <any> element

Overview

The XSD <any> element is very useful while designing generic schema or a schema to contain something unexpected/undefined or set of defined XML or elements.

The <any> element provides a way to keep/contain XML element which is not defined in the schema. For more details and example, Please read here :

Problem

There is a requirement to design a schema which should be generic in nature to contain any undefined type of XML. For example the following XML should be able to contain any XML in the <Details> element. As in the below example it contains <feedtext> element

schema input-1

The XM: should be able to contain any other XML in the <Details> as below a different input:

schema input-2

As in the above input XML , it contains <feedtextfromsite1>

Solution

To cater the above requirement we have to use <any> element in our schema . As defined in the page here, If a element is defined as <any> It can contain any other XML which is not defined in the schema.

Code

We will start by creating a schema using BizTalk Schema editor , Below are few steps:

  1. Create the Root Element and name it “MyBlogRssFeeds”
  2. Insert a  record and rename it to “Header”
  3. Insert a record below “Header”
  4. Insert a record below root element and name it “Details”
  5. Insert <any> element by Right Click on <Details>, then select “Insert Schema Node” then select “Any Element” .
  6. After this the schema should look like below:

Schema

And with this I was able to create a generic schema and was able to validate my XML.

And One More Thing!!

Please pay attention of the properties of <Any> element: It should look like below:

Schema Final

The property “Process Contents” should be set to “Skip” . Because of course we do not want the XML engine to validate the structure of this element.

the definition of this property is below from this page :

“Indicates how XML from other namespaces (introduced by the any element in a content model) should be validated. The value for this attribute may be one of ‘strict’ (the processor must retrieve the schema declaration associated with the namespace and validate the XML); ‘lax’ (the processor should attempt to validate the XML against its schema); and ‘skip’ (the processor should not attempt to validate the XML) “

Thanks for reading!