Monday, January 31, 2005

Working with the primitive data types in BizTalk expression editor

If you work with primitive data types (String, Integer, DateTime, etc.) in the expression editor in BizTalk, you might naturally assume they have all of the functionality you find in C# and the .Net framework. It looks like C# so it must be C#. Then I noticed that the types did not support invoking methods on them like in standard .Net.

So you might define variables such as: myString as string and myNum as integer. You cna do the following:

myString = "123";
myNum = System.Int32.Parse(myString);


but you cannot do the following:

myString = myNum.toString();

You can work around this by using the static methods available...

// format as a 11 digit padded number.
myString = System.String.Format("{0:00000000000}", myNum);


What is also unusual is that DateTime and Timespan doesn't have this restriction, so the following is allowed.

TransDate = System.DateTime.Now;
TimeStamp = TransDate.ToString("yyyy-MM-dd-HH.mm.ss.ffffff");


This post from Charles Yound explains how XLANG/s differs from C# in other ways...
http://geekswithblogs.net/cyoung/articles/3820.aspx

No comments: