Discussion:
BizTalk 2004 Business Rule Engine - Fact Unrecognized
(too old to reply)
whidbeywave
2005-03-26 04:01:14 UTC
Permalink
Hi,

When i run my scenario as test policy in BRC, rules are fired, and I
get the correct results. But when I try to execute() using Policy or
PolicyTester, the same scenario does not fire any rules. I am trying
the sample from Biztalk Server 2004 Unleashed - chapter 11. (business
rules). While i set the trace I got this log below:

RULE ENGINE TRACE for RULESET: RFP 3/25/2005 9:17:47 PM

FACT ACTIVITY 3/25/2005 9:17:47 PM
Rule Engine Instance Identifier: ca78aed8-f829-4be6-a7b3-15b749daae30
Ruleset Name: RFP
Operation: Assert - Fact Unrecognized
Object Type: TypedXmlDocument:RFPEstimateXML.RulesRFP
Object Instance Identifier: 40

FACT ACTIVITY 3/25/2005 9:17:47 PM
Rule Engine Instance Identifier: ca78aed8-f829-4be6-a7b3-15b749daae30
Ruleset Name: RFP
Operation: Retract - Fact Unrecognized
Object Type: TypedXmlDocument:RFPEstimateXML.RulesRFP
Object Instance Identifier: 40

Thanks for all the help in advance.
Wave
Matt Milner
2005-03-26 23:53:40 UTC
Permalink
Your document is likely not properly named according to your rules. make
sure the name you are using in your code matches the name in the policy.

matt
Post by whidbeywave
Hi,
When i run my scenario as test policy in BRC, rules are fired, and I
get the correct results. But when I try to execute() using Policy or
PolicyTester, the same scenario does not fire any rules. I am trying
the sample from Biztalk Server 2004 Unleashed - chapter 11. (business
RULE ENGINE TRACE for RULESET: RFP 3/25/2005 9:17:47 PM
FACT ACTIVITY 3/25/2005 9:17:47 PM
Rule Engine Instance Identifier: ca78aed8-f829-4be6-a7b3-15b749daae30
Ruleset Name: RFP
Operation: Assert - Fact Unrecognized
Object Type: TypedXmlDocument:RFPEstimateXML.RulesRFP
Object Instance Identifier: 40
FACT ACTIVITY 3/25/2005 9:17:47 PM
Rule Engine Instance Identifier: ca78aed8-f829-4be6-a7b3-15b749daae30
Ruleset Name: RFP
Operation: Retract - Fact Unrecognized
Object Type: TypedXmlDocument:RFPEstimateXML.RulesRFP
Object Instance Identifier: 40
Thanks for all the help in advance.
Wave
whidbeywave
2005-03-27 16:55:01 UTC
Permalink
Thanks Matt,
You sound logical :-o). I believe the document you mentioned in mail is
xml file, which acts as input, so here are the xsd and xml and piece of
code which involves in action. I would really appreciate if you can
point my mistake. I am troubled with XML namespaces at the moment. The
example I have picked up is from book microsoft biztalk server
unleashed 2004. Since it is from Que publication, a soft copy of this
chapter 11 (business rule) is also kept on Que publication website.

---------------------xml file which is input----------
<ns0:RFP xmlns:ns0="http://RFPEstimateXML.RulesRFP">
<Company>General Chaos 37</Company>
<Service>Programming</Service>
<Hours>10</Hours>
<Estimate>320</Estimate>
<Approved>true</Approved>
<Notes>Normal Rate Approved</Notes>
</ns0:RFP>

--------------------XSD involved in defining vocabulary------

