Export (0) Print
Expand All

Miscellaneous Map Operations: BizTalk Services

Updated: November 21, 2013

Miscellaneous Map Operations

The following table lists the Misc Map Operations available Microsoft Azure BizTalk Services:

 

Map Operation Description Parameters Output

Generate ID

Generates an alphanumeric identifier using a specified length. By default, this length is 14 with a minimum of 12 and maximum of 32 characters.

There are no input parameters.

Returns a unique GUID with the specified length.

Get Context Property

Used to access the property values.

Transforms are executed inside a bridge. When a bridge receives an incoming message, it builds a property-bag corresponding to the actual message body. The Get Context Property Map Operation can access these property values from within a Transform.

There are no input parameters.

Property Name: Enter the property name in the bridge to access.

Returns the specified property value.

ImportantImportant
The properties that are available in a Transform depend on where in the bridge the Transform is being executed. If a property is being promoted after a Transform is executed, the property is not available during the execution of the Transform. If properties are specified and are not available, an empty string is returned.

Get Loop Index Value

Gets the loop index. Starts at 1 for the first iteration, 2 for the second iteration, and so on.

Can only be used in a ForEach Loop or MapEach Loop Map Operation.

There are no input parameters.

Returns the current iteration index of a loop.

Number Format

Formats an input number. Specifically, an Input Number is parsed and then converted from the Input Culture to the Output Culture and Output Format.

Requires exactly one input parameter:

 

Input Number

A link from a tree node or an entered number value.

Also specify the following:

  • Input Culture: Select the invariant Language

  • Output Culture: Select the invariant Language

  • Output Format:

The incoming value is converted to the Output Culture and Output Format.

CSharp Scripting

Use to write custom inline C# code and call external .NET assemblies.

ImportantImportant
Inline script requires C#.

When calling an external .NET assembly, the .NET assembly must be strong signed and must be added as a reference to the project.

In Script Text, enter the C# script and click OK. Reopen the Map Operation to enter the Input_x values.

For example, enter:

bool myfunction(string s, int i)
{
return true;
}

The XElement class and IEnumerable interface can be used to operate on the source schema.

Returns the value based on the C# or assembly execution.

Error and Data Handling

BizTalk Services provides the ability to configure how an error is handled and how an empty or null node is handled. The error handling behavior of the following Misc Map Operations is configurable:

  • Get Context Property

  • Number Format

Steps:

  1. Open a BizTalk Service project or the BizTalk Service Artifacts project in Visual Studio.

  2. Double-click a Transform (.trfm) to open the Transform Designer.

  3. In the Transform toolbar, click Settings.

Error Handling tab

In the Error Handling tab, the following Misc Map Operations have two Behavior options:

  • Get Context Property:

    • Fail map: The entire Transform is aborted. Since Transforms are executed within a pipeline, an error occurs within the pipeline and the error is then sent to the client that sent the message.

    • Output default value Null: If the Map Operation fails, Null is returned as the output.

  • Number Format:

    • Fail map: The entire Transform is aborted. Since Transforms are executed within a pipeline, an error occurs within the pipeline and the error is then sent back to the client that sent the message.

    • Output default value Null: If the Map Operation fails, Null is returned as the output.

  • Any:

    • Fail map: The entire Transform is aborted. Since Transforms are executed within a pipeline, an error occurs within the pipeline and the error is then sent to the client that sent the message.

    • Output default value Null: If the Map Operation fails, Null is returned as the output.

Null/Empty Data Handling tab

In the Null/Empty Data Handling tab, there are three options:

  • Consider empty nodes in cumulative operations: By default, this is not checked. When not checked, no empty nodes are included in the iteration. When checked, all nodes, including empty nodes, are included in the iteration.

    EXAMPLE: There is a document with 10 <record> nodes. Three of these <record> nodes are empty. When Consider empty nodes in iterations is not checked, the Map Operation returns a value of seven. When Consider empty nodes in iterations is checked, the Map Operation returns a value of 10.

  • Consider empty nodes in iterations: By default, this is not checked. When not checked, no empty nodes are included in the iteration. When checked, all nodes, including empty nodes, are included in the iteration.

    EXAMPLE: there is a document with 10 <record> nodes. Three of these <record> nodes are empty. When Consider empty nodes in iterations is not checked, the Map Operation iterates seven times for the non-empty nodes. As a result, seven <record> nodes are generated in the Target. When Consider empty nodes in iterations is checked, the Map Operation iterates 10 times for all nodes, including the empty nodes. As a result, 10 <record> nodes are generated in the Target.

  • Target Node Generation: If empty nodes are configured to be considered, you choose to generate an empty node in the output or to not generate an empty node in the output. Specifically:

    • Do not generate empty nodes: Default option.

    • Generate empty nodes

    EXAMPLE: There is a document with 10 <record> nodes. Three of these <record> nodes are empty. Consider empty nodes in cumulative operations or Consider empty nodes in iterations are not checked, the Map Operation iterates seven times for the non-empty nodes. As a result, seven <record> nodes are generated in the Target. When Consider empty nodes in iterations is checked, the Map Operation iterates 10 times for all nodes, including the empty nodes. As a result, 10 <record> nodes are generated in the Target.

Additional Map Operations

See Also

Community Additions

ADD
Show:
© 2014 Microsoft