Biz(Talk)2

Talk, talk and more talk about BizTalk

Get the Instance ID of the current Orchestration

Using the following in an Expression shape will return the Instance Id of the Activating Orchestration instance.

instanceId = Microsoft.XLANGs.Core.Service.RootService.InstanceId;

Where instanceId is of type System.Guid.

Note, this will give you the Instance Id of the Activating Orchestration, not neccessarily the currently executing Orchestration.  This distinction is important in the event of the currently executing Orchestration being called as a sub-orchestration via a Call Orchestration, or Start Orchestration shape.

August 24, 2009 Posted by Brett | BizTalk | | No Comments Yet

Xslt snippet – Left pad a string

A quick xslt template to left pad a value:

<xsl:template name="prepend-pad">
  <!-- recursive template to right justify and prepend the value with whatever padChar is passed in   -->
  <xsl:param name="padChar"> </xsl:param>
  <xsl:param name="padVar"/>
  <xsl:param name="length"/>
  <xsl:choose>
    <xsl:when test="string-length($padVar) &lt; $length">
      <xsl:call-template name="prepend-pad">
        <xsl:with-param name="padChar" select="$padChar"/>
        <xsl:with-param name="padVar" select="concat($padChar,$padVar)"/>
        <xsl:with-param name="length" select="$length"/>
      </xsl:call-template>
    </xsl:when>
    <xsl:otherwise>
      <xsl:value-of select="substring($padVar,string-length($padVar) - $length + 1)"/>
    </xsl:otherwise>
  </xsl:choose>
</xsl:template>

August 12, 2009 Posted by Brett | XSLT | , | No Comments Yet