Framework.BizTalk.Components
2.0.5
dotnet add package Framework.BizTalk.Components --version 2.0.5
NuGet\Install-Package Framework.BizTalk.Components -Version 2.0.5
<PackageReference Include="Framework.BizTalk.Components" Version="2.0.5" />
<PackageVersion Include="Framework.BizTalk.Components" Version="2.0.5" />
<PackageReference Include="Framework.BizTalk.Components" />
paket add Framework.BizTalk.Components --version 2.0.5
#r "nuget: Framework.BizTalk.Components, 2.0.5"
#:package Framework.BizTalk.Components@2.0.5
#addin nuget:?package=Framework.BizTalk.Components&version=2.0.5
#tool nuget:?package=Framework.BizTalk.Components&version=2.0.5
Parts Merger Pipeline Component
Overview
PartsMergerComponent is a custom BizTalk pipeline component designed to operate after the Disassemble stage of a receive pipeline. It transforms a multi-part message into a single-part message, applies optional transformations, and promotes properties for downstream processing.
Features
- Converts multi-part messages to single-part messages.
- Applies transformation based on a specified map.
- Promotes properties for routing and processing.
- Supports envelope schema matching and body unwrapping.
- Configurable error handling behavior.
Configuration
The component is configured via the following properties:
| Property Name | Description | Type | Example Value |
|---|---|---|---|
EnvelopeSchema |
Fully qualified name of the envelope schema used for message wrapping. | string | http://framework.biztalk/ESB/HL7/2X/2.5/Envelope#ENV_ADT_25_GLO_DEF |
UnwrapBody |
Indicates whether to unwrap the body from the envelope. | boolean | true |
MatchPattern |
Pattern used to match message types for processing. | string | ADT_A[\d]{2}_25_GLO_DEF |
AssemblyQualifiedMapName |
Optional map to apply during transformation. | string | (empty or FQ map name) |
Enabled |
Enables or disables the component. | boolean | true |
RethrowException |
If true, exceptions are rethrown; otherwise, they are handled silently. |
boolean | false |
Usage
- Add the
PartsMergerComponentafter the Disassemble stage of your custom receive pipeline. - Configure the properties via the pipeline designer or programmatically.
- Deploy the pipeline and assign it to your receive location.
Importing XSLT Templates from Embedded DLL Resources
This feature allows XSLT templates to be imported directly from DLLs where the templates are embedded as resources. It streamlines deployment and improves maintainability by bundling transformation logic with related assemblies.
Requirements
- Assembly must be deployed to the Global Assembly Cache (GAC)
- XSLT file must be embedded as a resource in the assembly
Example
<xsl:import href="resource://gac/Framework.BizTalk.Maps.Common, Version=1.0.0.0, Culture=neutral, PublicKeyToken=eae13714e186477a/segments.xslt"/>
Error Handling
If an unexpected content type is encountered, the component throws an exception:
InvalidDataException("PartMerger: Unexpected content type. Ensure that previous stage is producing text/xml.");
Parts Splitter Pipeline Component
Overview
PartsSplitterComponent is a custom BizTalk pipeline component designed for use in the Pre-Assemble stage of a send pipeline. It works in conjunction with the PartsMergerComponent (used in receive pipelines) to support a round-trip message transformation scenario. The splitter reverses the merging process by extracting individual message parts from a unified structure.
Key Features
- Splits a single-part message into multiple parts based on inferred schema.
- Automatically detects the schema from the message type (no manual configuration required).
- Supports HL7 and other structured formats.
- Designed to work seamlessly with
PartsMergerComponent.
Configuration
The component can be configured with the following properties:
| Property Name | Description | Type | Example Value |
|---|---|---|---|
WrapBody |
If true, the PartsMergerComponent wraps the body part of the message with a root XML element. This root element is derived from the MessageType property of the inbound message. This wrapping ensures that the resulting single-part message conforms to the expected schema structure. | boolean | true |
Enabled |
Enables or disables the component. | boolean | true |
RethrowException |
If true, exceptions are rethrown; otherwise, they are handled silently. |
boolean | false |
Usage
- Add the
PartsSplitterComponentto the Pre-Assemble stage of a custom send pipeline. - Configure the component properties via the pipeline designer.
- Deploy the pipeline and assign it to the appropriate send port.
HL7 Rule-Based Modifier Pipeline Component
Overview
The HL7 Rule-Based Modifier is a custom BizTalk pipeline component designed to modify HL7 messages before they reach the disassembler stage. It uses a configurable set of transformation rules defined in XML to identify and replace specific fields in HL7 segments, including support for repeating segments.
This component is ideal for scenarios where HL7 messages need to be normalized, corrected, or enriched based on dynamic business rules.
Features
- Modify HL7 fields using configurable XML rules
- Supports repeating segments via optional
seqattribute - Uses a lightweight custom HL7 parser (no external dependencies)
- Regex-based matching for flexible transformations
- Designed for use in the Decode stage of a BizTalk receive pipeline
Rule Configuration
Rules are defined in XML format and passed to the component via the RulesXml property.
Example Rule XML
<rules>
<rule segment="MSH" field="3" match=".*" replace="NewApp" />
<rule segment="PID" seq="1" field="5" match=".*" replace="Doe^Jonathan" />
<rule segment="PID" field="3" match=".*" replace="999999" />
</rules>
HL7 Rule XML Attribute Reference
| Attribute | Required | Type | Description |
|---|---|---|---|
segment |
✅ Yes | string |
The HL7 segment name (e.g., MSH, PID, OBR) to which the rule applies. |
seq |
❌ No | int? |
Optional segment sequence number for repeating segments. If omitted, the rule applies to all segments with the specified name. |
field |
✅ Yes | int |
The 1-based index of the field within the segment to be modified. Field 1 refers to the first field after the segment name. |
match |
✅ Yes | string |
A regular expression pattern used to match the current field value. |
replace |
✅ Yes | string |
The replacement value to apply if the match pattern is satisfied. |
Notes:
- Field indexing starts at
1because the segment name is at index0. - The
matchpattern uses standard .NET regular expressions. - If multiple rules match the same segment and field, they are applied in the order they appear in the XML.
XSLT Extensions (for AssemblyQualifiedMapName)
| Function Name | Signature | Description |
|---|---|---|
ToUpper |
string ToUpper(string input) |
Converts the input string to uppercase. |
ToLower |
string ToLower(string input) |
Converts the input string to lowercase. |
Trim |
string Trim(string input) |
Removes leading and trailing whitespace from the input string. |
Replace |
string Replace(string input, string oldValue, string newValue) |
Replaces all occurrences of oldValue with newValue in the input string. |
Contains |
bool Contains(string input, string value) |
Checks if the input string contains the specified value. |
Substring |
string Substring(string input, int startIndex, int length) |
Returns a substring from the input string starting at startIndex with length. |
FormatDate |
string FormatDate(DateTime date, string format) |
Formats a DateTime object into a string using the specified format. |
ParseDate |
DateTime ParseDate(string dateString, string format) |
Parses a date string into a DateTime object using the specified format. |
Now |
string Now(string format = "yyyy-MM-dd HH:mm:ss") |
Returns the current date and time as a formatted string. |
DateDiff |
double DateDiffDays(DateTime startDate, DateTime endDate, string interval) |
Calculates the difference between two dates based on a specified interval: "year", "month", "day", or "hour". |
Round |
double Round(double value, int digits) |
Rounds a double value to the specified number of digits. |
Ceiling |
double Ceiling(double value) |
Returns the smallest integer greater than or equal to the specified value. |
Floor |
double Floor(double value) |
Returns the largest integer less than or equal to the specified value. |
Power |
double Power(double baseValue, double exponent) |
Raises baseValue to the power of exponent. |
RegexMatch |
bool RegexMatch(string input, string pattern) |
Checks if the input string matches the specified regular expression pattern. |
RegexReplace |
string RegexReplace(string input, string pattern, string replacement) |
Replaces substrings matching the pattern with the replacement string. |
GenerateGuid |
string GenerateGuid() |
Generates a new GUID as a string. |
Increment |
int Increment(string name) |
Increments the value of the named accumulator and returns the new value. |
Decrement |
int Decrement(string name) |
Decrements the value of the named accumulator and returns the new value. |
GetAccumulator |
int GetAccumulator(string name) |
Retrieves the current value of the named accumulator. |
ResetAccumulator |
void ResetAccumulator(string name) |
Resets the named accumulator to zero. |
Example
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:helper="urn:biztalk:helper-functions"
exclude-result-prefixes="helper">
<xsl:output method="xml" indent="yes"/>
<xsl:template match="/root">
<output>
<upperText>
<xsl:value-of select="helper:ToUpper(name)"/>
</upperText>
<currentDate>
<xsl:value-of select="helper:GetCurrentDateTime('yyyy-MM-dd')"/>
</currentDate>
<counter>
<xsl:value-of select="helper:Increment('myCounter')"/>
</counter>
</output>
</xsl:template>
</xsl:stylesheet>
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET Framework | net48 is compatible. net481 was computed. |
-
.NETFramework 4.8
- No dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.