05-31-05 12:47 PM
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.EMRXServiceInterchangeOrchestrat
ion.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 t
he
> same database, you can reuse the SqlConnection like so:
>
> DataConnection dc1 =
> engine.Assert(dc2);
>
> It is not the return value that gets entered intot the engine for executio
n,
> the factsHandleOut is your handle to know whether to refresh the facts. Th
is
> 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@gmail.com> wrote in message
> news:1116329399.521056.291710@f14g2000cwb.googlegroups.com...
>
>
>
[ Post a follow-up to this message ]
|