BizTalk Mapper Extensions UtilityPack: String Functoids for BizTalk Server 2020

  • Sandro Pereira
  • May 6, 2020
  • 5 min read

One step closer to finishing this BizTalk Mapper Extensions Utility Pack project migration. Today, we will focus on another set of libraries available for BizTalk Server 2020: String Functoids.

📝 One-Minute Brief

Introduces the String Functoids in the BizTalk Mapper Extensions UtilityPack for BizTalk Server 2020, providing a rich set of functoids to create, transform, compare, and normalize strings directly inside BizTalk maps.

String Functoids

This library includes a suite of functoids that provide many methods for safely creating, manipulating, and comparing strings that you can use inside the BizTalk mapper.

This project includes the following Custom Functoids:

String Constant functoid

This functoid allows you to set constant values (strings) inside the maps.

  • The functoid takes one mandatory input parameter:
    • String value to return out
  • The output of the functoid is the string set in the output. Example: P0011

String ToTitleCase functoid

This functoid allows you to convert the specified string to title case (except for words that are entirely in uppercase, which are considered to be acronyms)

  • The functoid takes one mandatory input parameter:
    • The string to convert to title case
  • The output of the functoid is a string converted to title case. Example: Sandro Augusto Sousa Pereira

String Advance Compare Functoid

This functoid allows you to compare two specified String objects, ignoring or honoring their case, and returns a boolean that indicates if they are equal or not.

  • The functoid takes three mandatory input parameters:
    • The first string to compare
    • The second string to compare
    • A boolean value: set True to ignore case during the comparison; otherwise, False.
  • The output of the functoid is a Boolean that indicates if they are equal or not. Example: True

String Replace Functoid

This functoid returns a new string in which all occurrences of a specified string (second parameter) found in the first string are replaced with another specified string (third parameter).

  • The functoid takes three mandatory input parameters:
    • A string where we will replace the values
    • A string to be replaced.
    • A string to replace all occurrences of oldValue.
  • The output of the functoid is a string that is equivalent to the current string except that all instances of oldValue are replaced with newValue. If oldValue is not found in the current instance, the method returns the current instance unchanged. Example: Sandro Pereira: BizTalk

String Normalize Functoid

This functoid allows you to normalize the text. It will remove two or more consecutive spaces and replace them with a single space, remove two or more consecutive newlines and replace them with a single newline, and condense multiple tabs into one.

  • The functoid takes one mandatory input parameter:
    • The string to normalize
  • The output of the functoid is a string normalized without consecutive spaces, lines, or tabs. Example: Sandro Augusto
    Sousa Pereira

String PadLeft Functoid

This functoid allows you to set a new string that right-aligns the characters in this instance by padding them on the left with a specified Unicode character, for a specified total length.

  • The functoid takes three mandatory input parameters:
    • A string that will be a pad on the left with a specified Unicode character
    • The number of characters in the resulting string is equal to the number of original characters plus any additional
      padding characters.
    • A Unicode padding character.
  • The output of the functoid is a new string that is equivalent to this instance, but right-aligned and padded on the left with as many paddingChar characters as needed to create a length of totalWidth. However, if totalWidth is less than the length of this instance, the method returns a reference to the existing instance. If totalWidth is equal to the length of this instance, the method returns a new string that is identical to this instance. Example: *BTS

String PadRight Functoid

This functoid allows you to set a new string that left-aligns the characters in this string by padding them on the right with a specified Unicode character, for a specified total length.

  • The functoid takes three mandatory input parameters:
    • A string that will be a pad on the right with a specified Unicode character
    • The number of characters in the resulting string is equal to the number of original characters plus any additional
      padding characters.
    • A Unicode padding character.
  • The output of the functoid is a new string that is equivalent to this instance, but left-aligned and padded on the right with as many paddingChar characters as needed to create a length of totalWidth. However, if totalWidth is less than the length of this instance, the method returns a reference to the existing instance. If totalWidth is equal to the length of this instance, the method returns a new string that is identical to this instance. Example: BTS*

String Remove Leading Zeros Functoid

This functoid allows you to remove any leading zeros from an input string.

  • The functoid has one mandatory parameter:
    • Input string that may contain leading zeros that need to be removed.
  • The output of the functoid is an integer that is equal to the input instance but with the leading zeros removed.

BizTalk Mapper Extensions Utility Pack

BizTalk Mapper Extensions Utility Pack is a set of libraries that includes several useful functoids to include in a map, extending BizTalk Mapper’s capabilities.

BizTalk Mapper Extensions Utility Pack

Download

You can download the source code and application binaries from GitHub:

Hope you find this helpful! If you liked the content or found it useful and would like to support me in writing more, consider buying (or helping to buy) a Star Wars Lego set for my son. 

Thanks for Buying me a coffe
Author: Sandro Pereira

Sandro Pereira lives in Portugal and works as a consultant at DevScope. In the past years, he has been working on implementing Integration scenarios both on-premises and cloud for various clients, each with different scenarios from a technical point of view, size, and criticality, using Microsoft Azure, Microsoft BizTalk Server and different technologies like AS2, EDI, RosettaNet, SAP, TIBCO etc. He is a regular blogger, international speaker, and technical reviewer of several BizTalk books all focused on Integration. He is also the author of the book “BizTalk Mapping Patterns & Best Practices”. He has been awarded MVP since 2011 for his contributions to the integration community.

Leave a Reply

Your email address will not be published. Required fields are marked *

The Ultimate Cloud
Management Platform for Azure

Supercharge your Azure Cost Saving

Learn More
Turbo360 Widget

Back to Top