BizTalk Bootcamp - Day 2 Diary: Nuggets (Schemas, Maps, Pipelines)
Continued from http://dotnet.org.za/willy/archive/2008/05/12/biztalk-bootcamp-day1-diary-nuggets.aspx. Today we focused on BizTalk Schemas, Message Transformation using Maps and Message Processing using Pipelines.
Here are my rough notes ...
Schemas
Types | Extensions
- XML
- Native XML message types
- Defined in XML Schema Definition Language (XSD)
- Flat File (FF)
- Supports delimited or positional file formats
- Uses XML tags to represent values, storing tag information using the annotation capabilities of XSD
- EDI
- Special type of formatted text message
- EDIFACT and X12 formats supported by BizTalk
- As with FF uses XSD annotations to define format
Creation Options
- From scratch for message schemas with no instances, supporting XML, flat file, or EDI message types
- From scratch with other schemas or using the wizards, assisting with complex schemas
- From an instance message, creating a XML schema based on a particular instance message
- Modify existing schemas, using the BizTalk Schema Editor
- Flat File Schema Wizard
- Create flat file schemas from flat file message
- Get some energy drink before visiting the flat file schema generation wizard ... not for the fainthearted!
- Generate Metadata adapters (SQL, WCF, SAP, etc.)
Methods of reuse
Import
- Import schema from different project | namespace.
- Allows access and type usage of imported schema.
Include
- Include schema from same project | namespace.
- Allows access and type usage of included schema.
Redefine
- Not used much, but allows removing | adding to redefined schema
- Redefine schema in the same namespace
Promoted Properties and Distinguished Fields
Field needed for Routing --> Promoted Property
- Used for publish and subscribe message routing
- Max 255 characters
- Exists in its own property schema
Field needed for Orchestrations --> Distinguished Field
- Used make decisions based on message content in orchestrations
- No limit in characters
- Not usable for routing or pipelines ... see promoted properties.
- Better than using XPath in orchestration as field is loaded in context when entering orchestration
HINT: Always define your own property schema. Default is not always the best option!
Maps
- Mapping is the process of copying data from one XML document to another
- Mapping is an in-memory process from top to bottom
- Validation of instance messages is done during testing, not execution
- BizTalk supports 50 pages in the Map Editor, Visual Studio will only display a maximum of 20
HINT: SHIFT-drag-record from left to right record in map editor will map all elements within record.
Functoids
- Deliver about 80% of the most common functions, 20% would be custom functoids.
- Common categories are:
- String
- Mathematical
- Logical
- Date|Time
- Conversion
- Scientific
- Cumulative
- Miscellaneous (advanced)
- Combining multiple records
- Looping, Conditional Looping
- Scripting (C#, JScript, VB.NET, XSLT) ... preference is to call an external assembly (GAC'd) instead
- Database
- Transformation using custom XSLT
- Debugging
- Q: How many functoids can we link? A: How wide is the grid?
HINT: To move a functoid between pages, select functoid and all its links. You are then able to move the functoid.
HINT: Label links to make the functoid arguments more readable.
HINT: Dropping a functoid on another functoid, simply replaces the original functoid.
Map Transformation
- Pipeline Execution
- One in, one out
- Property promotion occurs in the disassembler process of the receive pipeline
- Caution: If property is promoted both in source and destination, the value of the source property sticks.
- Orchestration Execution
- Multiple in, multiple out
- Copy individual or all properties using:
- msgName(PropertySchemaNamespace.propertyName)
- msgNameTarget(*)=msgNameSource(*)
- BizTalk 2006 has 1MB threshold when loading documents into memory. Documents larger than configured threshold are buffered to file system.
Best Practices
- Large amount of memory is available? --> Increase the TransformThreshold
- Minimize the use of maps inside of orchestrations
- Use distinguished fields or promoted properties to extract or set properties where possible.
- Minimize the use of multiple inputs in orchestration transformation shapes.
Pipelines
- Context of pipeline is identity of host
- Standard Pipelines:
- PassThruReceive
- PassThruTransmit
- XMLReceive
- XMLTransmit
- EdiReceive
- EdiSend
- AS2EdiReceive
- AS2Receive
- AS2EdiSend
- AS2Send

- Receive Pipeline
- Decode
- Disaasemble
- Validate
- Resolve Party
- Send Pipeline
- Pre-Assemble
- Assemble
- Encode
Cheers, I now need a few hours of serious sleep ... my brain is fried ...