Thursday, October 19, 2006
BizTalk Best Practice - Message Decoupling in Orchestrations
Define all of your Messages in an orchestration from Multipart Schema Types.
If you create a message from a schema and assign it to a receive shape and that receive shape is connected to a logical port, if you need to change that message type, you need to first disconnect the “wire” between the receive shape and the port before the designer allows you the change the message type. Imagine if the message was referenced by lots ports and shapes. You would need to disconnect all of them and that could be a real pain.
If on the other hand you create a multipart message type for each schema and create each message in the orchestration from the appropriate multipart message type, you don’t need to unwire the various references to the message if you need to change the underlying schema type of a message. This might not be directly obvious, adds an abstraction layer around your message types and enhances overall maintainability.
BizTalk 2006 – Deep Technical Training
As time permits, I’ll begin posting interesting things we’ve discussed along the way. You might not come across anything new, but if you do, great! Most are common sense and good engineering practices; however others could be things you simply haven’t thought about yet or practices you haven’t followed. Given the flexibility and breadth of the product there are always going to be new things to consider.
Monday, October 16, 2006
BizTalk Server 2006 Documentation Update
Overview
In this Help Update, you'll find the following content:
- Complete documentation for all BizTalk Server Line of Business Adapters, including new tutorials, one for each adapter. See the section "Using Adapters."
- Troubleshooting guidance for each of the native BizTalk adapters. See the section "Troubleshooting Adapters."
- Troubleshooting Instructions for how to capture a memory dump. See the section "How to Capture a Memory Dump of a BizTalk Process."
- Disaster recovery instructions for backing up and restoring your BizTalk Server and databases. See the section "Backing Up and Restoring BizTalk Server"
- Updated Tutorials. See the section, "BizTalk Server 2006 Tutorials"
- Information for improving fault tolerance. See the section "Planning and Architecture"
- Updated Developer's Reference that now includes the BAM namespaces that were not included in the RTM documentation. See the section "Developer's Reference"
Sunday, October 15, 2006
BizTalk 2006 R2 B2B/EDI WebLog
The blog can be found here http://blogs.msdn.com/BizTalkB2B/
Wednesday, September 27, 2006
Business Policy Management and the BizTalk Rules Engine
RDA leverages the BizTalk Business Rules Engine to manage business policies in document workflow solutions. Document management workflows come in many shapes and sizes. Many of these workflows operate under rigid business policies, which often affect how documents flow through a process or influence decisions along the way.
Business policies are often fluid. They change with time. Any solution dependent on changing business policies must be agile by design. As such, the rules that govern the policy of a given document workflow needs to be easily maintained without affecting the solution deployed in a running production environment. The BizTalk Business Rules Engine provides just a mechanism.
The diagram below depicts a workflow system that leverages the rules engine to enforce and manage fluid business policies.
Browse all the RDA Spotlight on Business and Technology newsletters here:
http://www.rdacorp.com/SpotlightNewsletters.htm
Choosing BizTalk over WebSphere
http://download.microsoft.com/download/0/1/E/01E77F30-E571-478D-A8F8-F35FE66BD2BD/ChsBPASol.doc
Wednesday, March 29, 2006
Mapping complex conditions in BizTalk with XSLT
An easier way is to plug in XSLT. There are disadvantages to doing this, the main one being its maintainability and transparency but when faced with the daunting set of functoids described above, it looked a decent option.
The XSLT function that I used was the <xsl:choose> statement, inside the statement was a set of conditions which, if true, would return a value/values to the destination schema. In the last part of the statement was the <xsl:otherwise> condition which could set values if the conditions presented were not valid and you had a default you wanted to present in that event.
<xsl:variable name="var:vAnnuity" select="count(/*[local-name()='InternalSupport' and namespace-uri()='http://internal_support']/*[local-name()='LoanPartItems' and namespace-uri()='' and Method='Annuity'])" />
<xsl:variable name="var:vLinear" select="count(/*[local-name()='InternalSupport' and namespace-uri()='http://internal_support']/*[local-name()='LoanPartItems' and namespace-uri()='' and Method='Linear'])" />
<xsl:variable name="var:vTotalCount" select="count(/*[local-name()='InternalSupport' and namespace-uri()='http://internal_support']/*[local-name()='PartItems' and namespace-uri()=''])" />
<xsl:variable name="var:vHasValidEndowment" select="count(/*[local-name()='InternalSupport' and namespace-uri()='http://internal_support']/*[local-name()='LoanPartItems' and namespace-uri()='' and isValid ='true'])" />
<xsl:variable name="var:vHasValidId" select="count(/*[local-name()='InternalSupport' and namespace-uri()='http://internal_support']/*[local-name()='Ready' and HasValidId ='true'])" />
<xsl:element name="LeningSoort">
<xsl:choose>
<xsl:when test="$var:vAnnuity = $var:vTotalCount">
<xsl:value-of select="1" />
</xsl:when>
<xsl:when test="$var:vLinear = $var:vTotalCount">
<xsl:value-of select="2" />
</xsl:when>
<xsl:when test="($var:vHasValidEndowment = $var:vTotalCount) and ($var:vHasValidId = $var:vTotalCount)">
<xsl:value-of select="3" />
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="4" />
</xsl:otherwise>
</xsl:choose>
</xsl:element>
Of course each specific case requires different XSLT, but this should provide a framework of how to do this within a functoid.
To set up the XSLT:
• Create XSLT similar to the one above which meets your needs
• Drop a scripting functoid on your map
• Connect the output parameter to the node you want to create
• Note: do no include any input parameters, the XSLT is setup already to look them up
• Open the scripting functoid’s, click the (…) inside “Configure Functoid Script”
• Under “Script type” choose “Inline XSLT”
• Paste your XSLT snippet in the text box
Saturday, March 25, 2006
XSLT performance when mapping large documents in BizTalk
With such large files you generally test it using a small subset to avoid waiting for maps to complete, I built an XSLT which worked great, I thought.
When you use a select filter such as "not(KeyValue=preceding-sibling::row/ KeyValue)" you end up with a huge performance hit the larger the document gets. My map went from 2 seconds for 50 rows to 10 minutes for a few thousand.
How to improve performance when you have large XML files to map that you can’t split? Try using xsl:key instead, which builds an index of keys from which you can much more efficiently select.
Here is a sample XSLT that demonstrates how to use the xsl:key:
<?xml version="1.0" encoding="UTF-8" ?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" xmlns:ns0="http://Conversion.schemas">
<xsl:output method="xml" indent="no" />
<xsl:key name="NumberKey" match="/*[local-name()='top' and namespace-uri()='http://biztalk/Conversion.schemas']/*[local-name()='row' and namespace-uri()='']"
use="keyValue" />
<xsl:template match="/">
<ns0:Rows>
<xsl:for-each select="/*[local-name()='top' and namespace-uri()='http://biztalk/Conversion.schemas']/*[local-name()='row' and namespace-uri()='' and generate-id(.) = generate-id(key('NumberKey', keyValue)[1])]">
<xsl:variable name="current_Number" select="keyValue" />
<Data>
<keyValue>
<xsl:value-of select="$current_Number" />
</keyValue>
<xsl:for-each select="//row[keyValue=$current_Number]">
<Part>
<PartID>
<xsl:value-of select="nr_data" />
</PartID>
</Part>
</xsl:for-each>
</Data>
</xsl:for-each>
</ns0:Rows>
</xsl:template>
</xsl:stylesheet>
Monday, March 13, 2006
You can evaluate dates using the Cumulative Maximum Functoid
I had a situation where there was a node whose max occurs is unbounded and I needed to extract a single node from it to map to a destination node whose max occurs is one.
The problem was that I had to choose the node to map with the highest (newest) date:
<root>
<data>
<testdate>01-01-2000<testdate>
<testdata>a<testdata>
</data>
<data>
<testdate>01-01-2002<testdate>
<testdata>c<testdata>
</data>
<data>
<testdate>01-01-2001<testdate>
<testdata>b<testdata>
</data>
</root>
In the case above, I want the node with the highest <testval>, or 01-01-2002, therefore I want to map <testdata>c<testdata> to the destination node.
This can actually be done.
What I did was convert my date to ticks in a scripting functoid:
public string toTicks(string param1)
{
DateTime dt = DateTime.Parse(param1);
return dt.Ticks.ToString();
}
Afterwards I connected the scripting functoid to the cumulative max functoid.
Then I evaluate the output of the scripting functoid with the cumulative max functoid with an Equals functoid.
This should work for any set of repeating dates.
Saturday, March 04, 2006
BizTalk's mapper allows drag and drop replace
Have you ever had to change a functoid and gone thru the task of dragging the new functoid onto the grid and then reconnecting all of the lines, then having to check to make sure you got them all in order?
Well, what I realized quite by accident is that you can actually just drag the new functoid over the one you want to replace and all your links will maintain themselves. The old functoid will disappear and be replaced by the new one.
Of course there is a limitation when you have different maximum inputs, etc, but for the most part this works with everything else.