Biz(Talk)2

Talk, talk and more talk about BizTalk

Add context menu item to Visual Studio

Here’s a nifty way to add a ‘Run in Command Prompt’ context menu item to the Visual Studio solution explorer.

http://www.rickglos.com/post/How-to-run-windows-batch-files-from-Visual-Studio-2010-Solution-Explorer.aspx

Very handy for executing .cmd files to generate .Net type definitions from a BizTalk schema.

May 28, 2013 Posted by | Uncategorized | , | Leave a comment

Terminating an XSLT transform during processing

I have run into an instance where I need to terminate and raise an exception from within an XSLT template, based on values (or lack thereof) within the source document.  The XSLT transform is running within a BizTalk map.

The secret is the following little-known XSLT construct, which can be conditionally called at any point in the transform:

<xsl:message terminate="yes">Custom error text</xsl:message>

This will cause the XSLT engine to stop processing immediately, and raise an exception.   This exception, including the custom error text contained within the message segment, can be caught in the BizTalk Orchestration engine by explicitly catching an exception of type Microsoft.XLANGS.BaseTypes.TransformationFailureException.

May 21, 2013 Posted by | BizTalk, XSLT | , | Leave a comment