<br>2011/1/11 Murali Venugopal <span dir="ltr"><<a href="mailto:murali.venugopal@sifycorp.com">murali.venugopal@sifycorp.com</a>></span><br><div class="gmail_quote"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div bgcolor="#ffffff" text="#000000">
Hi Wolffgang,<br>
<br>
Thanks for your quick response. I did as you say. now my rule file
when generated from excel sheet and printed in console looks like
this.<br>
<br>
package alertRouting;<br>
#generated from Decision Table<br>
import com.sify.beacon.events.RouteEvent;<br>
import com.sify.beacon.events.trapevent.Varbind;<br>
#From row number: 10<div class="im"><br>
rule "210.210.122.100 GroupA"<br>
<br></div>
when<br>
$event : RouteEvent(nodeIp == "210.210.122.100")<br>
$varbind : Varbind(oid == "1.3.6.1.2.1.2.2.1.1" &&
value == "5")<br>
from $event.varbindings<br>
then<br>
event.setGroup("GroupA");<br>
System.out.println("set to Group A");<br>
<br>
end<br>
<br>
it seems that the "from" clause is in the next line as a separate
condition. so, drools have considered it as a separate condition.<br></div></blockquote><div><br>DRL is free form, so line breaks don't matter.<br> <br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div bgcolor="#ffffff" text="#000000">
<br>
the error message is <br>
<br>
error java.lang.RuntimeException: Rule Compilation error : [Rule
name='210.210.122.100 GroupA']<br>
alertRouting/Rule_210_210_122_100_GroupA_0.java (7:397) : event
cannot be resolved<br></div></blockquote><div><br>"event" is the culprit. Now where is this "event"? Has it been declared? Where? Perhaps a typo?...<br> </div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div bgcolor="#ffffff" text="#000000">
<br>
also, i don't understand about implementing the dependency to the
cell in left. i tried logical, mathematical dependency conditions.
sorry for my ignorance.<br></div></blockquote><div><br>This requires spreadsheet functions, e.g.<br> =IF( D12="","","X" )<br>would be in E12. The cell reference is relative, so copying it dowm automatically changes D12 to D13, etc.<br>
<br>-W<br> </div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div bgcolor="#ffffff" text="#000000">
<br>
please help me resolve this issue.<br>
<pre cols="72"> _ _ _ _ |.
| | ||_|| (_||| \/
</pre><div><div></div><div class="h5">
On 01/11/2011 01:56 PM, Wolfgang Laun wrote:
<blockquote type="cite">There is a limit to what can be implemented using
decision tables. Some constructs are possible with hacks.<br>
<br>
In your case, you cannot have constraints with parameters and
"from" in the same column. You need 2 adjacent columns.<br>
<br>
CONDITION<br>
$varbind : Varbind<br>
oid == $1 && value == $2<br>
the pattern and constraints<br>
".1.3.6.1.2.1.2.2.1.1.0","5"<br>
----------------------------------------------------------------<br>
CONDITION<br>
<br>
from $event.varbindings<br>
the from clause<br>
x<br>
------------------------------------------------------------------<br>
<br>
Note the blank cell below CONDITION. The 'x' triggers the
insertion of the from clause. (It should be possible to implement
the dependency on the cell to the left by a simple spreadsheet
formula.)<br>
<br>
-W<br>
<br>
<br>
<br>
<br>
2011/1/11 Murali Venugopal <<a href="mailto:murali.venugopal@sifycorp.com" target="_blank">murali.venugopal@sifycorp.com</a>><br>
><br>
> hi,<br>
><br>
> i'm facing a problem with decision tables. i've got a .drl
working file. but when i happen to take that into a .xls file (
decision table ) it throws some errors.<br>
><br>
> my actual rule in .drl file has got something like this.<br>
><br>
> when<br>
><br>
> $event : RouteEvent( nodeIp == "192.168.1.12 )<br>
> $varbind : Varbind ( oid == ".1.3.6.1.2.1.2.2.1.1.0"
&& value == "5" ) from $event.varbindings<br>
><br>
> then<br>
> <br>
> System.out.println("some text")<br>
><br>
> here in my decision table, my first cell would have the first
condition<br>
><br>
> $event : RouteEvent<br>
> nodeIp == "$param"<br>
> that is, i've to omit my "(" and ")" braces.<br>
><br>
> so now, my second condition is<br>
><br>
> $varbind : Varbind<br>
> ( oid == "$1" && value == "$2" ) from
$event.varbindings<br>
><br>
> here i don't know how to omit the "(" and ")" braces. or
should i add and other layer of those braces.<br>
><br>
> anyway, the decision table is not working, where as my rule
file does.<br>
><br>
> the error message is<br>
><br>
> error java.lang.RuntimeException: [10,55]: [ERR 102] Line
10:55 mismatched input 'FROM' expecting ')' in rule
"210.210.122.100 GroupA" in pattern Varbind[10,77]: [ERR 102] Line
10:77 mismatched input ')' expecting 'then' in rule
"210.210.122.100 GroupA"<br>
><br>
> my doubt is,<br>
> in the first case all my condition expression is contained
with in braces. where as in second case, it's not. so how do i've
to handle this. do i've have to omit the braces in the second case
or not.<br>
><br>
> please help me. i've been struggling to solve this error.
also, i couldn't find references in the documentation.<br>
> thanks in advace.<br>
><br>
> _ _ _ _ |. <br>
> | | ||_|| (_||| \/<br>
><br>
> Whoever wants to be happy, let him be so: of tomorrow there's
no knowing<br>
><br>
> _______________________________________________<br>
> rules-users mailing list<br>
> <a href="mailto:rules-users@lists.jboss.org" target="_blank">rules-users@lists.jboss.org</a><br>
> <a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
><br>
<br>
<pre><fieldset></fieldset>
_______________________________________________
rules-users mailing list
<a href="mailto:rules-users@lists.jboss.org" target="_blank">rules-users@lists.jboss.org</a>
<a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a>
</pre>
</blockquote>
</div></div></div>
<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" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
<br></blockquote></div><br>