Re: BizTalk 2004 :: Fact retriever :: more than 1 data connection?

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



Hello Matt,
I tried executing the assert statement twice so that my rules policy can go
to different tables in the database to grab the data, but I encountered the
error:

Microsoft.RuleEngine.PolicyExecutionException: An exception occurred inside
the rule engine instance executing policy
"EMRXServiceInterchangeEngineRulesPolicy". --->
Microsoft.RuleEngine.RuleEngineArgumentNullException: The value of argument
"newXml" cannot be null.
at Microsoft.RuleEngine.Rete.Rete.ProcessException(Exception ex)
at Microsoft.RuleEngine.Rete.Rete.ExecuteInternal(Object facts, Object
data)
at Microsoft.RuleEngine.Rete.Rete.ProcessingLoop(Operation operation,
Object facts, Object data, EngineState nextState)
at Microsoft.RuleEngine.Rete.Rete.Execute(Object facts)
at Microsoft.RuleEngine.Policy.ExecuteInternal(Object facts)
--- End of inner exception stack trace ---
at Microsoft.RuleEngine.Policy.ExecuteInternal(Object facts)
at Microsoft.RuleEngine.Policy.Execute(Object facts)
at Microsoft.RuleEngine.Policy.Execute(Object[] facts)
at
EMRX.Orchestration.ServiceInterchangeEngine.EMRXServiceInterchangeOrchestration.segment3(StopConditions stopOn)
at Microsoft.XLANGs.Core.SegmentScheduler.RunASegment(Segment s,
StopConditions stopCond, Exception& exp)
Microsoft.RuleEngine.PolicyExecutionException

Below is the updatefact method that I try to simulate what you've mentioned.

public object UpdateFacts (RuleSetInfo ruleSetInfo, RuleEngine engine,
object factsHndlIn)
{
object factsHndlOut = null;
// The following logic asserts the required DB rows only once.
// The initial values (cached during the first retrieval) are returned in
subsequent execution cycles
if (factsHndlIn == null)
{
SqlConnection con1;
DataConnection dc1, dc2;

con1 = new SqlConnection( "Data Source=(local);Initial
Catalog=EMRX;UID=sa;Pwd=pass@word1;");
dc1 = new DataConnection( "EMRX", "PublishedServicesList", con1);
engine.Assert( dc1);
dc2 = new DataConnection( "EMRX", "ServicesSubscription", con1);
engine.Assert( dc2);
factsHndlOut = dc2;
}
else
{
factsHndlOut = factsHndlIn;
}
return factsHndlOut;
}

But if I remove away the two lines
dc2 = new DataConnection( "EMRX", "ServicesSubscription", con1);
engine.Assert( dc2);
the policy would runs properly.

Appreciate if you could enlighten me on the missing link.
I'm new to BizTalk, any help is greatly appreciated.
Thanks.

Regards,
Desmond



"Matt Milner" wrote:

> Simply create and assert more than one dataconnection. If you are using the
> same database, you can reuse the SqlConnection like so:
>
> DataConnection dc1 =
> > new DataConnection("foo", "fum", con1);
> > Dataconnection dc2 = new DataConnection("bar", "bum", con1);
> > engine.Assert(dc1);
> engine.Assert(dc2);
>
> It is not the return value that gets entered intot the engine for execution,
> the factsHandleOut is your handle to know whether to refresh the facts. This
> is a little confusing, I know and it is a shame that most samples show the
> connection being handed back.
>
> You can also create another sql connection, wrap it with the second data
> connection and assert that. Similarly, if you are asserting
> datatable/datarow facts, you can use the sql connection to retrieve those
> and assert them.
>
> Matt
>
>
>
> "BA" <biztalk.architect@xxxxxxxxx> wrote in message
> news:1116329399.521056.291710@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
> > Hello,
> >
> > In the code below you set a single data connection for a single DB
> > table.
> >
> > I have many data connections to add, how do you extend this sample to
> > add more than 1 data connection?
> > public class DbFactRetriever : IFactRetriever
> > {
> >
> > public object UpdateFacts(RuleSetInfo rulesetInfo,
> > Microsoft.RuleEngine.RuleEngine engine,
> > object factsHandleIn)
> >
> > {
> > object factsHandleOut;
> >
> > SqlConnection con1 = new
> > SqlConnection("Initial Catalog=foo;
> > Data Source=(local);Integrated Security=SSPI;");
> >
> > DataConnection dc1 =
> > new DataConnection("foo", "fum", con1);
> >
> > engine.Assert(dc1);
> > factsHandleOut = dc1;
> > }
> > return factsHandleOut;
> > }
> >
> >
> > I'm still learning C# so any help would be greatly appreciated.
> >
> > Thanks!
> >
> > BA
> >
>
>
>
.



Relevant Pages

  • Re: BizTalk 2004 :: Fact retriever :: more than 1 data connection?
    ... > at Microsoft.RuleEngine.Rete.Rete.ExecuteInternal(Object facts, Object ... > object factsHndlOut = null; ... >> Simply create and assert more than one dataconnection. ... >> connection being handed back. ...
    (microsoft.public.biztalk.general)
  • Re: The Tears Of Finding The Truth
    ... I know in some sense you do, because there's little factual room to disagree, even though you yourself like to deflect to 'HYPERETHNOCENTRISM' and the hatreds as living proof of...? ... And you provided nothing to assert, when I provided a small mountain of evidence and a forum for discussing what it means and entails. ... Your's was a flatus in a blizzard- a pile of not much of anything except your conclusion, which you just stated with no more facts than your own erroneous review, a faked one, taken from a one page reading from somewhere, that clearly shows this: you need to believe you are a giant. ... source and how it fits and then try to sell how I don't understand the causes, and all you had was hyperethnocentrism, and a few other flatulent self blame and blame of america, and it's you who are very very short of minimal study in the issues, the facts. ...
    (rec.martial-arts)
  • Re: How to create a list of sharing variables?
    ... it was actually forbidden explicitly to use assert; ... stored the crossword in an array but as a number of facts field. ... also had the idea to transpose rows and columns but did it by replacing ... Given a general task, where the input consists of some objects (maybe of ...
    (comp.lang.prolog)
  • Re: IFactRetirever -- can we parameterize on already asserted fact
    ... long term facts, but not through the use of DataConnection. ... UpdateFacts method so that I can run the SQL query and populate my cache. ... data has been cached and assert it into the BRE without going to the database. ...
    (microsoft.public.biztalk.general)
  • Re: Genealogical "burden of proof": was Are "TAF" and "MI5" Crazies?
    ... connection supported by 5 "facts". ... say "A is the son of B", supported by evidence from evidence ... Are "TAF" & "MI5" Crazies? ...
    (soc.genealogy.medieval)