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:
Shape name: ThrowException_1
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.
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: