Sometimes you need to uniquely identifying an object that calls into your assembly. For instance, you may want to record the name of each calling application name or orchestration name and record that information to a SQL database. For Auditing purposes, this can be crucial.
Capturing your assembly name from an orchestration is pretty straight forward (i.e System.Reflection.Assembly.GetCallingAssembly().GetName().Name). But what if you want to pass the name of your orchestration? This requires a little extra XLANGs magic.
All BizTalk VS projects reference the Microsoft.XLANGs assembly … which has a class named “Core” with a property of “RootService” which has several properties including “Name”. The Name property, when called within your orchestration, will return the orchestrations name.
If you get build errors calling this property from an expression shape, you should be able to fix it by creating a String Variable and assigning it the value of RootService (someStringVariable = Microsoft.XLANGs.Core.Service.RootService.Name.ToString()); ). This provides a nice solution for trapping your orchestration names for tracking purposes.
Thanks,
- D