BizTalk Innovation Day - Porto

download BizTalk Innovation Day - Porto

If you can't read please download the document

description

BizTalk Mapping Patterns and Best Practices . Sandro Pereira Senior Software Developer Microsoft Integration MVP. BizTalk Innovation Day - Porto. Sandro Pereira. Senior Software Developer at DevScope Microsoft Integration MVP since 2011 - PowerPoint PPT Presentation

Transcript of BizTalk Innovation Day - Porto

Product brand template

BizTalk Innovation Day - PortoBizTalk Mapping Patterns and Best Practices Sandro PereiraSenior Software Developer Microsoft Integration MVP

2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries.The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.3/19/20131 Senior Software Developer at DevScope Microsoft Integration MVP since 2011

Writer of numerous articles for Portuguese eMagazine ProgramarAuthor Sandro Pereira BizTalk Blog http://sandroaspbiztalkblog.wordpress.comMember of BizTalkAdminsblogging.com and BizTalk Brasil communityMember NetPonto communityMSDN BizTalk Forums ModeratorTechNet Wiki author (Wiki Ninja)TechNet Gallery, Code Gallery and CodePlex contributorPublic speaker Technical Reviewer PACKT PublishingBizTalk Server 2010 Cookbook (April 2012)

Sandro Pereira

2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries.The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.3/19/20132AgendaBizTalk Mapper BasicsHow BizTalk Mapper WorksBest PracticesCommon mapper problems and solutions

2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries.The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.3/19/20133Do you recognize this?

2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries.The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.3/19/20134Schema Schema

One-way (typically)

CSV XML

BidirectionalTransformation typesSyntaxSemantics

5BizTalk Mapper BasicsBizTalk Mapper Designer and its main concepts 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries.The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.3/19/20136A map defines the correspondence between records and fields in two different schemas

What Is a BizTalk Map?MapSource SchemaItemIDQtyUnitPricePOPOStatusDestination SchemaPurchaseOrderPO_NumberDateItem_NoQuantityOrder_StatusDateData TransformationPerform computational and other data operations Copy the data from one message to anotherData TranslationChange the format of data between messagesExample: translate between a flat file and an XML fileCreating a Map by Using the BizTalk Mapper

DestinationSchemaMap GridSourceSchemaProperties WindowsSolution ExplorerTask List and Output WindowsFunctoids in ToolboxBizTalk MapperIntegrated within Visual StudioStarts when a map is opened or added toa projectSource and destination schemas must be part of the project or contained in a referenced assemblyCreating a Map by Using the BizTalk MapperLink TypeUsageSimple link (one-to-one)Create a single link by dragging and droppingCan be made between nodes or recordsStructure link (multiple)Create multiple links simultaneouslyRelevant schema structures must be the sameUse when node names are different but order is the same (or similar)Name-matching link (multiple)Create multiple links simultaneouslyRecord or field names must matchSimilar but not identical schema structuresItemIDRecordPOStatusOrderPO NoDateItem NoItemIDRecordPOStatusOrderPO NoStatus FlagItem NoItemRecordPOStatusOrderStatusItemPOBasic and Complex Map LinksMapping OperationUsageBasicMost common type of mappingValues simply copied from input message to output messageSupports most types of transformations and translationsComplexRecords can occur multiple times for a single message (looping)Source schema must specify repeating elementCompiler will automatically generate an XSLT for-each loopOrderPO_NumberDateItem_NoQuantityOrder_StatusItemIDQtyUnitPriceRecordPOStatusDateField1Field2POIDStatusOrderPO_NumDateFieldAFieldBDetailItemItemsValidating, Testing and Debugging a Map

Data Manipulation with FunctoidsMapSource SchemaDestination Schema

ItemIDQtyUnitPriceRecordPOStatusOrderPO NumberDateItem NoQuantityOrder StatusDateTotal Price(..)XBizTalk Mapper Extensions UtilityPack: BizTalk Mapper Extensions UtilityPack is a set of libraries with several useful functoids to include and use it in a map, which will provide an extension of BizTalk Mapper capabilities.http://btsmapextutilitypack.codeplex.com/FunctoidsUse to manipulate mapped dataCan use predefined functoids or create custom functoidsCustom functoids can call scriptsUsing Basic Functoids

