Navigation

Search

Categories

 
 

On this page

Custom GetContextProperty Functoid
the exists operator
BTSEasyReflector 1.1 release
MSBTS_*, new features in BizTalk Server 2006

Archive

Blogroll

Disclaimer
The opinions expressed herein are my own personal opinions and do not represent my employer's view in anyway.

RSS 2.0 | Atom 1.0 | CDF

Send mail to the author(s) E-mail

Total Posts: 21
This Year: 0
This Month: 0
This Week: 0
Comments: 29

Sign In
Pick a theme:

 Friday, March 24, 2006
Friday, March 24, 2006 4:17:47 AM (GMT Standard Time, UTC+00:00) ( )

I have listened many times, how can I get a message context property from a map?  Well, while I was playing with the framework of BizTalk Server 2006 RC I found the way to do a functoid that implements this functionality.  I’ll try to explain how I do it below.

First, I have to know three values:

Message Name: the name of the message that have the context property
Property Name: the name of the context property
Property Namespace: the namespace of the context property

Second, I need to get the segments of the service (orchestration) and check in each segment if the message that I’m looking for is there.  The messages aren’t stored directly in the service; the messages are stored in the segments that exist inside the orchestration.  Normally one orchestration has two segments and one more segment when the orchestration implements compensation; the message normally is stored in the second segment (I really don’t know why the segments exist, this is an internal architecture from Microsoft and there isn’t information about that).

Third, when I find the particular message I check the context property (formed by Property Name and Property Namespace) inside the message and return its value.

This is the code that I have used:

// set the property
string property = "";
// get the service
Microsoft.XLANGs.Core.Service s = Microsoft.XLANGs.Core.Service.RootService;
foreach (Microsoft.XLANGs.Core.Segment seg in s._segments)
{
// find the real name of the message
foreach (DictionaryEntry de in Microsoft.XLANGs.Core.Context.FindFields(typeof(Microsoft.XLANGs.BaseTypes.XLANGMessage), seg.ExceptionContext))
{
// check that the key ends with the name of the message
if (de.Key.ToString().EndsWith(val1))
{
// get the message as a XLANGMessage
Microsoft.XLANGs.Core.XMessage msg = de.Value as Microsoft.XLANGs.Core.XMessage;
// if the message was found, then I get the value of the property
if (msg != null)
{
// create a XmlQName instance
Microsoft.XLANGs.BaseTypes.XmlQName qName = new Microsoft.XLANGs.BaseTypes.XmlQName(val2, val3);
// find the message property in the message
if (msg.GetContextProperties().ContainsKey(qName))
{
// get the property from GetContextProperties
property = msg.GetContextProperties()[qName].ToString();
}
else if (msg.GetContentProperties().ContainsKey(qName))
{
// get the property from GetContentProperties
property = msg.GetContentProperties()[qName].ToString();
}
}
break;
}
}
if (property.Length > 0)
break;
}
// return the property value
return property;

