The BizTalk Mapper Extensions UtilityPack is a community-driven project that provides a collection of useful functoids to extend the capabilities of the BizTalk Mapper. Today I’m happy to announce a small but important update: version 1.7.0.1 is now available.
📝 One-Minute Brief
This post announces version 1.7.0.1 of the BizTalk Mapper Extensions UtilityPack for BizTalk Server 2013. The UtilityPack extends BizTalk Mapper by adding additional functoids and fixes an issue in the String Replace functoid related to carriage return and line feed characters during transformations.
Project Description
Developing complex transformations in BizTalk Server often requires more than the standard out-of-the-box functoids. Therefore, this UtilityPack offers a set of custom functoids — from string manipulation to date formatting — that simplify mapping logic and reduce the need for custom Scripting Functoids.
In practice, these functoids help developers build cleaner maps, avoid custom XSLT, and speed up development.
Changelog
Here’s the change included in this release:
- Fixes a bug in the String Replace Functoid
What’s New in This Version?
This release focuses on reliability and correctness.
Bug Fix — String Replace Functoid
We identified and fixed an issue affecting specific character sequences. Previously, the functoid could fail when handling certain replacements, which caused inconsistent transformation results.
In particular, replacing a Carriage Return/Line Feed (\r\n) inside an element did not work correctly. The generated XSLT translated the string \r\n into \\r\\n, which prevented the replacement from occurring.
This update resolves that behavior and ensures consistent string transformations.
Download
You can download the source code and application binaries from GitHub:
Hope you find this helpful!
If you enjoyed the content or it helped you solve a problem, and you would like to support future posts, consider buying (or helping to buy) a Star Wars Lego set for my son 😊.
I tried Password Generator Functoid today and its not taking any of the Boolean inputs apart from the integer input pwdLength. Is this a normal behavior (or) would I have the option, for example to choose no UpperCase or LowerCase letters in my password by setting the Boolean values( True or False)?
Question:
i have tryed the “Remove leading zeros functoid” it dosen´t work. i get this error:
——————————————-
xlang/s engine event log entry: Uncaught exception (see the ‘inner exception’ below) has suspended an instance of service ‘IN.IN_PROCESS(62d47022-5fa7-d3e4-46f5-3ec24fb6b6f7)’.
The service instance will remain suspended until administratively resumed or terminated.
If resumed the instance will continue from its last persisted state and may re-throw the same unexpected exception.
InstanceId: 61f4b055-66b9-4b0a-953c-0ffc80626378
Shape name: ConstructMessage_2
ShapeId: 19a07e88-5a4e-48bd-95c4-3d7172cc51c0
Exception thrown from: segment 1, progress 9
Inner exception: Error encountered while executing the transform Maps.COARRID95B_MOVE. Error:Transformation failed..
Exception type: XTransformationFailureException
Source: Microsoft.XLANGs.Engine
Target Site: Void ApplyInMemoryTransform(System.Type, Microsoft.XLANGs.RuntimeTypes.TransformMetaData, System.Object[], System.IO.Stream[])
The following is a stack trace that identifies the location where the exception occured
at Microsoft.XLANGs.Core.Service.ApplyInMemoryTransform(Type mapRef, TransformMetaData trfMetaData, Object[] outParams, Stream[] inStreams)
at Microsoft.XLANGs.Core.Service.ApplyTransform(Type mapRef, Object[] outParams, Object[] inParams)
at IN.IN_PROCESS.segment1(StopConditions stopOn)
at Microsoft.XLANGs.Core.SegmentScheduler.RunASegment(Segment s, StopConditions stopCond, Exception& exp)
Additional error information:
Exception has been thrown by the target of an invocation.
Exception type: TargetInvocationException
Source: mscorlib
Target Site: System.Object InvokeMethod(System.Object, System.Object[], System.Signature, Boolean)
The following is a stack trace that identifies the location where the exception occured
at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at Microsoft.XLANGs.BaseTypes.CompiledXsltWrapperTransform.Transform(IXPathNavigable input, XsltArgumentList arguments, XmlWriter results, XmlResolver resolver)
at Microsoft.XLANGs.BaseTypes.CompiledXsltWrapperTransform.Transform(IXPathNavigable input, XsltArgumentList arguments, Stream output, XmlResolver resolver)
at Microsoft.XLANGs.Core.Service.ApplyInMemoryTransform(Type mapRef, TransformMetaData trfMetaData, Object[] outParams, Stream[] inStreams)
Additional error information:
Input string was not in a correct format.
Exception type: FormatException
Source: mscorlib
Target Site: Void StringToNumber(System.String, System.Globalization.NumberStyles, NumberBuffer ByRef, System.Globalization.NumberFormatInfo, Boolean)
The following is a stack trace that identifies the location where the exception occured
at System.Number.StringToNumber(String str, NumberStyles options, NumberBuffer& number, NumberFormatInfo info, Boolean parseDecimal)
at System.Number.ParseInt32(String s, NumberStyles style, NumberFormatInfo info)
at System.Xml.Xsl.CompiledQuery.Script1.RemoveZeros(String oldValue)
at (XmlQueryRuntime {urn:schemas-microsoft-com:xslt-debug}runtime, XPathNavigator {urn:schemas-microsoft-com:xslt-debug}current)
at (XmlQueryRuntime {urn:schemas-microsoft-com:xslt-debug}runtime, XPathNavigator {urn:schemas-microsoft-com:xslt-debug}current)
at Root(XmlQueryRuntime {urn:schemas-microsoft-com:xslt-debug}runtime)
at Execute(XmlQueryRuntime {urn:schemas-microsoft-com:xslt-debug}runtime)
at System.Xml.Xsl.XmlILCommand.Execute(Object defaultDocument, XmlResolver dataSources, XsltArgumentList argumentList, XmlSequenceWriter results)
at System.Xml.Xsl.XmlILCommand.Execute(Object defaultDocument, XmlResolver dataSources, XsltArgumentList argumentList, XmlWriter writer)
at System.Xml.Xsl.XslCompiledTransform.Transform(IXPathNavigable input, XsltArgumentList arguments, XmlWriter results, XmlResolver documentResolver)
——————————————
The input is on both sides an integer!
Any advice????
Thanx.
What is the value that you are passing to the functoid? This functoid execute this simple function
public Int32 RemoveZeros(string oldValue)
{
return Int32.Parse(Regex.Replace(oldValue, “^0+”,””));
}
Hey Sandro,
i get the incorrect Value from a custommer in a TMP Segment, the Value is -020. Iwant to get this value -20.
Hi Serpil,
The functoid doesn’t work with negative numbers, it wasn’t created for this purpose. You may create a new functoid or add a Inline C# with the following function:
public string RemoveLeadingZerosFromIntegers(string oldValue)
{
int number = 0;
if (Int32.TryParse(oldValue, out number))
return number.ToString();
return oldValue;
}
Many Thanx!!!!! 🙂 It works.