How to debug this?

Mar 16, 2010 at 4:06 PM

I am using your BRE extension and got the following error. How can I debug this? Thanks!

An exception occurred inside the rule engine instance executing policy "Resolve2WayEndPoint".

Source: Microsoft.Practices.ESB.Resolver.ResolverMgr

Method: System.Collections.Generic.Dictionary`2[System.String,System.String] Resolve(Microsoft.Practices.ESB.Resolver.ResolverInfo, Microsoft.BizTalk.Message.Interop.IBaseMessage, Microsoft.BizTalk.Component.Interop.IPipelineContext)

Error Source: Microsoft.RuleEngine

Error TargetSite: Void ExecuteInternal(System.Object) 

Error StackTrace:    at Microsoft.RuleEngine.Policy.ExecuteInternal(Object facts)
   at Microsoft.RuleEngine.Policy.Execute(Object facts)
   at Microsoft.RuleEngine.Policy.Execute(Object[] facts)
   at Tellago.SOA.ESB.Extensions.Resolvers.BRE_ResolverProvider.ResolveRules(String config, String resolver, XmlDocument message, Resolution resolution, BRE bre, Dictionary`2 ctxtValues)
   at Tellago.SOA.ESB.Extensions.Resolvers.BRE_ResolverProvider.Microsoft.Practices.ESB.Resolver.IResolveProvider.Resolve(String config, String resolver, IBaseMessage message, IPipelineContext pipelineContext)
   at Microsoft.Practices.ESB.Resolver.Unity.ResolveProvider.Resolve(String config, String resolver, IBaseMessage message, IPipelineContext pipelineContext)
   at Microsoft.Practices.ESB.Resolver.ResolverMgr.Resolve(ResolverInfo info, IBaseMessage message, IPipelineContext pipelineContext)

For more information, see Help and Support Center at http://go.microsoft.com/fwlink/events.asp.

Coordinator
Mar 17, 2010 at 2:50 PM

If you download the source, you can pass in a Debugging Interceptor class which is notified when the Rule Facts Loads, and Fires. More info can be found here: http://msdn.microsoft.com/en-us/library/aa995579%28BTS.20%29.aspx

 

This will allow you to debug the rules. From the appearance of the policy the error is occurring inside your BRE Policy execution. From the looks of the exception message you are trying to use the Collection object as a whole in the BRE. Are  you? Are you using the Colleciton inside the Policy or using the GetItem/SetItem methods? If so, using the collection as a whole is not supported by the BRE without jumping through a bunch of loops....

 

HTH

 

Mar 17, 2010 at 4:06 PM

I used GetItem. But the context property is a soap header whose value is XML. Wonder if that's the problem.

I will try to figure out how to use Debugging Interceptor.

Coordinator
Mar 17, 2010 at 4:56 PM

Hmm, if the value is a Soap Header, then the GetItem just returns the "string" of what ever the value is.Again, if you have the source code, you can always attach to the BTSNTSvc.exe process when running your example to step through the MessageContextFactRetriever Code. The DebugTrackingInterceptor is to log details about when the Policy executes.

 

HTH

Mar 17, 2010 at 5:09 PM

Unfortunately, it's a Soap Receive loaction which uses Isolated host. Can you give me more details on how to use DebugTrackingInterceptor? The link you gave me is something else? Thanks!

Coordinator
Mar 18, 2010 at 2:33 PM

Ok, if its an isolated host you can attach to IIS- w3wp.exe (IIS 7.0) however you'll have to figure out which w3wp.exe (http://www.bearcanyon.com/tools/#apdebug) or aspnet_wp.exe (IIS 6.0 and below). Use VS.NET to attache the debugger to one of these processes.

 

To use the debug tracking interceptor:

DebugTrackingInterceptor dti = new DebugTrackingInterceptor("PolicyTracking.txt");
policy.Execute(facts, dti);

 

In the source code you'll need to replace the call to policy.Execute with the lines above. This will log the details of what facts are loading, conditions evaualte, actions added and fired to the "PolicyTracking.txt" file when the policy runs. This allows you to see what the actual values are when the conditions are being evaluated.

 

 

 