Exception :(

Unfortunately this functoid ONLY works if it is invoked from an orchestration… I mean a map inside an orchestration.  The reason is simple, to access to Message I have to get the current context of the service and this service is represented by the orchestration, if the orchestration doesn’t exist I cann’t get the context.

You can download the functoid assembly from GetContextProperty Functoid Workspace

This functoid was developed with the framework of Microsoft BizTalk 2006 RC using the Microsoft.XLANGs.Engine.dll and Microsoft.XLANGs.BasTypes.dll assemblies.  I hope that this functionality exists in the RTM version.

 Thursday, March 16, 2006
Thursday, March 16, 2006 4:15:48 AM (GMT Standard Time, UTC+00:00) ( )

Sometimes, in own orchestrations we need to know if a message context property exists inside one message in particular.  Well, the exists operator is useful in this situation.

The exists operator can be use in Filter expressions or Decide shapes.  The filter expression can determine if a message is welcome in the orchestration or not, and you can use the exists operator to allow messages that contain one or various message context property incoming to process.

But, if you need to take a decision about what way to follow when a message context property exists or not in the message you can use a Decide shape and the exists operator.  The syntax to exists operator is: PropertyName exists MessageName.

For example, if you need to know if the BTS.AckFailurecategory property is inside the message, you must use this expression: BTS.AckFailureCategory exists MessageIn

 Wednesday, March 15, 2006
Wednesday, March 15, 2006 4:15:04 AM (GMT Standard Time, UTC+00:00) ( )

I have developed a new version of BTSEasyReflector.  This new version include the refactoring of the code (I tried to simplify the code), new icons to represent visually each biztalk artifact, and - at last - I added two new classes to write dynamically the properties of each artifact using reflection.

You can visit and download it from BTS Easy Reflector

Note this version was developed with VS .Net 2005 and BizTalk Server 2006 RC.  If you have any question or suggestion, pls send me it to carlos1254@hotmail.com

 Saturday, March 11, 2006
Saturday, March 11, 2006 4:14:18 AM (GMT Standard Time, UTC+00:00) ( )

Microsoft has added new features and changed others in WMI provider to BizTalk Server 2006.  These features include:

  • add two new class MSBTS_SendHandler2 and MSBTS_TrackedMessageInstance2
  • remove the MSBTS_ServiceInstance.ServiceInstanceID property
  • change the definition (properties and methods) of 7 classes

I show below the complete list of changes:

MSBTS_GroupSetting Class

Properties

(+) BizTalkOperatorGroup: Gets the name of the BizTalk Administrator Microsoft® Windows® NT® Group

MSBTS_Host Class

Methods

(+) Cluster: Clusters all BizTalk Host Instances of the given BizTalk Host

(+) GetClusterResourceGroupNames: Returns List of cluster resource groups available

(+) UnCluster: Un-Clusters all BizTalk Host Instances of the given BizTalk Host

MSBTS_HostInstance Class

Properties

(+) ClusterInstanceType: This property tells whether the BizTalk Host Instance NT service is clustered

MSBTS_HostSetting Class

Properties

(+) ClusterResourceGroupName: When the host instances of this host are clustered, this property contains the cluster resource group name set by the Administrator

(+) DBQueueSizeThreshold: Maximum number of items in the Database

(+) DBSessionThreshold: Maximum number of DB Sessions (per CPU) allowed before throttling begins

(+) DeliveryQueueSize: Size of the in-memory Queue that the host maintains as a temporary placeholder for delivering messages

(+) GlobalMemoryThreshold: Maximum System-wide Virtual Memory (in percent) usage allowed before throttling begins

(+) InflightMessageThreshold: Maximum number of in-memory in-flight messages allowed before throttling Message Delivery begins

(+) IsHost32BitOnly: This property indicates whether the host instance process should be created as 32-bit on both 32-bit and 64-bit servers

(+) MessageDeliverySampleSpaceSize: This property indicates the number of samples that are used for determining the rate of the Message Delivery to all Service Classes of the Host

(+) MessageDeliverySampleSpaceWindow: Time-window (in milliseconds) beyond which samples will be deemed invalid for consideration

(+) MessageDeliveryOverdriveFactor: Percent factor by which the system will overdrive the Input rate for Message Delivery Throttling

(+) MessageDeliveryMaximumDelay: Maximum Delay (in milliseconds) imposed for Message Delivery Throttling. Zero indicates disable Message Delivery Throttling

(+) MessagePublishSampleSpaceSize: Number of samples that are used for determining the rate of the Message Publishing by the Service Classes

(+) MessagePublishSampleSpaceWindow: Time-window (in milliseconds) beyond which samples will be deemed invalid for consideration

(+) MessagePublishOverdriveFactor: Percent Factor by which the system will overdrive the Input rate

(+) MessagePublishMaximumDelay: Maximum Delay (in milliseconds) imposed for Message Publishing Throttling. Zero indicates disable Message Publishing Throttling

(+) ThreadPoolSize: Maximum number of messaging engine threads per CPU

(+) ThreadThreshold: Maximum number of threads in the process (per CPU) allowed before throttling begins

(+) ProcessMemoryThreshold: Maximum Process Memory (in percent) allowed before throttling begins

MSBTS_ReceiveLocation Class

Properties

(+) EncryptionCert: Contains the Name of the certificate used for outbound encryption

(+) SendPipeline: Represents the name of the pipeline that will process outbound documents

(+) SendPipelineData: Contains the custom configuration data for the SendPipeline

MSBTS_ReceivePort Class

Properties

(+) RouteFailedMessage: Controls whether failed messages have to be routed to failed message subscribers

(+) MSBTS_SendHandler2 Class

Properties

(+) AdapterName: Contains the name of the adapter used by the given instance

(+) CustomCfg: Contains adapter-specific configuration in XML format

(+) HostName: Contains the name of the BizTalk Host for this transport handler

(+) HostNameToSwitchTo: Contains the name of the BizTalk Host that this transport handler should switch to

(+) IsDefault: Indicates whether the send handler is the default one for this adapter type

MSBTS_SendPort Class

Properties

(+) OrderedDelivery: Determines whether the port should send messages in an ordered manner

(+) StopSendingOnFailure: Controls how EPM handles failures for order delivery enabled send port's primary transport

(+) RouteFailedMessage: Controls whether failed messages have to be routed to failed message subscribers

MSBTS_ServiceInstance Class

Properties

(-) ServiceInstanceID: Contains the ID of the service instance to which this message belongs

(+) MSBTS_TrackedMessageInstance2 Class

Properties

(+) MessageInstanceID: Contains the ID of the message

(+) PartCount: Number of message parts

(+) SourceDBName: Name of the SQL database where the tracked message is stored

(+) SourceDBServerName: Name of the SQL Server where the tracked message is stored

Methods

(+) SaveToFile: This method saves message context and parts into multiple output files

(+) this feature has been added
(-) this feature has been removed

Note: this information was based on BTS 2006 RC documentation, thus, is possible that these features change in BTS 2006 RTM version.