Link functoids to fields

Configure functoid inputsDrag functoid from Toolbox to map

Where can be used?

Maps can be used inReceive LocationsSend portsInside OrchestrationsHow BizTalk Mapper WorksHow maps are processed internally by the engine of the product as we explore the map editor BizTalk Server. 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries.The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.3/19/201315Deconstructing a map

2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries.The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.3/19/201316Deconstructing a map

Deconstructing a map

Deconstructing a map

Deconstructing a map

Deconstructing a map

Deconstructing a map

The order of links associationThe order in which we perform the links between the elements from source to destination has a huge impact in the final resultThis statement is true and false at the same time!Impact of the order of links in functoidsThe functoids require certain input parameters that can vary according to the functoid that we are using

The sequence of links The order in which we perform the links between the elements from source to destination has a huge impact in the final resultThis statement is true and false at the same time!Impact of the order of links in elements of the destination schema If we change the order in which we associate the links on the same element in the destination schema we can also have an impact on the desired final result.

The exception to the rule of Link Sequence

int myCounter = 0;public void IncrementCounter(){ myCounter += 1;}public int ReturnCounter(){ return myCounter;}Best PracticesWhat best practices we must implement to improve developing performance 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries.The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.3/19/201326

Challenges with large data transformationsDifficult to use with large schemas.Hard to maintain complex maps Hard to track relationshipsNo search capabilitiesNo cut/copy/paste or undoBest Practices 1: Using Map Grid PagesGrid Pages

Grid PreviewCreate unlimiteddifferent pagesIsolate different partsof a map Work with different parts ofa map separatelyMust create connectedfunctoids on the same layerPage 4Page 3Page 2Page 1ItemIDQtyUnitPriceRecordPOStatusOrderPO NumberDateItem NoQuantityOrder StatusDestination SchemaSource SchemaDateTotal Price(..)Find and work with a portion of a large map

XUse pages to reduce complexity of a map

2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries.The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.3/19/201328Testing should be a continuous process as you build your map, not only at the end of development, but when necessary or when an important mapping block is completeBest Practices 2: Testing should be a continuous process

2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries.The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.3/19/201329Best Practices 3: Using labels

Scripting FunctoidAllows you to execute custom code or XSLTCan execute custom script: C# .NET / VB.NET / JScript.NET / XSLT / XSLT Call TemplateBut we need to rewrite over and over again!Reasons to develop custom functoids:They are reusableMore easy to read (visually on the map grid)Careful: All functoids must have a unique ID in order for the runtime to distinguish them. The ID is an integer and all IDs below 6000 are reserved for Microsoft use. Best Practices 4: Custom Functoids vs Scripting Functoid 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries.The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.3/19/201331Pros:Direct XSLT is more powerful, fewer limitations than the BizTalk MapperImproved performanceXSLT file can be developed separately and hosted in a BizTalk mapCons:Not quite as intuitiveFunctoids are more easy to read (visually on the map grid)Requires geeky coding skillsLoss of visual map representation

Best Practices 5: Custom XSLT vs Functoids 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries.The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.3/19/201332Inspecting the XSLT generated by the compiler provides insight into how the map functionsAlso provides another debugging optionIn Solution Explorer, right-click *.btm file and select Validate MapLink to generated XSLT shown in Output window

Best Practices 6: Reviewing the XSLT 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries.The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.3/19/201333New Mapper in BizTalk Server 2010Better UI for complex or large transformationsReduce background noise using highlight propagationAuto-scrolling and sibling coalescing help locate nodes

Enhanced functionalitySupport for searchImproved productivity with cut/copy/paste/move/ undoPredictive matchImproved support for documenting map and readability 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries.The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.3/19/201334Common mapper problems and solutionsSome of the best ways to address some of your needs within the context of message transformation 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries.The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.3/19/201335FunctoidsDemosBizTalk Mapper Patterns specifying best practices and some of the best ways to address some of your needs within the context of message transformation.InspectCustom XSLT36Questions? 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries.The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.3/19/[email protected]://pt.linkedin.com/in/sandropereira@sandro_asp http://sandroaspbiztalkblog.wordpress.comContacts

www.devscope.netBizTalk Innovation Day - Porto

2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries.The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.3/19/201338