Could you please provide your Instance class ? <br><br><br><div><span class="gmail_quote">On 9/27/07, <b class="gmail_sendername">Isabelle Hupont</b> <<a href="mailto:ihupont@ita.es">ihupont@ita.es</a>> wrote:</span>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><br>Hi!<br><br>I want to program the following drl rule in xml:<br><br>rule "average calculation"
<br> no-loop true<br> when<br> _i : Instance()<br> _average : Double()<br> from accumulate(accInst: Instance(),<br> average(
accInst.value("tend")))<br> eval(_average < 20000)<br> then<br> _i.setValue("tend",2000);<br>end<br><br><br>For it, I have implemented the following xml file:<br>
<br><?xml version="1.0" encoding="UTF-8"?><br><package name="org.prophet.fuzzy" xmlns="<a href="http://drools.org/drools-4.0">http://drools.org/drools-4.0</a>"<br> xmlns:xs="
<a href="http://www.w3.org/2001/XMLSchema-instance">http://www.w3.org/2001/XMLSchema-instance</a>"<br>xs:schemaLocation="<a href="http://drools.org/drools-4.0">http://drools.org/drools-4.0</a> drools-4.0.xsd">
<br> <import name="weka.core.*"/><br> <import name="org.prophet.gui.docking.*"/><br> <import name="org.prophet.persistence.*"/><br> <import name="org.prophet.persistence.hibernate.*
"/><br> <import name="org.prophet.rules.*"/><br> <import name="org.prophet.*"/><br> <rule name="Rule1"><br> <rule-attribute name="no-loop" value="true"/>
<br> <lhs><br> <pattern identifier="_i" object-type="Instance"/><br> <pattern identifier="_average" object-type="Double"><br> <from>
<br> <accumulate><br> <pattern identifier="accInst"<br>object-type="Instance"/><br> <external-function evaluator="average"
<br>expression="accInst.value(&quot;tend&quot;)"/><br> </accumulate><br> </from><br> </pattern><br> <eval>_average &lt;
20000.0</eval><br> </lhs><br> <rhs><br>_i.setValue("tend", 2000.0); manageRuleFired("Rule1", null, _i);<br>modify(_i);</rhs><br> </rule><br></package>
<br><br>And I have the following error when reading the rule package:<br><br>org.drools.rule.InvalidRulePackage: Rule Compilation error _average cannot<br>be resolved _i cannot be resolved _i cannot be resolved _i__Handle__ cannot
<br>be resolved _i cannot be resolved<br><br><br>I also have tried to replace the xml identifier <pattern> by <column> with<br>no result. Can you help me, please?<br><br><br>--<br>View this message in context:
<a href="http://www.nabble.com/accumulate-funtion-in-xml-tf4526879.html#a12916380">http://www.nabble.com/accumulate-funtion-in-xml-tf4526879.html#a12916380</a><br>Sent from the drools - user mailing list archive at <a href="http://Nabble.com">
Nabble.com</a>.<br><br>_______________________________________________<br>rules-users mailing list<br><a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a><br><a href="https://lists.jboss.org/mailman/listinfo/rules-users">
https://lists.jboss.org/mailman/listinfo/rules-users</a><br></blockquote></div><br><br clear="all"><br>-- <br>Fernando Meyer <a href="http://fmeyer.org">http://fmeyer.org</a><br>JBoss Rules Core Developer<br><a href="mailto:fmcamargo@gmail.com">
fmcamargo@gmail.com</a>