BizTalk Server General - Rule Engine Fact Error

This is Interesting: Free IT Magazines  
Home > Archive > BizTalk Server General > February 2006 > Rule Engine Fact Error





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author Rule Engine Fact Error
Greg

2006-02-20, 8:48 pm

I am trying to test my Rules Policy and am having some trouble. It's fairly
simple - I have a few facts that are retrieved from an XML document, which
isn't causing any problems, but I am also calling a function from a .NET
class. I have created a CreateFacts class that implements IFactCreator which
creates a new instance of the class and returns it in an object array.
However when I add this to the policy and try to test it, I get the error
"Object Reference not set to an instance of an object". The code for the
CreateFacts class is below - fairly simple but maybe I'm doing something
wrong? Any help or ideas would be fantastic.

Thanks,
Greg.

Public Class CreateFacts
Implements IFactCreator
Public Function CreateFacts(ByVal ruleSetInfo As
Microsoft.RuleEngine.RuleSetInfo) As Object() Implements
Microsoft.RuleEngine.IFactCreator.CreateFacts

Dim shortTermFactArray(1) As Object
shortTermFactArray(0) = New SMART.CustomPredicate

Return shortTermFactArray

End Function

Public Function GetFactTypes(ByVal ruleSetInfo As
Microsoft.RuleEngine.RuleSetInfo) As System.Type() Implements
Microsoft.RuleEngine.IFactCreator.GetFactTypes
Return Nothing
End Function
End Class
Leonid Ganeline

2006-02-21, 5:51 pm

Hi Greg,

You should use a Fact Retriever for testing (look at article in BTS Help the
"Creating a Fact Retriever")

Regards,

Leonid Ganeline
BizTalk Developer
Vancouver
http://geekswithblogs.net/leonidganeline/ - you're welcome!
==================================


"Greg" wrote:

> I am trying to test my Rules Policy and am having some trouble. It's fairly
> simple - I have a few facts that are retrieved from an XML document, which
> isn't causing any problems, but I am also calling a function from a .NET
> class. I have created a CreateFacts class that implements IFactCreator which
> creates a new instance of the class and returns it in an object array.
> However when I add this to the policy and try to test it, I get the error
> "Object Reference not set to an instance of an object". The code for the
> CreateFacts class is below - fairly simple but maybe I'm doing something
> wrong? Any help or ideas would be fantastic.
>
> Thanks,
> Greg.
>
> Public Class CreateFacts
> Implements IFactCreator
> Public Function CreateFacts(ByVal ruleSetInfo As
> Microsoft.RuleEngine.RuleSetInfo) As Object() Implements
> Microsoft.RuleEngine.IFactCreator.CreateFacts
>
> Dim shortTermFactArray(1) As Object
> shortTermFactArray(0) = New SMART.CustomPredicate
>
> Return shortTermFactArray
>
> End Function
>
> Public Function GetFactTypes(ByVal ruleSetInfo As
> Microsoft.RuleEngine.RuleSetInfo) As System.Type() Implements
> Microsoft.RuleEngine.IFactCreator.GetFactTypes
> Return Nothing
> End Function
> End Class

Greg

2006-02-22, 2:47 am

Thanks Leonid that worked perfectly. I just didn't find anything in my
searches for fact assertion about FactRetriever, only the FactCreator. What
purpose does the FactCreator serve in testing?

"Leonid Ganeline" wrote:
[vbcol=seagreen]
> Hi Greg,
>
> You should use a Fact Retriever for testing (look at article in BTS Help the
> "Creating a Fact Retriever")
>
> Regards,
>
> Leonid Ganeline
> BizTalk Developer
> Vancouver
> http://geekswithblogs.net/leonidganeline/ - you're welcome!
> ==================================
>
>
> "Greg" wrote:
>
Leonid Ganeline

2006-02-22, 5:57 pm

The FactCreator in not for testing. It's for the Rules.

--

Regards,

Leonid Ganeline
BizTalk developer
Vancouver,
http://geekswithblogs.net/leonidganeline
================================
BizTalk Developer, MCSD,
Vancouver,
http://geekswithblogs.net/leonidganeline/
"Greg" <Greg@discussions.microsoft.com> wrote in message
news:8584E403-A74B-4AC0-B0EC-1786AA813938@microsoft.com...[vbcol=seagreen]
> Thanks Leonid that worked perfectly. I just didn't find anything in my
> searches for fact assertion about FactRetriever, only the FactCreator.
> What
> purpose does the FactCreator serve in testing?
>
> "Leonid Ganeline" wrote:
>


Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com