Copying functoids from one page to another

Posted: January 22, 2010  |  Categories: BizTalk Uncategorized

A question was asked about one of my previous post http://connectedpawns.wordpress.com/2009/10/10/copying-functoids-from-one-map-to-another/#comments. The question was can you use the same method to copy between pages on the same map. I did a bit  and yes you can.

  1. I created a test map and added blank second page like this;
  2. After saving I shutdown Visual studio. Next I opened the TestMap1 from the file system and it looks like this;
  3. <?xml version=”1.0″ encoding=”utf-16″?>
    <!– Generated using BizTalk Mapper on Sat, Jan 23 2010 11:50:41 AM –>
    <mapsource Name=”BizTalk Map” BizTalkServerMapperTool_Version=”2.0″ Version=”2″ XRange=”100″ YRange=”420″ OmitXmlDeclaration=”Yes” TreatElementsAsRecords=”No” OptimizeValueMapping=”Yes” GenerateDefaultFixedNodes=”Yes” PreserveSequenceOrder=”No” CopyPIs=”No” method=”xml” xmlVersion=”1.0″ IgnoreNamespacesForLinks=”Yes”>
      <SrcTree>
        <Reference Location=”.\THLDetails.xsd” />
      </SrcTree>
      <TrgTree>
        <Reference Location=”.\THLDetails.xsd” />
      </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>
            <Link LinkID=”1″ LinkFrom=”/*[local-name()=’&lt;Schema&gt;’]/*[local-name()=’THLDetails’]/*[local-name()=’Children’]” LinkTo=”1″ Label=”” />
            <Link LinkID=”2″ LinkFrom=”1″ LinkTo=”/*[local-name()=’&lt;Schema&gt;’]/*[local-name()=’THLDetails’]/*[local-name()=’Children’]” Label=”” />
            <Link LinkID=”3″ LinkFrom=”/*[local-name()=’&lt;Schema&gt;’]/*[local-name()=’THLDetails’]/*[local-name()=’Person’]/*[local-name()=’ID’]” LinkTo=”/*[local-name()=’&lt;Schema&gt;’]/*[local-name()=’THLDetails’]/*[local-name()=’Person’]/*[local-name()=’ID’]” Label=”” />
            <Link LinkID=”4″ LinkFrom=”/*[local-name()=’&lt;Schema&gt;’]/*[local-name()=’THLDetails’]/*[local-name()=’Person’]/*[local-name()=’DOB’]” LinkTo=”2″ Label=”” />
            <Link LinkID=”5″ LinkFrom=”2″ LinkTo=”/*[local-name()=’&lt;Schema&gt;’]/*[local-name()=’THLDetails’]/*[local-name()=’Person’]/*[local-name()=’DOB’]” Label=”” />
          </Links>
          <Functoids>
            <Functoid FunctoidID=”1″ X-Cell=”59″ Y-Cell=”222″ Functoid-FID=”120″ Functoid-Name=”Multiplication” Label=””>
              <Input-Parameters>
                <Parameter Type=”Link” Value=”1″ Guid=”{9FB9656A-C0F5-486E-B31B-209A9C0E7080}” />
                <Parameter Type=”Constant” Value=”2″ Guid=”{AF27CD40-81F2-4B6B-8391-614A6CB2FCCB}” />
              </Input-Parameters>
            </Functoid>
            <Functoid FunctoidID=”2″ X-Cell=”59″ Y-Cell=”216″ Functoid-FID=”122″ Functoid-Name=”Add Days” Label=””>
              <Input-Parameters>
                <Parameter Type=”Link” Value=”4″ Guid=”{41F1B839-0A87-4D0D-9083-D79462808A3A}” />
                <Parameter Type=”Constant” Value=”5″ Guid=”{BC43DA5C-93F4-420A-9755-9CE5788B9E5C}” />
              </Input-Parameters>
            </Functoid>
          </Functoids>
        </Page>
        <Page Name=”Page 2″>
          <Links />
          <Functoids />
        </Page>
      </Pages>
    </mapsource>

  4. Copy the text lighted above. Highlighted from page 1 to page 2.
  5. <?xml version=”1.0″ encoding=”utf-16″?>
    <!– Generated using BizTalk Mapper on Sat, Jan 23 2010 11:50:41 AM –>
    <mapsource Name=”BizTalk Map” BizTalkServerMapperTool_Version=”2.0″ Version=”2″ XRange=”100″ YRange=”420″ OmitXmlDeclaration=”Yes” TreatElementsAsRecords=”No” OptimizeValueMapping=”Yes” GenerateDefaultFixedNodes=”Yes” PreserveSequenceOrder=”No” CopyPIs=”No” method=”xml” xmlVersion=”1.0″ IgnoreNamespacesForLinks=”Yes”>
      <SrcTree>
        <Reference Location=”.\THLDetails.xsd” />
      </SrcTree>
      <TrgTree>
        <Reference Location=”.\THLDetails.xsd” />
      </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>
            <Link LinkID=”1″ LinkFrom=”/*[local-name()=’&lt;Schema&gt;’]/*[local-name()=’THLDetails’]/*[local-name()=’Children’]” LinkTo=”1″ Label=”” />
            <Link LinkID=”2″ LinkFrom=”1″ LinkTo=”/*[local-name()=’&lt;Schema&gt;’]/*[local-name()=’THLDetails’]/*[local-name()=’Children’]” Label=”” />
            <Link LinkID=”3″ LinkFrom=”/*[local-name()=’&lt;Schema&gt;’]/*[local-name()=’THLDetails’]/*[local-name()=’Person’]/*[local-name()=’ID’]” LinkTo=”/*[local-name()=’&lt;Schema&gt;’]/*[local-name()=’THLDetails’]/*[local-name()=’Person’]/*[local-name()=’ID’]” Label=”” />
            <Link LinkID=”4″ LinkFrom=”/*[local-name()=’&lt;Schema&gt;’]/*[local-name()=’THLDetails’]/*[local-name()=’Person’]/*[local-name()=’DOB’]” LinkTo=”2″ Label=”” />
            <Link LinkID=”5″ LinkFrom=”2″ LinkTo=”/*[local-name()=’&lt;Schema&gt;’]/*[local-name()=’THLDetails’]/*[local-name()=’Person’]/*[local-name()=’DOB’]” Label=”” />
          </Links>
          <Functoids>
            <Functoid FunctoidID=”1″ X-Cell=”59″ Y-Cell=”222″ Functoid-FID=”120″ Functoid-Name=”Multiplication” Label=””>
              <Input-Parameters>
                <Parameter Type=”Link” Value=”1″ Guid=”{9FB9656A-C0F5-486E-B31B-209A9C0E7080}” />
                <Parameter Type=”Constant” Value=”2″ Guid=”{AF27CD40-81F2-4B6B-8391-614A6CB2FCCB}” />
              </Input-Parameters>
            </Functoid>
            <Functoid FunctoidID=”2″ X-Cell=”59″ Y-Cell=”216″ Functoid-FID=”122″ Functoid-Name=”Add Days” Label=””>
              <Input-Parameters>
                <Parameter Type=”Link” Value=”4″ Guid=”{41F1B839-0A87-4D0D-9083-D79462808A3A}” />
                <Parameter Type=”Constant” Value=”5″ Guid=”{BC43DA5C-93F4-420A-9755-9CE5788B9E5C}” />
              </Input-Parameters>
            </Functoid>
          </Functoids>
        </Page>
        <Page Name=”Page 2″>
         <Links>
            <Link LinkID=”1″ LinkFrom=”/*[local-name()=’&lt;Schema&gt;’]/*[local-name()=’THLDetails’]/*[local-name()=’Children’]” LinkTo=”1″ Label=”” />
            <Link LinkID=”2″ LinkFrom=”1″ LinkTo=”/*[local-name()=’&lt;Schema&gt;’]/*[local-name()=’THLDetails’]/*[local-name()=’Children’]” Label=”” />
            <Link LinkID=”3″ LinkFrom=”/*[local-name()=’&lt;Schema&gt;’]/*[local-name()=’THLDetails’]/*[local-name()=’Person’]/*[local-name()=’ID’]” LinkTo=”/*[local-name()=’&lt;Schema&gt;’]/*[local-name()=’THLDetails’]/*[local-name()=’Person’]/*[local-name()=’ID’]” Label=”” />
            <Link LinkID=”4″ LinkFrom=”/*[local-name()=’&lt;Schema&gt;’]/*[local-name()=’THLDetails’]/*[local-name()=’Person’]/*[local-name()=’DOB’]” LinkTo=”2″ Label=”” />
            <Link LinkID=”5″ LinkFrom=”2″ LinkTo=”/*[local-name()=’&lt;Schema&gt;’]/*[local-name()=’THLDetails’]/*[local-name()=’Person’]/*[local-name()=’DOB’]” Label=”” />
          </Links>
          <Functoids>
            <Functoid FunctoidID=”1″ X-Cell=”59″ Y-Cell=”222″ Functoid-FID=”120″ Functoid-Name=”Multiplication” Label=””>
              <Input-Parameters>
                <Parameter Type=”Link” Value=”1″ Guid=”{9FB9656A-C0F5-486E-B31B-209A9C0E7080}” />
                <Parameter Type=”Constant” Value=”2″ Guid=”{AF27CD40-81F2-4B6B-8391-614A6CB2FCCB}” />
              </Input-Parameters>
            </Functoid>
            <Functoid FunctoidID=”2″ X-Cell=”59″ Y-Cell=”216″ Functoid-FID=”122″ Functoid-Name=”Add Days” Label=””>
              <Input-Parameters>
                <Parameter Type=”Link” Value=”4″ Guid=”{41F1B839-0A87-4D0D-9083-D79462808A3A}” />
                <Parameter Type=”Constant” Value=”5″ Guid=”{BC43DA5C-93F4-420A-9755-9CE5788B9E5C}” />
              </Input-Parameters>
            </Functoid>
          </Functoids>

        </Page>
      </Pages>
    </mapsource>

  6. Save the file and close it.
  7. Open the project in visual studio.
  8. Save the altered map before doing anything else.
  9. Re-open the map file in at ext editor. Note at the LinkID’sand the FunctoidID’s have been magically re-numbered on th.e second page. The GUIDID’s for the functoids have not changed but this seems to make no difference to how the map works. I have even changed some of the inputs in the functoids on the second page and everything was still OK. At runtime the map also did what it was supposed to.
  10. <?xml version=”1.0″ encoding=”utf-16″?>
    <!– Generated using BizTalk Mapper on Sat, Jan 23 2010 11:53:53 AM –>
    <mapsource Name=”BizTalk Map” BizTalkServerMapperTool_Version=”2.0″ Version=”2″ XRange=”100″ YRange=”420″ OmitXmlDeclaration=”Yes” TreatElementsAsRecords=”No” OptimizeValueMapping=”Yes” GenerateDefaultFixedNodes=”Yes” PreserveSequenceOrder=”No” CopyPIs=”No” method=”xml” xmlVersion=”1.0″ IgnoreNamespacesForLinks=”Yes”>
      <SrcTree>
        <Reference Location=”.\THLDetails.xsd” />
      </SrcTree>
      <TrgTree>
        <Reference Location=”.\THLDetails.xsd” />
      </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>
            <Link LinkID=”1″ LinkFrom=”/*[local-name()=’&lt;Schema&gt;’]/*[local-name()=’THLDetails’]/*[local-name()=’Children’]” LinkTo=”1″ Label=”” />
            <Link LinkID=”2″ LinkFrom=”1″ LinkTo=”/*[local-name()=’&lt;Schema&gt;’]/*[local-name()=’THLDetails’]/*[local-name()=’Children’]” Label=”” />
            <Link LinkID=”3″ LinkFrom=”/*[local-name()=’&lt;Schema&gt;’]/*[local-name()=’THLDetails’]/*[local-name()=’Person’]/*[local-name()=’ID’]” LinkTo=”/*[local-name()=’&lt;Schema&gt;’]/*[local-name()=’THLDetails’]/*[local-name()=’Person’]/*[local-name()=’ID’]” Label=”” />
            <Link LinkID=”4″ LinkFrom=”/*[local-name()=’&lt;Schema&gt;’]/*[local-name()=’THLDetails’]/*[local-name()=’Person’]/*[local-name()=’DOB’]” LinkTo=”2″ Label=”” />
            <Link LinkID=”5″ LinkFrom=”2″ LinkTo=”/*[local-name()=’&lt;Schema&gt;’]/*[local-name()=’THLDetails’]/*[local-name()=’Person’]/*[local-name()=’DOB’]” Label=”” />
          </Links>
          <Functoids>
            <Functoid FunctoidID=”1″ X-Cell=”59″ Y-Cell=”222″ Functoid-FID=”120″ Functoid-Name=”Multiplication” Label=””>
              <Input-Parameters>
                <Parameter Type=”Link” Value=”1″ Guid=”{9FB9656A-C0F5-486E-B31B-209A9C0E7080}” />
                <Parameter Type=”Constant” Value=”2″ Guid=”{AF27CD40-81F2-4B6B-8391-614A6CB2FCCB}” />
              </Input-Parameters>
            </Functoid>
            <Functoid FunctoidID=”2″ X-Cell=”59″ Y-Cell=”216″ Functoid-FID=”122″ Functoid-Name=”Add Days” Label=””>
              <Input-Parameters>
                <Parameter Type=”Link” Value=”4″ Guid=”{41F1B839-0A87-4D0D-9083-D79462808A3A}” />
                <Parameter Type=”Constant” Value=”5″ Guid=”{BC43DA5C-93F4-420A-9755-9CE5788B9E5C}” />
              </Input-Parameters>
            </Functoid>
          </Functoids>
        </Page>
        <Page Name=”Page 2″>
          <Links>
            <Link LinkID=”6″ LinkFrom=”/*[local-name()=’&lt;Schema&gt;’]/*[local-name()=’THLDetails’]/*[local-name()=’Children’]” LinkTo=”3″ Label=”” />
            <Link LinkID=”7″ LinkFrom=”3″ LinkTo=”/*[local-name()=’&lt;Schema&gt;’]/*[local-name()=’THLDetails’]/*[local-name()=’Children’]” Label=”” />
            <Link LinkID=”8″ LinkFrom=”/*[local-name()=’&lt;Schema&gt;’]/*[local-name()=’THLDetails’]/*[local-name()=’Person’]/*[local-name()=’ID’]” LinkTo=”/*[local-name()=’&lt;Schema&gt;’]/*[local-name()=’THLDetails’]/*[local-name()=’Person’]/*[local-name()=’ID’]” Label=”” />
            <Link LinkID=”9″ LinkFrom=”/*[local-name()=’&lt;Schema&gt;’]/*[local-name()=’THLDetails’]/*[local-name()=’Person’]/*[local-name()=’DOB’]” LinkTo=”4″ Label=”” />
            <Link LinkID=”10″ LinkFrom=”4″ LinkTo=”/*[local-name()=’&lt;Schema&gt;’]/*[local-name()=’THLDetails’]/*[local-name()=’Person’]/*[local-name()=’DOB’]” Label=”” />
          </Links>
          <Functoids>
            <Functoid FunctoidID=”3″ X-Cell=”59″ Y-Cell=”222″ Functoid-FID=”120″ Functoid-Name=”Multiplication” Label=””>
              <Input-Parameters>
                <Parameter Type=”Link” Value=”6″ Guid=”{9FB9656A-C0F5-486E-B31B-209A9C0E7080}” />
                <Parameter Type=”Constant” Value=”2″ Guid=”{AF27CD40-81F2-4B6B-8391-614A6CB2FCCB}” />
              </Input-Parameters>
            </Functoid>
            <Functoid FunctoidID=”4″ X-Cell=”59″ Y-Cell=”216″ Functoid-FID=”122″ Functoid-Name=”Add Days” Label=””>
              <Input-Parameters>
                <Parameter Type=”Link” Value=”9″ Guid=”{41F1B839-0A87-4D0D-9083-D79462808A3A}” />
                <Parameter Type=”Constant” Value=”5″ Guid=”{BC43DA5C-93F4-420A-9755-9CE5788B9E5C}” />
              </Input-Parameters>
            </Functoid>
          </Functoids>
        </Page>
      </Pages>
    </mapsource>

As a further experiment I tried copying the links within the same page to see what happens. This does not work because the map editor cannot re-number the links.

BizTalk360
BizTalk Server

Over 650+ customers across
30+ countries depend on BizTalk360

Learn More
Serverless360
Azure

Operate efficiently with enterprise-grade Azure monitoring,
tracing, remediation & governance in one platform

Learn More

Back to Top