![]() |
|
|||||||
| Notices |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
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 |
|
|
|
#2 |
|
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? |
|
|
|
#3 |
|
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? |
|
|
|
#4 |
|
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? |
|
|
|
#5 |
|
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? |
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
< Windows Help - MS Office Help - Hardware Support >
| New To Site? | Need Help? |