<?xml version="1.0" encoding="utf-16"?>
<xs:schema xmlns="http://RFPEstimateXML.RulesRFP"
xmlns:b="http://schemas.microsoft.com/BizTalk/2003"
targetNamespace="http://RFPEstimateXML.RulesRFP"
xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="RFP">
<xs:annotation>
<xs:appinfo>
<b:recordInfo rootTypeName="RFPType"
xmlns:b="http://schemas.microsoft.com/BizTalk/2003" />
<b:properties>
<b:property distinguished="true" xpath="/*[local-name()='RFP'
and
namespace-uri()='http://RFPEstimateXML.RulesRFP']/*[local-name()='Approved'
and namespace-uri()='']" />
<b:property distinguished="true" xpath="/*[local-name()='RFP'
and
namespace-uri()='http://RFPEstimateXML.RulesRFP']/*[local-name()='Notes'
and namespace-uri()='']" />
</b:properties>
</xs:appinfo>
</xs:annotation>
<xs:complexType>
<xs:sequence>
<xs:element minOccurs="0" maxOccurs="1" name="Company"
type="xs:string" />
<xs:element minOccurs="1" maxOccurs="1" name="Service">
<xs:complexType>
<xs:simpleContent>
<xs:extension base="xs:string" />
</xs:simpleContent>
</xs:complexType>
</xs:element>
<xs:element minOccurs="1" maxOccurs="1" name="Hours"
type="xs:decimal" />
<xs:element minOccurs="1" maxOccurs="1" name="Estimate"
type="xs:decimal" />
<xs:element minOccurs="1" maxOccurs="1" default="false"
name="Approved" type="xs:boolean" />
<xs:element minOccurs="1" maxOccurs="1" name="Notes"
type="xs:string" />
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>


-------------finally the code for typed xml document---------------

XmlDocument doc = new XmlDocument();
doc.Load("sample_rfp.xml");
TypedXmlDocument RFPDoc = new
TypedXmlDocument("RFPEstimateXML.RulesRFP", doc);


Once again thanks a lot.
Wave.
Post by Matt Milner
Your document is likely not properly named according to your rules.
make
Post by Matt Milner
sure the name you are using in your code matches the name in the policy.
matt
Post by whidbeywave
Hi,
When i run my scenario as test policy in BRC, rules are fired, and I
get the correct results. But when I try to execute() using Policy or
PolicyTester, the same scenario does not fire any rules. I am trying
the sample from Biztalk Server 2004 Unleashed - chapter 11.
(business
Post by Matt Milner
Post by whidbeywave
RULE ENGINE TRACE for RULESET: RFP 3/25/2005 9:17:47 PM
FACT ACTIVITY 3/25/2005 9:17:47 PM
ca78aed8-f829-4be6-a7b3-15b749daae30
Post by Matt Milner
Post by whidbeywave
Ruleset Name: RFP
Operation: Assert - Fact Unrecognized
Object Type: TypedXmlDocument:RFPEstimateXML.RulesRFP
Object Instance Identifier: 40
FACT ACTIVITY 3/25/2005 9:17:47 PM
ca78aed8-f829-4be6-a7b3-15b749daae30
Post by Matt Milner
Post by whidbeywave
Ruleset Name: RFP
Operation: Retract - Fact Unrecognized
Object Type: TypedXmlDocument:RFPEstimateXML.RulesRFP
Object Instance Identifier: 40
Thanks for all the help in advance.
Wave
Matt Milner
2005-03-28 13:34:27 UTC
Permalink
In your business rule policy, check the places where you use the xml
document and make sure they have this same name in them:
RFPEstimateXML.RulesRFP. If they just have RulesRFP, that is your problem.
When you create the vocabulary item, or open a schema in the vocabulary
explorer, you often have to change the document type name to match what you
are going to be using from an orchestration or code.

Matt
Post by whidbeywave
Thanks Matt,
You sound logical :-o). I believe the document you mentioned in mail is
xml file, which acts as input, so here are the xsd and xml and piece of
code which involves in action. I would really appreciate if you can
point my mistake. I am troubled with XML namespaces at the moment. The
example I have picked up is from book microsoft biztalk server
unleashed 2004. Since it is from Que publication, a soft copy of this
chapter 11 (business rule) is also kept on Que publication website.
---------------------xml file which is input----------
<ns0:RFP xmlns:ns0="http://RFPEstimateXML.RulesRFP">
<Company>General Chaos 37</Company>
<Service>Programming</Service>
<Hours>10</Hours>
<Estimate>320</Estimate>
<Approved>true</Approved>
<Notes>Normal Rate Approved</Notes>
</ns0:RFP>
--------------------XSD involved in defining vocabulary------
<?xml version="1.0" encoding="utf-16"?>
<xs:schema xmlns="http://RFPEstimateXML.RulesRFP"
xmlns:b="http://schemas.microsoft.com/BizTalk/2003"
targetNamespace="http://RFPEstimateXML.RulesRFP"
xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="RFP">
<xs:annotation>
<xs:appinfo>
<b:recordInfo rootTypeName="RFPType"
xmlns:b="http://schemas.microsoft.com/BizTalk/2003" />
<b:properties>
<b:property distinguished="true" xpath="/*[local-name()='RFP'
and
namespace-uri()='http://RFPEstimateXML.RulesRFP']/*[local-name()='Approved'
and namespace-uri()='']" />
<b:property distinguished="true" xpath="/*[local-name()='RFP'
and
namespace-uri()='http://RFPEstimateXML.RulesRFP']/*[local-name()='Notes'
and namespace-uri()='']" />
</b:properties>
</xs:appinfo>
</xs:annotation>
<xs:complexType>
<xs:sequence>
<xs:element minOccurs="0" maxOccurs="1" name="Company"
type="xs:string" />
<xs:element minOccurs="1" maxOccurs="1" name="Service">
<xs:complexType>
<xs:simpleContent>
<xs:extension base="xs:string" />
</xs:simpleContent>
</xs:complexType>
</xs:element>
<xs:element minOccurs="1" maxOccurs="1" name="Hours"
type="xs:decimal" />
<xs:element minOccurs="1" maxOccurs="1" name="Estimate"
type="xs:decimal" />
<xs:element minOccurs="1" maxOccurs="1" default="false"
name="Approved" type="xs:boolean" />
<xs:element minOccurs="1" maxOccurs="1" name="Notes"
type="xs:string" />
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
-------------finally the code for typed xml document---------------
XmlDocument doc = new XmlDocument();
doc.Load("sample_rfp.xml");
TypedXmlDocument RFPDoc = new
TypedXmlDocument("RFPEstimateXML.RulesRFP", doc);
Once again thanks a lot.
Wave.
Post by Matt Milner
Your document is likely not properly named according to your rules.
make
Post by Matt Milner
sure the name you are using in your code matches the name in the
policy.
Post by Matt Milner
matt
Post by whidbeywave
Hi,
When i run my scenario as test policy in BRC, rules are fired, and
I
Post by Matt Milner
Post by whidbeywave
get the correct results. But when I try to execute() using Policy
or
Post by Matt Milner
Post by whidbeywave
PolicyTester, the same scenario does not fire any rules. I am
trying
Post by Matt Milner
Post by whidbeywave
the sample from Biztalk Server 2004 Unleashed - chapter 11.
(business
Post by Matt Milner
Post by whidbeywave
RULE ENGINE TRACE for RULESET: RFP 3/25/2005 9:17:47 PM
FACT ACTIVITY 3/25/2005 9:17:47 PM
ca78aed8-f829-4be6-a7b3-15b749daae30
Post by Matt Milner
Post by whidbeywave
Ruleset Name: RFP
Operation: Assert - Fact Unrecognized
Object Type: TypedXmlDocument:RFPEstimateXML.RulesRFP
Object Instance Identifier: 40
FACT ACTIVITY 3/25/2005 9:17:47 PM
ca78aed8-f829-4be6-a7b3-15b749daae30
Post by Matt Milner
Post by whidbeywave
Ruleset Name: RFP
Operation: Retract - Fact Unrecognized
Object Type: TypedXmlDocument:RFPEstimateXML.RulesRFP
Object Instance Identifier: 40
Thanks for all the help in advance.
Wave
Atjeh
2005-04-04 03:09:02 UTC
Permalink
It is work if I'm not using database for condition in policy and vocabulary.
However when I try for using database for condition in policy rule, the codes
are just copying sample_rfp.xml become ProcessedRFP.xml with nothing process,
I use Policy class for execute it. When I try for using Policy Tester, the
program will exit at code :
rfpRules.ExecutionConfiguration = exConfig;
with message :
System.NullReferenceException: Object reference not set to ....ect.at
Que.BizTalk.Rules.RFPHost.Main<String[] args> in
c:\......\rfprulehost.cs:line 42

I'm in stuck.I'm really appreciate your attention.
Post by Matt Milner
In your business rule policy, check the places where you use the xml
RFPEstimateXML.RulesRFP. If they just have RulesRFP, that is your problem.
When you create the vocabulary item, or open a schema in the vocabulary
explorer, you often have to change the document type name to match what you
are going to be using from an orchestration or code.
Matt
Post by whidbeywave
Thanks Matt,
You sound logical :-o). I believe the document you mentioned in mail is
xml file, which acts as input, so here are the xsd and xml and piece of
code which involves in action. I would really appreciate if you can
point my mistake. I am troubled with XML namespaces at the moment. The
example I have picked up is from book microsoft biztalk server
unleashed 2004. Since it is from Que publication, a soft copy of this
chapter 11 (business rule) is also kept on Que publication website.
---------------------xml file which is input----------
<ns0:RFP xmlns:ns0="http://RFPEstimateXML.RulesRFP">
<Company>General Chaos 37</Company>
<Service>Programming</Service>
<Hours>10</Hours>
<Estimate>320</Estimate>
<Approved>true</Approved>
<Notes>Normal Rate Approved</Notes>
</ns0:RFP>
--------------------XSD involved in defining vocabulary------
<?xml version="1.0" encoding="utf-16"?>
<xs:schema xmlns="http://RFPEstimateXML.RulesRFP"
xmlns:b="http://schemas.microsoft.com/BizTalk/2003"
targetNamespace="http://RFPEstimateXML.RulesRFP"
xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="RFP">
<xs:annotation>
<xs:appinfo>
<b:recordInfo rootTypeName="RFPType"
xmlns:b="http://schemas.microsoft.com/BizTalk/2003" />
<b:properties>
<b:property distinguished="true" xpath="/*[local-name()='RFP'
and
namespace-uri()='http://RFPEstimateXML.RulesRFP']/*[local-name()='Approved'
and namespace-uri()='']" />
<b:property distinguished="true" xpath="/*[local-name()='RFP'
and
namespace-uri()='http://RFPEstimateXML.RulesRFP']/*[local-name()='Notes'
and namespace-uri()='']" />
</b:properties>
</xs:appinfo>
</xs:annotation>
<xs:complexType>
<xs:sequence>
<xs:element minOccurs="0" maxOccurs="1" name="Company"
type="xs:string" />
<xs:element minOccurs="1" maxOccurs="1" name="Service">
<xs:complexType>
<xs:simpleContent>
<xs:extension base="xs:string" />
</xs:simpleContent>
</xs:complexType>
</xs:element>
<xs:element minOccurs="1" maxOccurs="1" name="Hours"
type="xs:decimal" />
<xs:element minOccurs="1" maxOccurs="1" name="Estimate"
type="xs:decimal" />
<xs:element minOccurs="1" maxOccurs="1" default="false"
name="Approved" type="xs:boolean" />
<xs:element minOccurs="1" maxOccurs="1" name="Notes"
type="xs:string" />
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
-------------finally the code for typed xml document---------------
XmlDocument doc = new XmlDocument();
doc.Load("sample_rfp.xml");
TypedXmlDocument RFPDoc = new
TypedXmlDocument("RFPEstimateXML.RulesRFP", doc);
Once again thanks a lot.
Wave.
Post by Matt Milner
Your document is likely not properly named according to your rules.
make
Post by Matt Milner
sure the name you are using in your code matches the name in the
policy.
Post by Matt Milner
matt
Post by whidbeywave
Hi,
When i run my scenario as test policy in BRC, rules are fired, and
I
Post by Matt Milner
Post by whidbeywave
get the correct results. But when I try to execute() using Policy
or
Post by Matt Milner
Post by whidbeywave
PolicyTester, the same scenario does not fire any rules. I am
trying
Post by Matt Milner
Post by whidbeywave
the sample from Biztalk Server 2004 Unleashed - chapter 11.
(business
Post by Matt Milner
Post by whidbeywave
RULE ENGINE TRACE for RULESET: RFP 3/25/2005 9:17:47 PM
FACT ACTIVITY 3/25/2005 9:17:47 PM
ca78aed8-f829-4be6-a7b3-15b749daae30
Post by Matt Milner
Post by whidbeywave
Ruleset Name: RFP
Operation: Assert - Fact Unrecognized
Object Type: TypedXmlDocument:RFPEstimateXML.RulesRFP
Object Instance Identifier: 40
FACT ACTIVITY 3/25/2005 9:17:47 PM
ca78aed8-f829-4be6-a7b3-15b749daae30
Post by Matt Milner
Post by whidbeywave
Ruleset Name: RFP
Operation: Retract - Fact Unrecognized
Object Type: TypedXmlDocument:RFPEstimateXML.RulesRFP
Object Instance Identifier: 40
Thanks for all the help in advance.
Wave
Matt Milner
2005-04-06 03:26:54 UTC
Permalink
Make sure you are asserting a dataconnection or datarow/table into the
engine either through a fact retriever or your code. Somehow the data
connection has to get in there.

matt
Post by Atjeh
It is work if I'm not using database for condition in policy and vocabulary.
However when I try for using database for condition in policy rule, the codes
are just copying sample_rfp.xml become ProcessedRFP.xml with nothing process,
I use Policy class for execute it. When I try for using Policy Tester, the
rfpRules.ExecutionConfiguration = exConfig;
System.NullReferenceException: Object reference not set to ....ect.at
Que.BizTalk.Rules.RFPHost.Main<String[] args> in
c:\......\rfprulehost.cs:line 42
I'm in stuck.I'm really appreciate your attention.
Post by Matt Milner
In your business rule policy, check the places where you use the xml
RFPEstimateXML.RulesRFP. If they just have RulesRFP, that is your problem.
When you create the vocabulary item, or open a schema in the vocabulary
explorer, you often have to change the document type name to match what you
are going to be using from an orchestration or code.
Matt
Post by whidbeywave
Thanks Matt,
You sound logical :-o). I believe the document you mentioned in mail is
xml file, which acts as input, so here are the xsd and xml and piece of
code which involves in action. I would really appreciate if you can
point my mistake. I am troubled with XML namespaces at the moment. The
example I have picked up is from book microsoft biztalk server
unleashed 2004. Since it is from Que publication, a soft copy of this
chapter 11 (business rule) is also kept on Que publication website.
---------------------xml file which is input----------
<ns0:RFP xmlns:ns0="http://RFPEstimateXML.RulesRFP">
<Company>General Chaos 37</Company>
<Service>Programming</Service>
<Hours>10</Hours>
<Estimate>320</Estimate>
<Approved>true</Approved>
<Notes>Normal Rate Approved</Notes>
</ns0:RFP>
--------------------XSD involved in defining vocabulary------
<?xml version="1.0" encoding="utf-16"?>
<xs:schema xmlns="http://RFPEstimateXML.RulesRFP"
xmlns:b="http://schemas.microsoft.com/BizTalk/2003"
targetNamespace="http://RFPEstimateXML.RulesRFP"
xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="RFP">
<xs:annotation>
<xs:appinfo>
<b:recordInfo rootTypeName="RFPType"
xmlns:b="http://schemas.microsoft.com/BizTalk/2003" />
<b:properties>
<b:property distinguished="true" xpath="/*[local-name()='RFP'
and
namespace-uri()='http://RFPEstimateXML.RulesRFP']/*[local-name()='Approved'
and namespace-uri()='']" />
<b:property distinguished="true" xpath="/*[local-name()='RFP'
and
namespace-uri()='http://RFPEstimateXML.RulesRFP']/*[local-name()='Notes'
and namespace-uri()='']" />
</b:properties>
</xs:appinfo>
</xs:annotation>
<xs:complexType>
<xs:sequence>
<xs:element minOccurs="0" maxOccurs="1" name="Company"
type="xs:string" />
<xs:element minOccurs="1" maxOccurs="1" name="Service">
<xs:complexType>
<xs:simpleContent>
<xs:extension base="xs:string" />
</xs:simpleContent>
</xs:complexType>
</xs:element>
<xs:element minOccurs="1" maxOccurs="1" name="Hours"
type="xs:decimal" />
<xs:element minOccurs="1" maxOccurs="1" name="Estimate"
type="xs:decimal" />
<xs:element minOccurs="1" maxOccurs="1" default="false"
name="Approved" type="xs:boolean" />
<xs:element minOccurs="1" maxOccurs="1" name="Notes"
type="xs:string" />
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
-------------finally the code for typed xml document---------------
XmlDocument doc = new XmlDocument();
doc.Load("sample_rfp.xml");
TypedXmlDocument RFPDoc = new
TypedXmlDocument("RFPEstimateXML.RulesRFP", doc);
Once again thanks a lot.
Wave.
Post by Matt Milner
Your document is likely not properly named according to your rules.
make
Post by Matt Milner
sure the name you are using in your code matches the name in the
policy.
Post by Matt Milner
matt
Post by whidbeywave
Hi,
When i run my scenario as test policy in BRC, rules are fired, and
I
Post by Matt Milner
Post by whidbeywave
get the correct results. But when I try to execute() using Policy
or
Post by Matt Milner
Post by whidbeywave
PolicyTester, the same scenario does not fire any rules. I am
trying
Post by Matt Milner
Post by whidbeywave
the sample from Biztalk Server 2004 Unleashed - chapter 11.
(business
Post by Matt Milner
Post by whidbeywave
RULE ENGINE TRACE for RULESET: RFP 3/25/2005 9:17:47 PM
FACT ACTIVITY 3/25/2005 9:17:47 PM
ca78aed8-f829-4be6-a7b3-15b749daae30
Post by Matt Milner
Post by whidbeywave
Ruleset Name: RFP
Operation: Assert - Fact Unrecognized
Object Type: TypedXmlDocument:RFPEstimateXML.RulesRFP
Object Instance Identifier: 40
FACT ACTIVITY 3/25/2005 9:17:47 PM
ca78aed8-f829-4be6-a7b3-15b749daae30
Post by Matt Milner
Post by whidbeywave
Ruleset Name: RFP
Operation: Retract - Fact Unrecognized
Object Type: TypedXmlDocument:RFPEstimateXML.RulesRFP
Object Instance Identifier: 40
Thanks for all the help in advance.
Wave
Atjeh Tsu
2005-04-08 05:53:05 UTC
Permalink
Sorry Matt, I don't get your point.
I'll try to add dbFactRetriever (fact retriever for this sample) in fact
retriever property, but there aren't option for select dbFactRetriever.
Here is the Tracking Output of my policy (I make simple for the rule)
RULE ENGINE TRACE for RULESET: RFP 08/04/2005 6:53:57

FACT ACTIVITY 08/04/2005 6:53:57
Rule Engine Instance Identifier: 78cb2950-1fff-42bc-8bf4-6f8df4f1515d
Ruleset Name: RFP
Operation: Assert
Object Type: TypedXmlDocument:RFPEstimateXML.RulesRFP
Object Instance Identifier: 74

FACT ACTIVITY 08/04/2005 6:53:57
Rule Engine Instance Identifier: 78cb2950-1fff-42bc-8bf4-6f8df4f1515d
Ruleset Name: RFP
Operation: Assert
Object Type: TypedXmlDocument:RFPEstimateXML.RulesRFP:/*[local-name()='RFP'
and namespace-uri()='http://RFPEstimateXML.RulesRFP']
Object Instance Identifier: 75

CONDITION EVALUATION TEST (MATCH) 08/04/2005 6:53:57
Rule Engine Instance Identifier: 78cb2950-1fff-42bc-8bf4-6f8df4f1515d
Ruleset Name: RFP
Test Expression:
TypedXmlDocument:RFPEstimateXML.RulesRFP:/*[local-name()='RFP' and
namespace-uri()='http://RFPEstimateXML.RulesRFP'].Hours > 160
Left Operand Value: 180
Right Operand Value: 160
Test Result: True

CONDITION EVALUATION TEST (MATCH) 08/04/2005 6:53:57
Rule Engine Instance Identifier: 78cb2950-1fff-42bc-8bf4-6f8df4f1515d
Ruleset Name: RFP
Test Expression:
TypedXmlDocument:RFPEstimateXML.RulesRFP:/*[local-name()='RFP' and
namespace-uri()='http://RFPEstimateXML.RulesRFP'].Hours <= 160
Left Operand Value: 180
Right Operand Value: 160
Test Result: False

FACT ACTIVITY 08/04/2005 6:53:57
Rule Engine Instance Identifier: 78cb2950-1fff-42bc-8bf4-6f8df4f1515d
Ruleset Name: RFP
Operation: Retract
Object Type: TypedXmlDocument:RFPEstimateXML.RulesRFP
Object Instance Identifier: 74

FACT ACTIVITY 08/04/2005 6:53:57
Rule Engine Instance Identifier: 78cb2950-1fff-42bc-8bf4-6f8df4f1515d
Ruleset Name: RFP
Operation: Retract
Object Type: TypedXmlDocument:RFPEstimateXML.RulesRFP:/*[local-name()='RFP'
and namespace-uri()='http://RFPEstimateXML.RulesRFP']
Object Instance Identifier: 75

Thank you for your reply.
Post by Matt Milner
Make sure you are asserting a dataconnection or datarow/table into the
engine either through a fact retriever or your code. Somehow the data
connection has to get in there.
matt
Atjeh Tsu
2005-04-11 14:25:34 UTC
Permalink
Yup, I have asserted a dataconnection in my fact retriever code. But it still
doesn't work properly.
This is my code :
public class RFPDbFactRetriever:IFactRetriever
{

public object UpdateFacts(RuleSetInfo rulesetInfo,
Microsoft.RuleEngine.RuleEngine engine, object factsHandleIn)
{
object factsHandleOut;

// The following logic asserts the required DB rows only once and
always uses the the same values (cached) during the first retrieval in
subsequent execution cycles
//if (factsHandleIn == null)
{

SqlConnection con1 = new SqlConnection("Initial
Catalog=Consulting;Data Source=(local);Integrated Security=SSPI;");
DataConnection dc1 = new DataConnection("Consulting", "Rates",
con1);
engine.Assert(dc1);

factsHandleOut = dc1;
}

// else
// factsHandleOut = factsHandleIn;

return factsHandleOut;
}

thank you for the attention in advance.
Post by Matt Milner
Make sure you are asserting a dataconnection or datarow/table into the
engine either through a fact retriever or your code. Somehow the data
connection has to get in there.
matt
Post by Atjeh
It is work if I'm not using database for condition in policy and vocabulary.
However when I try for using database for condition in policy rule, the codes
are just copying sample_rfp.xml become ProcessedRFP.xml with nothing process,
I use Policy class for execute it. When I try for using Policy Tester, the
rfpRules.ExecutionConfiguration = exConfig;
System.NullReferenceException: Object reference not set to ....ect.at
Que.BizTalk.Rules.RFPHost.Main<String[] args> in
c:\......\rfprulehost.cs:line 42
I'm in stuck.I'm really appreciate your attention.
Post by Matt Milner
In your business rule policy, check the places where you use the xml
RFPEstimateXML.RulesRFP. If they just have RulesRFP, that is your problem.
When you create the vocabulary item, or open a schema in the vocabulary
explorer, you often have to change the document type name to match what you
are going to be using from an orchestration or code.
Matt
Post by whidbeywave
Thanks Matt,
You sound logical :-o). I believe the document you mentioned in mail is
xml file, which acts as input, so here are the xsd and xml and piece of
code which involves in action. I would really appreciate if you can
point my mistake. I am troubled with XML namespaces at the moment. The
example I have picked up is from book microsoft biztalk server
unleashed 2004. Since it is from Que publication, a soft copy of this
chapter 11 (business rule) is also kept on Que publication website.
---------------------xml file which is input----------
<ns0:RFP xmlns:ns0="http://RFPEstimateXML.RulesRFP">
<Company>General Chaos 37</Company>
<Service>Programming</Service>
<Hours>10</Hours>
<Estimate>320</Estimate>
<Approved>true</Approved>
<Notes>Normal Rate Approved</Notes>
</ns0:RFP>
--------------------XSD involved in defining vocabulary------
<?xml version="1.0" encoding="utf-16"?>
<xs:schema xmlns="http://RFPEstimateXML.RulesRFP"
xmlns:b="http://schemas.microsoft.com/BizTalk/2003"
targetNamespace="http://RFPEstimateXML.RulesRFP"
xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="RFP">
<xs:annotation>
<xs:appinfo>
<b:recordInfo rootTypeName="RFPType"
xmlns:b="http://schemas.microsoft.com/BizTalk/2003" />
<b:properties>
<b:property distinguished="true" xpath="/*[local-name()='RFP'
and
namespace-uri()='http://RFPEstimateXML.RulesRFP']/*[local-name()='Approved'
and namespace-uri()='']" />
<b:property distinguished="true" xpath="/*[local-name()='RFP'
and
namespace-uri()='http://RFPEstimateXML.RulesRFP']/*[local-name()='Notes'
and namespace-uri()='']" />
</b:properties>
</xs:appinfo>
</xs:annotation>
<xs:complexType>
<xs:sequence>
<xs:element minOccurs="0" maxOccurs="1" name="Company"
type="xs:string" />
<xs:element minOccurs="1" maxOccurs="1" name="Service">
<xs:complexType>
<xs:simpleContent>
<xs:extension base="xs:string" />
</xs:simpleContent>
</xs:complexType>
</xs:element>
<xs:element minOccurs="1" maxOccurs="1" name="Hours"
type="xs:decimal" />
<xs:element minOccurs="1" maxOccurs="1" name="Estimate"
type="xs:decimal" />
<xs:element minOccurs="1" maxOccurs="1" default="false"
name="Approved" type="xs:boolean" />
<xs:element minOccurs="1" maxOccurs="1" name="Notes"
type="xs:string" />
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
-------------finally the code for typed xml document---------------
XmlDocument doc = new XmlDocument();
doc.Load("sample_rfp.xml");
TypedXmlDocument RFPDoc = new
TypedXmlDocument("RFPEstimateXML.RulesRFP", doc);
Once again thanks a lot.
Wave.
Post by Matt Milner
Your document is likely not properly named according to your rules.
make
Post by Matt Milner
sure the name you are using in your code matches the name in the
policy.
Post by Matt Milner
matt
Post by whidbeywave
Hi,
When i run my scenario as test policy in BRC, rules are fired, and
I
Post by Matt Milner
Post by whidbeywave
get the correct results. But when I try to execute() using Policy
or
Post by Matt Milner
Post by whidbeywave
PolicyTester, the same scenario does not fire any rules. I am
trying
Post by Matt Milner
Post by whidbeywave
the sample from Biztalk Server 2004 Unleashed - chapter 11.
(business
Post by Matt Milner
Post by whidbeywave
RULE ENGINE TRACE for RULESET: RFP 3/25/2005 9:17:47 PM
FACT ACTIVITY 3/25/2005 9:17:47 PM
ca78aed8-f829-4be6-a7b3-15b749daae30
Post by Matt Milner
Post by whidbeywave
Ruleset Name: RFP
Operation: Assert - Fact Unrecognized
Object Type: TypedXmlDocument:RFPEstimateXML.RulesRFP
Object Instance Identifier: 40
FACT ACTIVITY 3/25/2005 9:17:47 PM
ca78aed8-f829-4be6-a7b3-15b749daae30
Post by Matt Milner
Post by whidbeywave
Ruleset Name: RFP
Operation: Retract - Fact Unrecognized
Object Type: TypedXmlDocument:RFPEstimateXML.RulesRFP
Object Instance Identifier: 40
Thanks for all the help in advance.
Wave
Matt Milner
2005-03-28 13:36:00 UTC
Permalink
After looking at your post on another thread with Jon Flanders, this is
indeed your problem. In the rule composer, you have the following:
RulesRFP
as your document type. Change your code to use this value in the
constructor for the TypedXmlDocument and you should see this fact get
recognized.

Matt
Post by whidbeywave
Thanks Matt,
You sound logical :-o). I believe the document you mentioned in mail is
xml file, which acts as input, so here are the xsd and xml and piece of
code which involves in action. I would really appreciate if you can
point my mistake. I am troubled with XML namespaces at the moment. The
example I have picked up is from book microsoft biztalk server
unleashed 2004. Since it is from Que publication, a soft copy of this
chapter 11 (business rule) is also kept on Que publication website.
---------------------xml file which is input----------
<ns0:RFP xmlns:ns0="http://RFPEstimateXML.RulesRFP">
<Company>General Chaos 37</Company>
<Service>Programming</Service>
<Hours>10</Hours>
<Estimate>320</Estimate>
<Approved>true</Approved>
<Notes>Normal Rate Approved</Notes>
</ns0:RFP>
--------------------XSD involved in defining vocabulary------
<?xml version="1.0" encoding="utf-16"?>
<xs:schema xmlns="http://RFPEstimateXML.RulesRFP"
xmlns:b="http://schemas.microsoft.com/BizTalk/2003"
targetNamespace="http://RFPEstimateXML.RulesRFP"
xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="RFP">
<xs:annotation>
<xs:appinfo>
<b:recordInfo rootTypeName="RFPType"
xmlns:b="http://schemas.microsoft.com/BizTalk/2003" />
<b:properties>
<b:property distinguished="true" xpath="/*[local-name()='RFP'
and
namespace-uri()='http://RFPEstimateXML.RulesRFP']/*[local-name()='Approved'
and namespace-uri()='']" />
<b:property distinguished="true" xpath="/*[local-name()='RFP'
and
namespace-uri()='http://RFPEstimateXML.RulesRFP']/*[local-name()='Notes'
and namespace-uri()='']" />
</b:properties>
</xs:appinfo>
</xs:annotation>
<xs:complexType>
<xs:sequence>
<xs:element minOccurs="0" maxOccurs="1" name="Company"
type="xs:string" />
<xs:element minOccurs="1" maxOccurs="1" name="Service">
<xs:complexType>
<xs:simpleContent>
<xs:extension base="xs:string" />
</xs:simpleContent>
</xs:complexType>
</xs:element>
<xs:element minOccurs="1" maxOccurs="1" name="Hours"
type="xs:decimal" />
<xs:element minOccurs="1" maxOccurs="1" name="Estimate"
type="xs:decimal" />
<xs:element minOccurs="1" maxOccurs="1" default="false"
name="Approved" type="xs:boolean" />
<xs:element minOccurs="1" maxOccurs="1" name="Notes"
type="xs:string" />
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
-------------finally the code for typed xml document---------------
XmlDocument doc = new XmlDocument();
doc.Load("sample_rfp.xml");
TypedXmlDocument RFPDoc = new
TypedXmlDocument("RFPEstimateXML.RulesRFP", doc);
Once again thanks a lot.
Wave.
Post by Matt Milner
Your document is likely not properly named according to your rules.
make
Post by Matt Milner
sure the name you are using in your code matches the name in the
policy.
Post by Matt Milner
matt
Post by whidbeywave
Hi,
When i run my scenario as test policy in BRC, rules are fired, and
I
Post by Matt Milner
Post by whidbeywave
get the correct results. But when I try to execute() using Policy
or
Post by Matt Milner
Post by whidbeywave
PolicyTester, the same scenario does not fire any rules. I am
trying
Post by Matt Milner
Post by whidbeywave
the sample from Biztalk Server 2004 Unleashed - chapter 11.
(business
Post by Matt Milner
Post by whidbeywave
RULE ENGINE TRACE for RULESET: RFP 3/25/2005 9:17:47 PM
FACT ACTIVITY 3/25/2005 9:17:47 PM
ca78aed8-f829-4be6-a7b3-15b749daae30
Post by Matt Milner
Post by whidbeywave
Ruleset Name: RFP
Operation: Assert - Fact Unrecognized
Object Type: TypedXmlDocument:RFPEstimateXML.RulesRFP
Object Instance Identifier: 40
FACT ACTIVITY 3/25/2005 9:17:47 PM
ca78aed8-f829-4be6-a7b3-15b749daae30
Post by Matt Milner
Post by whidbeywave
Ruleset Name: RFP
Operation: Retract - Fact Unrecognized
Object Type: TypedXmlDocument:RFPEstimateXML.RulesRFP
Object Instance Identifier: 40
Thanks for all the help in advance.
Wave
Jon Flanders[DevelopMentor]
2005-03-28 15:39:47 UTC
Permalink
Hey thanks Matt :)
--
Jon Flanders [DevelopMentor]
http://staff.develop.com/jfland/
http://www.develop.com/courses/biztalk
Post by Matt Milner
After looking at your post on another thread with Jon Flanders, this is
RulesRFP
as your document type. Change your code to use this value in the
constructor for the TypedXmlDocument and you should see this fact get
recognized.
Matt
Post by whidbeywave
Thanks Matt,
You sound logical :-o). I believe the document you mentioned in mail is
xml file, which acts as input, so here are the xsd and xml and piece of
code which involves in action. I would really appreciate if you can
point my mistake. I am troubled with XML namespaces at the moment. The
example I have picked up is from book microsoft biztalk server
unleashed 2004. Since it is from Que publication, a soft copy of this
chapter 11 (business rule) is also kept on Que publication website.
---------------------xml file which is input----------
<ns0:RFP xmlns:ns0="http://RFPEstimateXML.RulesRFP">
<Company>General Chaos 37</Company>
<Service>Programming</Service>
<Hours>10</Hours>
<Estimate>320</Estimate>
<Approved>true</Approved>
<Notes>Normal Rate Approved</Notes>
</ns0:RFP>
--------------------XSD involved in defining vocabulary------
<?xml version="1.0" encoding="utf-16"?>
<xs:schema xmlns="http://RFPEstimateXML.RulesRFP"
xmlns:b="http://schemas.microsoft.com/BizTalk/2003"
targetNamespace="http://RFPEstimateXML.RulesRFP"
xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="RFP">
<xs:annotation>
<xs:appinfo>
<b:recordInfo rootTypeName="RFPType"
xmlns:b="http://schemas.microsoft.com/BizTalk/2003" />
<b:properties>
<b:property distinguished="true" xpath="/*[local-name()='RFP'
and
namespace-uri()='http://RFPEstimateXML.RulesRFP']/*[local-name()='Approved'
and namespace-uri()='']" />
<b:property distinguished="true" xpath="/*[local-name()='RFP'
and
namespace-uri()='http://RFPEstimateXML.RulesRFP']/*[local-name()='Notes'
and namespace-uri()='']" />
</b:properties>
</xs:appinfo>
</xs:annotation>
<xs:complexType>
<xs:sequence>
<xs:element minOccurs="0" maxOccurs="1" name="Company"
type="xs:string" />
<xs:element minOccurs="1" maxOccurs="1" name="Service">
<xs:complexType>
<xs:simpleContent>
<xs:extension base="xs:string" />
</xs:simpleContent>
</xs:complexType>
</xs:element>
<xs:element minOccurs="1" maxOccurs="1" name="Hours"
type="xs:decimal" />
<xs:element minOccurs="1" maxOccurs="1" name="Estimate"
type="xs:decimal" />
<xs:element minOccurs="1" maxOccurs="1" default="false"
name="Approved" type="xs:boolean" />
<xs:element minOccurs="1" maxOccurs="1" name="Notes"
type="xs:string" />
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
-------------finally the code for typed xml document---------------
XmlDocument doc = new XmlDocument();
doc.Load("sample_rfp.xml");
TypedXmlDocument RFPDoc = new
TypedXmlDocument("RFPEstimateXML.RulesRFP", doc);
Once again thanks a lot.
Wave.
Post by Matt Milner
Your document is likely not properly named according to your rules.
make
Post by Matt Milner
sure the name you are using in your code matches the name in the
policy.
Post by Matt Milner
matt
Post by whidbeywave
Hi,
When i run my scenario as test policy in BRC, rules are fired, and
I
Post by Matt Milner
Post by whidbeywave
get the correct results. But when I try to execute() using Policy
or
Post by Matt Milner
Post by whidbeywave
PolicyTester, the same scenario does not fire any rules. I am
trying
Post by Matt Milner
Post by whidbeywave
the sample from Biztalk Server 2004 Unleashed - chapter 11.
(business
Post by Matt Milner
Post by whidbeywave
RULE ENGINE TRACE for RULESET: RFP 3/25/2005 9:17:47 PM
FACT ACTIVITY 3/25/2005 9:17:47 PM
ca78aed8-f829-4be6-a7b3-15b749daae30
Post by Matt Milner
Post by whidbeywave
Ruleset Name: RFP
Operation: Assert - Fact Unrecognized
Object Type: TypedXmlDocument:RFPEstimateXML.RulesRFP
Object Instance Identifier: 40
FACT ACTIVITY 3/25/2005 9:17:47 PM
ca78aed8-f829-4be6-a7b3-15b749daae30
Post by Matt Milner
Post by whidbeywave
Ruleset Name: RFP
Operation: Retract - Fact Unrecognized
Object Type: TypedXmlDocument:RFPEstimateXML.RulesRFP
Object Instance Identifier: 40
Thanks for all the help in advance.
Wave
whidbeywave
2005-03-29 03:28:40 UTC
Permalink
Thanks a lot to both of you for spoon feeding... :-o) Can you suggest
few links where i can clear my head on XSD schemas bandwagon, in
context to biztalk 2004.
Thank you
Wave
Post by Jon Flanders[DevelopMentor]
Hey thanks Matt :)
--
Jon Flanders [DevelopMentor]
http://staff.develop.com/jfland/
http://www.develop.com/courses/biztalk
Post by Matt Milner
After looking at your post on another thread with Jon Flanders, this is
RulesRFP
as your document type. Change your code to use this value in the
constructor for the TypedXmlDocument and you should see this fact get
recognized.
Matt
Post by whidbeywave
Thanks Matt,
You sound logical :-o). I believe the document you mentioned in mail is
xml file, which acts as input, so here are the xsd and xml and piece of
code which involves in action. I would really appreciate if you can
point my mistake. I am troubled with XML namespaces at the moment. The
example I have picked up is from book microsoft biztalk server
unleashed 2004. Since it is from Que publication, a soft copy of this
chapter 11 (business rule) is also kept on Que publication
website.
Post by Jon Flanders[DevelopMentor]
Post by Matt Milner
Post by whidbeywave
---------------------xml file which is input----------
<ns0:RFP xmlns:ns0="http://RFPEstimateXML.RulesRFP">
<Company>General Chaos 37</Company>
<Service>Programming</Service>
<Hours>10</Hours>
<Estimate>320</Estimate>
<Approved>true</Approved>
<Notes>Normal Rate Approved</Notes>
</ns0:RFP>
--------------------XSD involved in defining vocabulary------
<?xml version="1.0" encoding="utf-16"?>
<xs:schema xmlns="http://RFPEstimateXML.RulesRFP"
xmlns:b="http://schemas.microsoft.com/BizTalk/2003"
targetNamespace="http://RFPEstimateXML.RulesRFP"
xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="RFP">
<xs:annotation>
<xs:appinfo>
<b:recordInfo rootTypeName="RFPType"
xmlns:b="http://schemas.microsoft.com/BizTalk/2003" />
<b:properties>
<b:property distinguished="true"
xpath="/*[local-name()='RFP'
Post by Jon Flanders[DevelopMentor]
Post by Matt Milner
Post by whidbeywave
and
namespace-uri()='http://RFPEstimateXML.RulesRFP']/*[local-name()='Approved'
Post by Jon Flanders[DevelopMentor]
Post by Matt Milner
Post by whidbeywave
and namespace-uri()='']" />
<b:property distinguished="true"
xpath="/*[local-name()='RFP'
Post by Jon Flanders[DevelopMentor]
Post by Matt Milner
Post by whidbeywave
and
namespace-uri()='http://RFPEstimateXML.RulesRFP']/*[local-name()='Notes'
Post by Jon Flanders[DevelopMentor]
Post by Matt Milner
Post by whidbeywave
and namespace-uri()='']" />
</b:properties>
</xs:appinfo>
</xs:annotation>
<xs:complexType>
<xs:sequence>
<xs:element minOccurs="0" maxOccurs="1" name="Company"
type="xs:string" />
<xs:element minOccurs="1" maxOccurs="1" name="Service">
<xs:complexType>
<xs:simpleContent>
<xs:extension base="xs:string" />
</xs:simpleContent>
</xs:complexType>
</xs:element>
<xs:element minOccurs="1" maxOccurs="1" name="Hours"
type="xs:decimal" />
<xs:element minOccurs="1" maxOccurs="1" name="Estimate"
type="xs:decimal" />
<xs:element minOccurs="1" maxOccurs="1" default="false"
name="Approved" type="xs:boolean" />
<xs:element minOccurs="1" maxOccurs="1" name="Notes"
type="xs:string" />
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
-------------finally the code for typed xml
document---------------
Post by Jon Flanders[DevelopMentor]
Post by Matt Milner
Post by whidbeywave
XmlDocument doc = new XmlDocument();
doc.Load("sample_rfp.xml");
TypedXmlDocument RFPDoc = new
TypedXmlDocument("RFPEstimateXML.RulesRFP", doc);
Once again thanks a lot.
Wave.
Post by Matt Milner
Your document is likely not properly named according to your rules.
make
Post by Matt Milner
sure the name you are using in your code matches the name in the
policy.
Post by Matt Milner
matt
Post by whidbeywave
Hi,
When i run my scenario as test policy in BRC, rules are fired, and
I
Post by Matt Milner
Post by whidbeywave
get the correct results. But when I try to execute() using Policy
or
Post by Matt Milner
Post by whidbeywave
PolicyTester, the same scenario does not fire any rules. I am
trying
Post by Matt Milner
Post by whidbeywave
the sample from Biztalk Server 2004 Unleashed - chapter 11.
(business
Post by Matt Milner
Post by whidbeywave
RULE ENGINE TRACE for RULESET: RFP 3/25/2005 9:17:47 PM
FACT ACTIVITY 3/25/2005 9:17:47 PM
ca78aed8-f829-4be6-a7b3-15b749daae30
Post by Matt Milner
Post by whidbeywave
Ruleset Name: RFP
Operation: Assert - Fact Unrecognized
Object Type: TypedXmlDocument:RFPEstimateXML.RulesRFP
Object Instance Identifier: 40
FACT ACTIVITY 3/25/2005 9:17:47 PM
ca78aed8-f829-4be6-a7b3-15b749daae30
Post by Matt Milner
Post by whidbeywave
Ruleset Name: RFP
Operation: Retract - Fact Unrecognized
Object Type: TypedXmlDocument:RFPEstimateXML.RulesRFP
Object Instance Identifier: 40
Thanks for all the help in advance.
Wave
whidbeywave
2005-03-29 14:44:36 UTC
Permalink
Thanks to both of you :-o)
i realize how simple it was after that extract from policies and
vocabulary. Can someone suggest me some links to overcome my this weak
area of XSD and Biztalk.
Thanks
Wave
Post by Jon Flanders[DevelopMentor]
Hey thanks Matt :)
--
Jon Flanders [DevelopMentor]
http://staff.develop.com/jfland/
http://www.develop.com/courses/biztalk
Post by Matt Milner
After looking at your post on another thread with Jon Flanders, this is
RulesRFP
as your document type. Change your code to use this value in the
constructor for the TypedXmlDocument and you should see this fact get
recognized.
Matt
Post by whidbeywave
Thanks Matt,
You sound logical :-o). I believe the document you mentioned in mail is
xml file, which acts as input, so here are the xsd and xml and piece of
code which involves in action. I would really appreciate if you can
point my mistake. I am troubled with XML namespaces at the moment. The
example I have picked up is from book microsoft biztalk server
unleashed 2004. Since it is from Que publication, a soft copy of this
chapter 11 (business rule) is also kept on Que publication
website.
Post by Jon Flanders[DevelopMentor]
Post by Matt Milner
Post by whidbeywave
---------------------xml file which is input----------
<ns0:RFP xmlns:ns0="http://RFPEstimateXML.RulesRFP">
<Company>General Chaos 37</Company>
<Service>Programming</Service>
<Hours>10</Hours>
<Estimate>320</Estimate>
<Approved>true</Approved>
<Notes>Normal Rate Approved</Notes>
</ns0:RFP>
--------------------XSD involved in defining vocabulary------
<?xml version="1.0" encoding="utf-16"?>
<xs:schema xmlns="http://RFPEstimateXML.RulesRFP"
xmlns:b="http://schemas.microsoft.com/BizTalk/2003"
targetNamespace="http://RFPEstimateXML.RulesRFP"
xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="RFP">
<xs:annotation>
<xs:appinfo>
<b:recordInfo rootTypeName="RFPType"
xmlns:b="http://schemas.microsoft.com/BizTalk/2003" />
<b:properties>
<b:property distinguished="true"
xpath="/*[local-name()='RFP'
Post by Jon Flanders[DevelopMentor]
Post by Matt Milner
Post by whidbeywave
and
namespace-uri()='http://RFPEstimateXML.RulesRFP']/*[local-name()='Approved'
Post by Jon Flanders[DevelopMentor]
Post by Matt Milner
Post by whidbeywave
and namespace-uri()='']" />
<b:property distinguished="true"
xpath="/*[local-name()='RFP'
Post by Jon Flanders[DevelopMentor]
Post by Matt Milner
Post by whidbeywave
and
namespace-uri()='http://RFPEstimateXML.RulesRFP']/*[local-name()='Notes'
Post by Jon Flanders[DevelopMentor]
Post by Matt Milner
Post by whidbeywave
and namespace-uri()='']" />
</b:properties>
</xs:appinfo>
</xs:annotation>
<xs:complexType>
<xs:sequence>
<xs:element minOccurs="0" maxOccurs="1" name="Company"
type="xs:string" />
<xs:element minOccurs="1" maxOccurs="1" name="Service">
<xs:complexType>
<xs:simpleContent>
<xs:extension base="xs:string" />
</xs:simpleContent>
</xs:complexType>
</xs:element>
<xs:element minOccurs="1" maxOccurs="1" name="Hours"
type="xs:decimal" />
<xs:element minOccurs="1" maxOccurs="1" name="Estimate"
type="xs:decimal" />
<xs:element minOccurs="1" maxOccurs="1" default="false"
name="Approved" type="xs:boolean" />
<xs:element minOccurs="1" maxOccurs="1" name="Notes"
type="xs:string" />
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
-------------finally the code for typed xml
document---------------
Post by Jon Flanders[DevelopMentor]
Post by Matt Milner
Post by whidbeywave
XmlDocument doc = new XmlDocument();
doc.Load("sample_rfp.xml");
TypedXmlDocument RFPDoc = new
TypedXmlDocument("RFPEstimateXML.RulesRFP", doc);
Once again thanks a lot.
Wave.
Post by Matt Milner
Your document is likely not properly named according to your rules.
make
Post by Matt Milner
sure the name you are using in your code matches the name in the
policy.
Post by Matt Milner
matt
Post by whidbeywave
Hi,
When i run my scenario as test policy in BRC, rules are fired, and
I
Post by Matt Milner
Post by whidbeywave
get the correct results. But when I try to execute() using Policy
or
Post by Matt Milner
Post by whidbeywave
PolicyTester, the same scenario does not fire any rules. I am
trying
Post by Matt Milner
Post by whidbeywave
the sample from Biztalk Server 2004 Unleashed - chapter 11.
(business
Post by Matt Milner
Post by whidbeywave
RULE ENGINE TRACE for RULESET: RFP 3/25/2005 9:17:47 PM
FACT ACTIVITY 3/25/2005 9:17:47 PM
ca78aed8-f829-4be6-a7b3-15b749daae30
Post by Matt Milner
Post by whidbeywave
Ruleset Name: RFP
Operation: Assert - Fact Unrecognized
Object Type: TypedXmlDocument:RFPEstimateXML.RulesRFP
Object Instance Identifier: 40
FACT ACTIVITY 3/25/2005 9:17:47 PM
ca78aed8-f829-4be6-a7b3-15b749daae30
Post by Matt Milner
Post by whidbeywave
Ruleset Name: RFP
Operation: Retract - Fact Unrecognized
Object Type: TypedXmlDocument:RFPEstimateXML.RulesRFP
Object Instance Identifier: 40
Thanks for all the help in advance.
Wave
Atjeh
2005-04-04 11:03:02 UTC
Permalink
I'm still confuse with it. In my solution, it doesn't work anyway. :(
Whidbeywave, may I contact you personal ?
Post by whidbeywave
Thanks to both of you :-o)
i realize how simple it was after that extract from policies and
vocabulary. Can someone suggest me some links to overcome my this weak
area of XSD and Biztalk.
Thanks
Wave
Post by Jon Flanders[DevelopMentor]
Hey thanks Matt :)
--
Jon Flanders [DevelopMentor]
http://staff.develop.com/jfland/
http://www.develop.com/courses/biztalk
Post by Matt Milner
After looking at your post on another thread with Jon Flanders,
this is
Post by Jon Flanders[DevelopMentor]
Post by Matt Milner
RulesRFP
as your document type. Change your code to use this value in the
constructor for the TypedXmlDocument and you should see this fact
get
Post by Jon Flanders[DevelopMentor]
Post by Matt Milner
recognized.
Matt
Post by whidbeywave
Thanks Matt,
You sound logical :-o). I believe the document you mentioned in
mail is
Post by Jon Flanders[DevelopMentor]
Post by Matt Milner
Post by whidbeywave
xml file, which acts as input, so here are the xsd and xml and
piece of
Post by Jon Flanders[DevelopMentor]
Post by Matt Milner
Post by whidbeywave
code which involves in action. I would really appreciate if you
can
Post by Jon Flanders[DevelopMentor]
Post by Matt Milner
Post by whidbeywave
point my mistake. I am troubled with XML namespaces at the moment.
The
Post by Jon Flanders[DevelopMentor]
Post by Matt Milner
Post by whidbeywave
example I have picked up is from book microsoft biztalk server
unleashed 2004. Since it is from Que publication, a soft copy of
this
Post by Jon Flanders[DevelopMentor]
Post by Matt Milner
Post by whidbeywave
chapter 11 (business rule) is also kept on Que publication
website.
Post by Jon Flanders[DevelopMentor]
Post by Matt Milner
Post by whidbeywave
---------------------xml file which is input----------
<ns0:RFP xmlns:ns0="http://RFPEstimateXML.RulesRFP">
<Company>General Chaos 37</Company>
<Service>Programming</Service>
<Hours>10</Hours>
<Estimate>320</Estimate>
<Approved>true</Approved>
<Notes>Normal Rate Approved</Notes>
</ns0:RFP>
--------------------XSD involved in defining vocabulary------
<?xml version="1.0" encoding="utf-16"?>
<xs:schema xmlns="http://RFPEstimateXML.RulesRFP"
xmlns:b="http://schemas.microsoft.com/BizTalk/2003"
targetNamespace="http://RFPEstimateXML.RulesRFP"
xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="RFP">
<xs:annotation>
<xs:appinfo>
<b:recordInfo rootTypeName="RFPType"
xmlns:b="http://schemas.microsoft.com/BizTalk/2003" />
<b:properties>
<b:property distinguished="true"
xpath="/*[local-name()='RFP'
Post by Jon Flanders[DevelopMentor]
Post by Matt Milner
Post by whidbeywave
and
namespace-uri()='http://RFPEstimateXML.RulesRFP']/*[local-name()='Approved'
Post by Jon Flanders[DevelopMentor]
Post by Matt Milner
Post by whidbeywave
and namespace-uri()='']" />
<b:property distinguished="true"
xpath="/*[local-name()='RFP'
Post by Jon Flanders[DevelopMentor]
Post by Matt Milner
Post by whidbeywave
and
namespace-uri()='http://RFPEstimateXML.RulesRFP']/*[local-name()='Notes'
Post by Jon Flanders[DevelopMentor]
Post by Matt Milner
Post by whidbeywave
and namespace-uri()='']" />
</b:properties>
</xs:appinfo>
</xs:annotation>
<xs:complexType>
<xs:sequence>
<xs:element minOccurs="0" maxOccurs="1" name="Company"
type="xs:string" />
<xs:element minOccurs="1" maxOccurs="1" name="Service">
<xs:complexType>
<xs:simpleContent>
<xs:extension base="xs:string" />
</xs:simpleContent>
</xs:complexType>
</xs:element>
<xs:element minOccurs="1" maxOccurs="1" name="Hours"
type="xs:decimal" />
<xs:element minOccurs="1" maxOccurs="1" name="Estimate"
type="xs:decimal" />
<xs:element minOccurs="1" maxOccurs="1" default="false"
name="Approved" type="xs:boolean" />
<xs:element minOccurs="1" maxOccurs="1" name="Notes"
type="xs:string" />
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
-------------finally the code for typed xml
document---------------
Post by Jon Flanders[DevelopMentor]
Post by Matt Milner
Post by whidbeywave
XmlDocument doc = new XmlDocument();
doc.Load("sample_rfp.xml");
TypedXmlDocument RFPDoc = new
TypedXmlDocument("RFPEstimateXML.RulesRFP", doc);
Once again thanks a lot.
Wave.
Post by Matt Milner
Your document is likely not properly named according to your
rules.
Post by Jon Flanders[DevelopMentor]
Post by Matt Milner
Post by whidbeywave
make
Post by Matt Milner
sure the name you are using in your code matches the name in the
policy.
Post by Matt Milner
matt
Post by whidbeywave
Hi,
When i run my scenario as test policy in BRC, rules are fired,
and
Post by Jon Flanders[DevelopMentor]
Post by Matt Milner
Post by whidbeywave
I
Post by Matt Milner
Post by whidbeywave
get the correct results. But when I try to execute() using
Policy
Post by Jon Flanders[DevelopMentor]
Post by Matt Milner
Post by whidbeywave
or
Post by Matt Milner
Post by whidbeywave
PolicyTester, the same scenario does not fire any rules. I am
trying
Post by Matt Milner
Post by whidbeywave
the sample from Biztalk Server 2004 Unleashed - chapter 11.
(business
Post by Matt Milner
Post by whidbeywave
RULE ENGINE TRACE for RULESET: RFP 3/25/2005 9:17:47 PM
FACT ACTIVITY 3/25/2005 9:17:47 PM
ca78aed8-f829-4be6-a7b3-15b749daae30
Post by Matt Milner
Post by whidbeywave
Ruleset Name: RFP
Operation: Assert - Fact Unrecognized
Object Type: TypedXmlDocument:RFPEstimateXML.RulesRFP
Object Instance Identifier: 40
FACT ACTIVITY 3/25/2005 9:17:47 PM
ca78aed8-f829-4be6-a7b3-15b749daae30
Post by Matt Milner
Post by whidbeywave
Ruleset Name: RFP
Operation: Retract - Fact Unrecognized
Object Type: TypedXmlDocument:RFPEstimateXML.RulesRFP
Object Instance Identifier: 40
Thanks for all the help in advance.
Wave
Loading...