TechTalkz.com Logo

Go Back   TechTalkz.com Technology & Computer Troubleshooting Forums > Tech Support Archives > Microsoft > Microsoft BizTalk Server

Notices

BRE call .net assembly

Microsoft BizTalk Server


Reply
 
Thread Tools Display Modes
Old 08-12-2007, 01:36 AM   #1
devMonkey
Guest
 
Posts: n/a
BRE call .net assembly

I am reading that I can pass a message to a .NET class method which
can handle a message modification as a rule. I see how to configure
this in the rule policy creator but am confused as to what the
signature of the method will look like that I pass my message to. I
know it would take the message by reference but what type does it need
to be so that the rule engine can handle creating a new message from
the result?

Xlang, XmlDocument, XmlTypedDocument?
Can someone please show me an example
Thanks
  Reply With Quote
Old 09-12-2007, 03:46 AM   #2
devMonkey
Guest
 
Posts: n/a
Re: BRE call .net assembly

On Dec 7, 7:08 am, devMonkey <> wrote:
> I am reading that I can pass a message to a .NET class method which
> can handle a message modification as a rule. I see how to configure
> this in the rule policy creator but am confused as to what the
> signature of the method will look like that I pass my message to. I
> know it would take the message by reference but what type does it need
> to be so that the rule engine can handle creating a new message from
> the result?
>
> Xlang, XmlDocument, XmlTypedDocument?
> Can someone please show me an example
> Thanks


Ok so I figured out that I can pass it as an XLangmessage and retrieve
it as a strong type (my schema).

public void TestRuleStub(ref XLANGMessage btsMessage)
mySchemaClassFromXSD =
btsMessage[0].RetrieveAs(typeof(mySchemaClassFromXSD )));

Now I can modify this object instance as my class in the method called
by the BRE but I'm unclear how to get it back to the rule engine.
modified. It passes the Xlang by ref so the rule engine has a handle
to it I presume but since I'm retrieving it into a custom class, how
do I get it back into the ref'd XLANGMessage btsMessage so that the
rule engine can in turn create a new message from it in the
orchestration?
  Reply With Quote
Old 09-12-2007, 04:31 AM   #3
devMonkey
Guest
 
Posts: n/a
Re: BRE call .net assembly

On Dec 7, 7:08 am, devMonkey <> wrote:
> I am reading that I can pass a message to a .NET class method which
> can handle a message modification as a rule. I see how to configure
> this in the rule policy creator but am confused as to what the
> signature of the method will look like that I pass my message to. I
> know it would take the message by reference but what type does it need
> to be so that the rule engine can handle creating a new message from
> the result?
>
> Xlang, XmlDocument, XmlTypedDocument?
> Can someone please show me an example
> Thanks


Ok so I figured out that I can pass it as an XLangmessage and retrieve
it as a strong type (my schema).

public void TestRuleStub(ref XLANGMessage btsMessage)
mySchemaClassFromXSD =
btsMessage[0].RetrieveAs(typeof(mySchemaClassFromXSD )));

Now I can modify this object instance as my class in the method called
by the BRE but I'm unclear how to get it back to the rule engine.
modified. It passes the Xlang by ref so the rule engine has a handle
to it I presume but since I'm retrieving it into a custom class, how
do I get it back into the ref'd XLANGMessage btsMessage so that the
rule engine can in turn create a new message from it in the
orchestration?
  Reply With Quote
Old 09-12-2007, 05:40 AM   #4
devMonkey
Guest
 
Posts: n/a
Re: BRE call .net assembly

Ok so I figured out that I should be passing it as an XLangmessage and
retrieve
it as a strong type (my schema).

public void TestRuleStub(ref XLANGMessage btsMessage)
mySchemaClassFromXSD =
btsMessage[0].RetrieveAs(typeof(mySchemaClassFromXSD )));

or so I thought:
The method gets called by the BRE but btsMessage is always null. I
noticed when I was constructing the rule in the rules editor, it would
not let me assign a display name to the btsMessage parameter of
my .net class method signature. The parameter is displayed as
Microsoft.XLANGs.BaseTypes.XLANGMessage& in the display definition
type and constant value is selected. When I enter any value for the
parameter value, it errors with:

"One of the identified items was an invalid format"

So I can't seem to add a display name for the parameter and my rule
ends up looking like:

TestRuleStub<null> in the editor but "null" parameter is shown to be
of type:
Microsoft.XLANGs.BaseTypes.XLANGMessage&
in the rule action properties.

I thought it was possible to do this? Theonly example I can seem to
find involve passing in only pieces of the message, I need to pass in
the whole message since the rule(s) will touch most of it.

Presuming I'm doing something wrong and it is possible I'm also
wondering how to return the message back to the BRE correctly s

It passes the Xlang by ref so the rule engine has a pointer
to it I presume but since I'm retrieving it into a custom class, how
do I get it back into the ref'd XLANGMessage btsMessage so that the
rule engine can in turn create a new message from it in the
orchestration?


  Reply With Quote
Old 09-12-2007, 06:24 AM   #5
devMonkey
Guest
 
Posts: n/a
Re: BRE call .net assembly

Ok so I figured out that I should be passing it as an XLangmessage and
retrieve
it as a strong type (my schema).

public void TestRuleStub(ref XLANGMessage btsMessage)
mySchemaClassFromXSD =
btsMessage[0].RetrieveAs(typeof(mySchemaClassFromXSD )));

or so I thought:
The method gets called by the BRE but btsMessage is always null. I
noticed when I was constructing the rule in the rules editor, it would
not let me assign a display name to the btsMessage parameter of
my .net class method signature. The parameter is displayed as
Microsoft.XLANGs.BaseTypes.XLANGMessage& in the display definition
type and constant value is selected. When I enter any value for the
parameter value, it errors with:

"One of the identified items was an invalid format"

So I can't seem to add a display name for the parameter and my rule
ends up looking like:

TestRuleStub<null> in the editor but "null" parameter is shown to be
of type:
Microsoft.XLANGs.BaseTypes.XLANGMessage&
in the rule action properties.

I thought it was possible to do this? Theonly example I can seem to
find involve passing in only pieces of the message, I need to pass in
the whole message since the rule(s) will touch most of it.

Presuming I'm doing something wrong and it is possible I'm also
wondering how to return the message back to the BRE correctly s

It passes the Xlang by ref so the rule engine has a pointer
to it I presume but since I'm retrieving it into a custom class, how
do I get it back into the ref'd XLANGMessage btsMessage so that the
rule engine can in turn create a new message from it in the
orchestration?


  Reply With Quote
Reply

Thread Tools
Display Modes



< Windows Help - MS Office Help - Hardware Support >


New To Site? Need Help?

All times are GMT +5.5. The time now is 01:34 AM.


vBulletin, Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO
Copyright © 2005-2009, TechTalkz.com. All Rights Reserved - Privacy Policy
Valid XHTML 1.0 Transitional