Mar 18, 2010 at 10:36 PM

The following is Policy trace. I wonder if it's because I am using 64 bit.

 

RULE ENGINE TRACE for RULESET: Resolve2WayEndPoint 3/18/2010 5:31:14 PM

FACT ACTIVITY 3/18/2010 5:31:14 PM
Rule Engine Instance Identifier: 38635a78-cab4-432d-8561-af9c6b04ac8c
Ruleset Name: Resolve2WayEndPoint
Operation: Assert
Object Type: Microsoft.Practices.ESB.Resolver.Resolution
Object Instance Identifier: 48472896

FACT ACTIVITY 3/18/2010 5:31:14 PM
Rule Engine Instance Identifier: 38635a78-cab4-432d-8561-af9c6b04ac8c
Ruleset Name: Resolve2WayEndPoint
Operation: Assert - Fact Unrecognized
Object Type: TypedXmlDocument:Microsoft.Practices.ESB.ResolveProviderMessage
Object Instance Identifier: 10047913

FACT ACTIVITY 3/18/2010 5:31:14 PM
Rule Engine Instance Identifier: 38635a78-cab4-432d-8561-af9c6b04ac8c
Ruleset Name: Resolve2WayEndPoint
Operation: Assert - Fact Unrecognized
Object Type: Microsoft.Practices.ESB.Resolver.Itinerary.Facts.ItineraryFact
Object Instance Identifier: 62409056

FACT ACTIVITY 3/18/2010 5:31:14 PM
Rule Engine Instance Identifier: 38635a78-cab4-432d-8561-af9c6b04ac8c
Ruleset Name: Resolve2WayEndPoint
Operation: Assert
Object Type: Tellago.SOA.ESB.Extensions.MessageContextFactRetriever
Object Instance Identifier: 59567267

FACT ACTIVITY 3/18/2010 5:31:14 PM
Rule Engine Instance Identifier: 38635a78-cab4-432d-8561-af9c6b04ac8c
Ruleset Name: Resolve2WayEndPoint
Operation: Retract
Object Type: Microsoft.RuleEngine.RETRACTALL
Object Instance Identifier: 0

Mar 19, 2010 at 7:48 PM

OK. Makeing progress.  I found out, in  in BRE_ResolveProvider.cs class, after "ItineraryFact itineraryInfo =new ItineraryFact()", the members of Object intineraryInfo are NULL. So, I got error messages,

"Procedure or function 'Itinerary_getitinerary' expects parameter '@name', which was not supplied." in function SetAllResolutionDictionaryEntries.

 

 

Coordinator
Mar 20, 2010 at 12:13 AM
Edited Mar 20, 2010 at 12:15 AM

Ok, this is correct, as we are not populating the ItineraryFact with any data. It was meant to be used to "Set" the itinerary, not "Get" the Itinerary... Let us know if this would be a nice feature to have...

I'm thinking if we provided that feature, then the idea would be you could retrieve the current step, and change the step to be something else. This could work, we would just have to invalidate the Itinerary Cache, and reload it with the new Itinterary Steps that may be injected. Is this what you're attempting to accomplish?

 

Mar 20, 2010 at 1:32 AM

OK. I am actually using this to do end point resolution in the itinerary. Looks like your component can only be used for itinerary resolution. Do you see an easy way to modify it to work for both?

Coordinator
Mar 20, 2010 at 1:30 PM

Endpoint resolution works normally.

Are you trying to read the Itinerary data in your business Rule?, if so this is what I mean by "Get" itinerary data. This version doesn't allow you to retrieve the Itinerary during your rule, and then based off of some step, set the endpoint. However you can just set the endpoint. Are you seeing something different? If so please log it as an issue.

Coordinator
Mar 20, 2010 at 2:43 PM

Ok, I see where you're running into problems, I'll log it as an issue for the next release. Thanks for the resolving endpoint issue...

 

Coordinator
Mar 21, 2010 at 11:20 PM

ok the latest source code works for both Itineraries and Default Resolution.