Re: BizTalk 2004 :: Fact retriever :: more than 1 data connection? How?
- From: "Matt Milner" <matt.milner@m3technologypartners dot com>
- Date: Tue, 17 May 2005 09:48:03 -0500
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
>
.
- Follow-Ups:
- References:
- Prev by Date: RE: How to access context properties in a Receive's Map
- Next by Date: Re: BizTalk 2004 :: Business rules engine :: IFactRetriever :: inside orchestration
- Previous by thread: BizTalk 2004 :: Fact retriever :: more than 1 data connection? How?
- Next by thread: Re: BizTalk 2004 :: Fact retriever :: more than 1 data connection? How?
- Index(es):
Relevant Pages
|
Loading