BizTalk Document Mapping – Value Mapping Functoid and Value Mapping (Flattening) Functoid

Posted: July 20, 2009 in BizTalk
Tags: , ,

Value Mapping functoid are the two forms available. Both functoid’s will cause a new record to be created in the destination for every record in the source based on the logical condition evaluation to true or false.

And Both require 2 inputs parameters:

  • A Boolean value;
  • The node to be mapped;

If the Boolean is true, the value of the incoming field will be mapped, otherwise not.

Value Mappinf Functoid

The Value Mapping functoid returns the value of its second parameter if its first parameter is true. A common use of the functoid is to change the attributes of a field into the attributes of a record

Sample:

Input Output
<Root>
<Record>
<Field Name=”Param1″ Value=”1000″/>
<Field Name=”Param2″ Value=”2000″/>
<Field Name=”Param3″ Value=”3000″/>
</Record>
<Record>
<Field Name=”Param1″ Value=”1001″/>
<Field Name=”Param2″ Value=”2002″/>
<Field Name=”Param3″ Value=”3003″/>
</Record>
<Record>
<Field Name=”Param1″ Value=”1100″/>
<Field Name=”Param2″ Value=”2200″/>
<Field Name=”Param3″ Value=”3300″/>
</Record>
</Root>
<Root>
<Record Param1=”1000″ />
<Record Param2=”2000″ />
<Record Param3=”3000″ />
<Record Param1=”1001″ />
<Record Param2=”2002″ />
<Record Param3=”3003″ />
<Record Param1=”1100″ />
<Record Param2=”2200″ />
<Record Param3=”3300″ />
</Root>

Value Mappinf (Flattening) Functoid

The Value Mapping (Flattening) functoid returns the value of its second parameter if its first parameter is true. The Value Mapping (Flattening) functoid enables you to flatten a portion of an input instance message by converting multiple records into a single record

Sample:

Input Output
<Root>
<Record>
<Field Name=”Param1″ Value=”1000″/>
<Field Name=”Param2″ Value=”2000″/>
<Field Name=”Param3″ Value=”3000″/>
</Record>
<Record>
<Field Name=”Param1″ Value=”1001″/>
<Field Name=”Param2″ Value=”2002″/>
<Field Name=”Param3″ Value=”3003″/>
</Record>
<Record>
<Field Name=”Param1″ Value=”1100″/>
<Field Name=”Param2″ Value=”2200″/>
<Field Name=”Param3″ Value=”3300″/>
</Record>
</Root>

<Root>
<Record Param1=”1000″ Param2=”2000″ Param3=”3000″ />
<Record Param1=”1001″ Param2=”2002″ Param3=”3003″ />
<Record Param1=”1100″ Param2=”2200″ Param3=”3300″ />
</Root>

Difference between the two functoid’s

Difference between these two functoid is how they are mapped to destination.

  • If value of the incoming field cannot be mapped then Value Mapping Functoid will create an empty destination node (<node />);
  • While Value Mapping Functoid (Flattening) will not created an empty node.

This default behavior of Value Mapping Functoid can be changed with the help of other functoid and scripting.

Tags: BizTalk | Map | Funtoid

Comments
  1. Chandrasekhar G says:

    Nice, Sandro… I must say I’m a big fan of your BizTalk posts… I like how you put things in a simple manner, easy enough to understand…

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s