Yeah,<br><br>I&#39;d second that. Mark&#39;s approach actually had me all dazed right from the second line. I need to use Drools to accomplish a rather simple task, however the suggestions made by Mark had me all lost. <br>
<br>My requirement is that I have an <span style="font-style: italic;">input </span>XML which my application should parse and output another XML. The <span style="font-style: italic;">output </span>XML will have tags and values capturing the required business model. The structure of the 
<span style="font-style: italic;">input </span>XML is something like this:<br><br>&nbsp;&nbsp;&nbsp; &lt;parent name=&quot;aaaaaaa&quot;&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;child value=&quot;sdfsdfsdf&quot;/&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;child value=&quot;sdfsdfsdf&quot;/&gt;
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;child value=&quot;sdfsdfsdf&quot;/&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;child value=&quot;sdfsdfsdf&quot;/&gt;<br>&nbsp;&nbsp;&nbsp; &lt;/parent&gt;<br><br>Now the transformation of this input XML has to be done condition to certain rules which our client will provide us. I thought Drools would fit in very well. However after reading and acquiring a basic understanding I came across this particular limitation.
<br><br>My problem arises since, the input bean&#39;s <span style="font-style: italic;">parent </span>tag can have varying number of <span style="font-style: italic;">child </span>tags. As a consequence, I can&#39;t define a single Bean class to capture this XML data. I can capture the data in a HashMap, but then I can&#39;t access the 
<span style="font-style: italic;">key-value </span>pairs from the &quot;<span style="font-style: italic;">when</span>&quot; block of a rule.<br><br><span style="font-style: italic;">Arjun, </span>as you suggested,<br>- can you tell me whether I can really utilize 
<span style="font-style: italic;">DynaBeans </span>to meet my ends in this particular case?<br>- Can you also let me know a simple approach I can adopt? <br>- also, if <span style="font-style: italic;">eval </span>can be used in this case, can you pass across an example to show how to access say, the 
<span style="font-style: italic;">key-values</span> from a HashMap set in the asserted Bean object.<br><br>Amongst the other Rule Engines, I still think that Drools fits in best. A little help perhaps?<br><br>Thanks a lot!
<br>Anirvan<br><br><br><br><br><div><span class="gmail_quote">On 5/15/07, <b class="gmail_sendername">Arjun Dhar</b> &lt;<a href="mailto:dhar_ar@yahoo.com">dhar_ar@yahoo.com</a>&gt; wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Mark Proctor &lt;mproctor &lt;at&gt; <a href="http://codehaus.org">codehaus.org</a>&gt; writes:<br><br>&gt;<br>&gt;<br>&gt; You need to alter the parser and the Extractor api, you also need to be<br>&gt; able to deal with ShadowFacts, where we need to know the previous and
<br>&gt; current value.Further to that nested value should not change without<br>&gt; notifying the parent fact in the network - i.e. correct network state<br>&gt; must always been maintained. It&#39;s a complex area, we are looking at a
<br>&gt; work around that allows this declarative language, but rewrites it as<br>&gt; an eval - so you don&#39;t get the performance advantages - but it&#39;s a<br>&gt; quick work around for now.<br>&gt; Mark<br><br>If what you want is the ability to extend the use of the class beyond what it
<br>was designed for (like a Dyna Bean, I think it is that!), then as a work around<br>you could use &#39;eval&#39; over your object methods also, but this practice is<br>discouraged for a few reasons.<br><br>The other more sophisticated approach is already given by Mark!
<br><br>regards,<br>Arjun<br><br>_______________________________________________<br>rules-dev mailing list<br><a href="mailto:rules-dev@lists.jboss.org">rules-dev@lists.jboss.org</a><br><a href="https://lists.jboss.org/mailman/listinfo/rules-dev">
https://lists.jboss.org/mailman/listinfo/rules-dev</a><br></blockquote></div><br>