Sunday 1 April 2018

Optimizing BizTalk Map Execution and Modularizing Map using Import XSLT


Here in this article, I would brief about optimizing map execution using XSL Compile Transformation and achieve Importing XSLT using helper component.

Let go straight into mapping scenarios, below is a use case where we have huge Inline XSLT code, this can be moved to separate xsl file as template and this file should be embedded as resource in BizTalk  assembly. As you see, we have moved the code to separate XSL file and within BizTalk using XSLT Scripting functiod, we would just call the actually template.
There can be a use case, where we have complete custom xsl instead of BizTalk mapper. Here, we have the main custom XSL which invokes the template in other XSL files. Refer below for the child template XSL files. Just to generalize, implementation here, I have created multiple child template XSL files and master template file which just imports these child templates and during runtime, we would import the master template in the BizTalk Map/Custom XSL file using Custom helper component.
Here is use case of multi-part message, we would use a similar approach to earlier one but challenge  is to merge/construct a multi-part message for our execution.
Overview of XSLCompiledTranformHelper, this would be used from orchestrations instead of Transform shape
Critical methods are shown below, if you observe GetMapInfo method, we dynamically import the master template xsl file and EmbeddedResourceResolver resolves imported xsl templates from the assembly.
Here are few critical helper classes.

Here is our orchestration uses XSLCompiledTransformHelper for transformation as shown below, which executes maps for different use cases mentioned in our problem statement.

Multiple part message can be executed either by combining messages into single message and executing the transform or by directly invoking the transform method with message params, as shown below.
I have referred below articles and added this feature to the XSL Compile Transformation component.
  • https://blogs.msdn.microsoft.com/paolos/2010/01/29/how-to-boost-message-transformations-using-the-xslcompiledtransform-class/
  • https://blogs.msdn.microsoft.com/paolos/2010/04/08/how-to-boost-message-transformations-using-the-xslcompiledtransform-class-extended/

No comments:

Post a Comment

Note: only a member of this blog may post a comment.