|
Home > Archive > BizTalk Server Orchestration > August 2004 > modify xml nodes in action of business rules
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
modify xml nodes in action of business rules
|
|
|
| Hi,
I've a business rules, that receive as parameter a xml file with some
values.
Then if condition was evaluated to true, i want to add new nodes to that xml
in the action pane.
Example of schema:
<request>
....
</request>
<response>
<message> </message>
</response>
for each business rule that are evaluated to true, i want to add to the xml
a new message node.
Example of xml after conditions are evaluated:
<request>
....
</request>
<response>
<message>pass business rule A </message>
<message>pass business rule D </message>
<message>pass business rule F </message>
</response>
So, to do that, i think that the only way is developing a .Net assembly.
is that true?
I tried to create a new function that receive as parameter "response" node
(instance of RuleEngine.TypedXmlDocument class), to append new child node.
But it doesn't works.
Any pointers???
Thanks in advance,
Mauri.-
| |
|
| Perhaps you can use the XML DOM to create to add an element. Don't know how
this is in 2004 but I did something similar in 2002 in vbscript for my
orchestration.
Something like:
set doc = CreateObject("MSXML2.DOMDocument")
doc.loadXML(Document)
'' define where you want to add your element
set responseNode = doc.selectSingleNode("//response")
set msgText = doc.createTextNode("business rule A text")
set msgElement = doc.createElement("message")
msgElement.appendChild msgText
"Mr. M" wrote:
> Hi,
>
> I've a business rules, that receive as parameter a xml file with some
> values.
>
> Then if condition was evaluated to true, i want to add new nodes to that xml
> in the action pane.
> Example of schema:
>
> <request>
> ....
> </request>
> <response>
> <message> </message>
> </response>
>
> for each business rule that are evaluated to true, i want to add to the xml
> a new message node.
> Example of xml after conditions are evaluated:
>
> <request>
> ....
> </request>
> <response>
> <message>pass business rule A </message>
> <message>pass business rule D </message>
> <message>pass business rule F </message>
> </response>
>
> So, to do that, i think that the only way is developing a .Net assembly.
> is that true?
>
> I tried to create a new function that receive as parameter "response" node
> (instance of RuleEngine.TypedXmlDocument class), to append new child node.
> But it doesn't works.
>
> Any pointers???
>
> Thanks in advance,
> Mauri.-
>
>
>
| |
| Jurgen Willis 2004-08-11, 8:47 pm |
| You can create a .NET method that takes a
Microsoft.RuleEngine.TypedXmlDocument as a parameter. In the Composer, use
your method as a rule action and drag-and-drop the appropriate node from
the XML schema into your method. Within your code, you can call Document
on the TypedXmlDocument parameter to get the XmlNode and then add child
nodes to it.
|
|
|
|
|