There was a question asked in MSDN BizTalk forum recently about how to access the ID of the shape/ ShapeID in BizTalk Orchestration.
When Orchestration encounters an unhandled exception, you would see ShapeID in the suspended message:
InstanceId: Instance_ID
Shape name: ThrowException_1
ShapeId: Shape_ID
Exception thrown from: segment 4, progress 3
Inner exception: Exception details.
The questioner wanted to access this ShapeID. To get the ShapeID in orchestration, add a reference to Microsoft.XLANGs.Engine assembly. This assembly is located in the installation directory of your Biztalk server. And following read-only property would get you the ShapeID.
Microsoft.XLANGs.Core.Service.RootService.ExceptionLocation.ShapeID
Though ShapeID property is part of ExceptionLocation, this property would get you the shapeID irrespective of the exception occurred or not.
ShapeID can be used in cases like logging or in custom exception handling in Orchestration. It’s also used to get the name of the shape at runtime. You might want to log the last executed shape or the shape where the failure occurred. It’s most often used to get the name of the shape with the following code:
Microsoft.XLANGs.Core.Service.RootService.FriendlyNameFromShapeId(Microsoft.XLANGs.Core.Service.RootService.ExceptionLocation.ShapeID);
Hi Ashwin,
Thanks for gicing this valuable info, but I am not able to find the ShapeID in ExceptionLocation, gicing Error at Design time saying that “identifier “ShapeID” does not exists in “Microsoft.XLANGs.Core.Service.RootService.ExceptionLocation”.
I have added Microsoft.XLang.Engine.dll as reference also. I am using BizTalk Server 2009.
Hi Thanks for the info…And a small correction we need to refer this dll to get the shapeID
Microsoft.XLANGs.RuntimeTypes
You’ve mangead a first class post