Have you ever wanted to copy a complex set of logic from one map to another? One of my young colleagues, Stephen Scott showed me a quick way to do this the other day. Here it is.
I had this map with many pages.
I wanted to change it to a map with two inputs instead of one.
The trick is as follows;
- Open the first map in a text editor. You will see something like
- Copy every thing between the Pages tag to the clipboard.
- Open the second map in a text editor. You will something like
- Now paste the contents of the clipboard between the two pages tags.
- Do a search and replace of [local-name()=’SubmitContact’] with [local-name()=’Root’]/*[local-name()=’InputMessagePart_0′]/*[local-name()=’SubmitContact’]
- Save the file.
- Now open the change in your Biztalk project and you will see your all the functoids and other artifactd have been copied to the new map.
GenerateDefaultFixedNodes=”Yes” PreserveSequenceOrder=”No” CopyPIs=”No” method=”xml” xmlVersion=”1.0″ IgnoreNamespacesForLinks=”Yes”>
<SrcTree>
<Reference Location=”SubmitContactDetailsRequest” />
</SrcTree>
<TrgTree>
<Reference Location=”InternalMaintainQuoteRequest” />
</TrgTree>
<ScriptTypePrecedence>
<CSharp Enabled=”Yes” />
<ExternalAssembly Enabled=”Yes” />
<VbNet Enabled=”Yes” />
<JScript Enabled=”Yes” />
<XsltCallTemplate Enabled=”Yes” />
<Xslt Enabled=”Yes” />
</ScriptTypePrecedence>
<TreeValues>
<TestValues />
<ConstantValues />
</TreeValues>
<Pages>
<Page Name=”Common”>
<Links>
<Link LinkID=”1″ LinkFrom=”/*[local-name()=’<Schema>’]/*[local-name()=’SubmitContact’]/*[local-name()=’QuoteDetails’]/*[local-name()=’QuoteID’]” LinkTo=”/*[local-name()=’<Schema>’]/*[local-name()=’MaintainQuoteRequest’]/*[local-name()=’QuoteDetails’]/*[local-name()=’SourceQuoteID’]” Label=”” />
<Link LinkID=”2″ LinkFrom=”/*[local-name()=’<Schema>’]/*[local-name()=’SubmitContact’]/*[local-name()=’QuoteDetails’]/*[local-name()=’Source’]” LinkTo=”/*[local-name()=’<Schema>’]/*[local-name()=’MaintainQuoteRequest’]/*[local-name()=’QuoteDetails’]/*[local-name()=’SourceSystem’]” Label=”” />
<Link LinkID=”3″ LinkFrom=”/*[local-name()=’<Schema>’]/*[local-name()=’SubmitContact’]/*[local-name()=’QuoteDetails’]/*[local-name()=’ProductType’]” LinkTo=”/*[local-name()=’<Schema>’]/*[local-name()=’MaintainQuoteRequest’]/*[local-name()=’QuoteDetails’]/*[local-name()=’Product’]” Label=”” />
<Link LinkID=”4″ LinkFrom=”/*[local-name()=’<Schema>’]/*[local-name()=’SubmitContact’]/*[local-name()=’QuoteDetails’]/*[local-name()=’Progress’]” LinkTo=”/*[local-name()=’<Schema>’]/*[local-name()=’MaintainQuoteRequest’]/*[local-name()=’QuoteDetails’]/*[local-name()=’QuoteProgress’]” Label=”” />
<Link LinkID=”5″ LinkFrom=”/*[local-name()=’<Schema>’]/*[local-name()=’SubmitContact’]/*[local-name()=’QuoteDetails’]/*[local-name()=’Status’]” LinkTo=”/*[local-name()=’<Schema>’]/*[local-name()=’MaintainQuoteRequest’]/*[local-name()=’QuoteDetails’]/*[local-name()=’QuoteStatus’]” Label=”” />
<Link LinkID=”6″ LinkFrom=”/*[local-name()=’<Schema>’]/*[local-name()=’SubmitContact’]/*[local-name()=’QuoteDetails’]/*[local-name()=’PolicyStart’]” LinkTo=”/*[local-name()=’<Schema>’]/*[local-name()=’MaintainQuoteRequest’]/*[local-name()=’QuoteDetails’]/*[local-name()=’StartDate’]” Label=”” />
<Link LinkID=”7″ LinkFrom=”/*[local-name()=’<Schema>’]/*[local-name()=’SubmitContact’]/*[local-name()=’QuoteDetails’]/*[local-name()=’PolicyEnd’]” LinkTo=”/*[local-name()=’<Schema>’]/*[local-name()=’MaintainQuoteRequest’]/*[local-name()=’QuoteDetails’]/*[local-name()=’EndDate’]” Label=”” />
<Link LinkID=”8″ LinkFrom=”/*[local-name()=’<Schema>’]/*[local-name()=’SubmitContact’]/*[local-name()=’QuoteDetails’]/*[local-name()=’OriginatingURL’]” LinkTo=”/*[local-name()=’<Schema>’]/*[local-name()=’MaintainQuoteRequest’]/*[local-name()=’QuoteDetails’]/*[local-name()=’OriginatingURL’]” Label=”” />
<Link LinkID=”9″ LinkFrom=”/*[local-name()=’<Schema>’]/*[local-name()=’SubmitContact’]/*[local-name()=’QuoteDetails’]/*[local-name()=’Link’]” LinkTo=”/*[local-name()=’<Schema>’]/*[local-name()=’MaintainQuoteRequest’]/*[local-name()=’QuoteDetails’]/*[local-name()=’QuoteLink’]” Label=”” />
<Link LinkID=”10″ LinkFrom=”/*[local-name()=’<Schema>’]/*[local-name()=’SubmitContact’]/*[local-name()=’QuoteDetails’]/*[local-name()=’Channel’]” LinkTo=”/*[local-name()=’<Schema>’]/*[local-name()=’MaintainQuoteRequest’]/*[local-name()=’QuoteDetails’]/*[local-name()=’SalesChannel’]” Label=”” />
<Link LinkID=”11″ LinkFrom=”/*[local-name()=’<Schema>’]/*[local-name()=’SubmitContact’]/*[local-name()=’QuoteDetails’]/*[local-name()=’LastModifiedDate’]” LinkTo=”/*[local-name()=’<Schema>’]/*[local-name()=’MaintainQuoteRequest’]/*[local-name()=’QuoteDetails’]/*[local-name()=’LastModifiedDate’]” Label=”” />
<Link LinkID=”12″ LinkFrom=”/*[local-name()=’<Schema>’]/*[local-name()=’SubmitContact’]/*[local-name()=’UserDetails’]/*[local-name()=’UserName’]” LinkTo=”/*[local-name()=’<Schema>’]/*[local-name()=’MaintainQuoteRequest’]/*[local-name()=’QuoteDetails’]/*[local-name()=’AccountName’]” Label=”” />
<Link LinkID=”13″ LinkFrom=”1″ LinkTo=”/*[local-name()=’<Schema>’]/*[local-name()=’MaintainQuoteRequest’]/*[local-name()=’QuoteDetails’]/*[local-name()=’SourceID’]” Label=”” />
</Links>
<Functoids>
<Functoid FunctoidID=”1″ X-Cell=”56″ Y-Cell=”213″ Functoid-FID=”107″ Functoid-Name=”String Concatenate” Label=”ToBAssigned”>
<Input-Parameters>
<Parameter Type=”Constant” Value=”ToBAssigned” Guid=”{AF7EB9D5-B802-4615-A366-DAF4CD18B182}” />
</Input-Parameters>
</Functoid>
</Functoids>
</Page>
<Page Name=”ContactMeRequested”>
<Links>
………..more
<?xml version=”1.0″ encoding=”utf-16″?>
<!– Generated using BizTalk Mapper on Sun, Oct 11 2009 07:54:38 AM –>
<mapsource Name=”BizTalk Map” BizTalkServerMapperTool_Version=”2.0″ Version=”2″ XRange=”100″ YRange=”420″ OmitXmlDeclaration=”Yes” TreatElementsAsRecords=”No” OptimizeValueMapping=”No” GenerateDefaultFixedNodes=”Yes” PreserveSequenceOrder=”No” CopyPIs=”No” method=”xml” xmlVersion=”1.0″ IgnoreNamespacesForLinks=”Yes”>
<SrcTree>
<xs:schema xmlns:tns=”http://schemas.microsoft.com/BizTalk/2003/aggschema” xmlns:b=”http://schemas.microsoft.com/BizTalk/2003″ xmlns:ns1=http://SubmitContactDetails xmlns:ns2=http://SubmitContactDetailsResponse targetNamespace=”http://schemas.microsoft.com/BizTalk/2003/aggschema” xmlns:xs=”http://www.w3.org/2001/XMLSchema”>
<xs:import schemaLocation=”SubmitContactDetailsRequest” namespace=http://SubmitContactDetails />
<xs:import schemaLocation=”SubmitContactDetailsResponse” namespace=http://SubmitContactDetailsResponse />
<xs:element name=”Root”>
<xs:complexType>
<xs:sequence>
<xs:element name=”InputMessagePart_0″>
<xs:complexType>
<xs:sequence>
<xs:element ref=”ns1:SubmitContact” />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name=”InputMessagePart_1″>
<xs:complexType>
<xs:sequence>
<xs:element ref=”ns2:SubmitContactResponse” />
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
</SrcTree>
<TrgTree>
<Reference Location=”Tower.CRM.InternalMaintainQuoteRequest” />
</TrgTree>
<ScriptTypePrecedence>
<CSharp Enabled=”Yes” />
<ExternalAssembly Enabled=”Yes” />
<VbNet Enabled=”Yes” />
<JScript Enabled=”Yes” />
<XsltCallTemplate Enabled=”Yes” />
<Xslt Enabled=”Yes” />
</ScriptTypePrecedence>
<TreeValues>
<TestValues />
<ConstantValues />
</TreeValues>
<Pages>
<Page Name=”Page 1″>
<Links />
<Functoids />
</Page>
</Pages>
</mapsource>