<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#ffffff" text="#000000">
    hey wolfgang,<br>
    <br>
    thanks a lot for your valuable and prompt help. it worked for me and
    i'm able to run the rule engine with a spread sheet rule.<br>
    for this, i'll be grateful to you.<br>
    <br>
    event resolved:<br>
    <br>
    actually "event" is imported and declared in the rule. the problem
    is, in the then part when i referred the event object i forgot to
    mention it with a preceding "$" symbol. and that was the culprit.
    when i was going through the documentation, it said the "$" symbol
    is not mandatory and it's optional.<br>
    <br>
    now i've found that, using the "$" symbol is optional. buf if you
    use it on a variable declaration, it's mandatory that you've to
    specify on further reference of that variable. today's findings...
    :-)<br>
    <br>
    spreadsheet dependency:<br>
    <br>
    actually it worked for me without implementing any dependency in the
    spreadsheet. probably i should educate myself in spreadsheet stuffs.<br>
    <br>
    <br>
    thanks once again. <br>
    <br>
    <pre class="moz-signature" cols="72"> _ _     _ _ |.    
| | ||_|| (_|||  \/


</pre>
    <br>
    On 01/11/2011 05:21 PM, Wolfgang Laun wrote:
    <blockquote
      cite="mid:AANLkTik6JXrCRxKtURJ2_5GKNmPQPXJFRkyL8GPeQwEu@mail.gmail.com"
      type="cite"><br>
      2011/1/11 Murali Venugopal <span dir="ltr">&lt;<a
          moz-do-not-send="true"
          href="mailto:murali.venugopal@sifycorp.com">murali.venugopal@sifycorp.com</a>&gt;</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>
              &nbsp;&nbsp; <br>
            </div>
            &nbsp;&nbsp;&nbsp; when<br>
            &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; $event : RouteEvent(nodeIp == "210.210.122.100")<br>
            &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; $varbind : Varbind(oid == "1.3.6.1.2.1.2.2.1.1"
            &amp;&amp; value == "5")<br>
            &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; from $event.varbindings<br>
            &nbsp;&nbsp;&nbsp; then<br>
            &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; event.setGroup("GroupA");<br>
            &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; 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>
          &nbsp;<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>
            &nbsp;error java.lang.RuntimeException: Rule Compilation error :
            [Rule name='210.210.122.100 GroupA']<br>
            &nbsp;&nbsp;&nbsp; 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>
          &nbsp;</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>
          &nbsp;&nbsp; =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>
          &nbsp;</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 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 &amp;&amp; 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 &lt;<a
                    moz-do-not-send="true"
                    href="mailto:murali.venugopal@sifycorp.com"
                    target="_blank">murali.venugopal@sifycorp.com</a>&gt;<br>
                  &gt;<br>
                  &gt; hi,<br>
                  &gt;<br>
                  &gt; 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>
                  &gt;<br>
                  &gt; my actual rule in .drl file has got something
                  like this.<br>
                  &gt;<br>
                  &gt; when<br>
                  &gt;<br>
                  &gt; &nbsp;&nbsp;&nbsp; $event : RouteEvent( nodeIp == "192.168.1.12
                  )<br>
                  &gt; &nbsp;&nbsp;&nbsp; $varbind : Varbind ( oid ==
                  ".1.3.6.1.2.1.2.2.1.1.0" &amp;&amp; value == "5" )
                  from $event.varbindings<br>
                  &gt;<br>
                  &gt; then<br>
                  &gt; &nbsp;&nbsp;&nbsp;<br>
                  &gt; &nbsp;&nbsp;&nbsp; System.out.println("some text")<br>
                  &gt;<br>
                  &gt; here in my decision table, my first cell would
                  have the first condition<br>
                  &gt;<br>
                  &gt; $event : RouteEvent<br>
                  &gt; nodeIp == "$param"<br>
                  &gt; that is, i've to omit my "(" and ")" braces.<br>
                  &gt;<br>
                  &gt; so now, my second condition is<br>
                  &gt;<br>
                  &gt; $varbind : Varbind<br>
                  &gt; ( oid == "$1" &amp;&amp; value == "$2" ) from
                  $event.varbindings<br>
                  &gt;<br>
                  &gt; here i don't know how to omit the "(" and ")"
                  braces. or should i add and other layer of those
                  braces.<br>
                  &gt;<br>
                  &gt; anyway, the decision table is not working, where
                  as my rule file does.<br>
                  &gt;<br>
                  &gt; the error message is<br>
                  &gt;<br>
                  &gt; &nbsp;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>
                  &gt;<br>
                  &gt; my doubt is,<br>
                  &gt; 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>
                  &gt;<br>
                  &gt; please help me. i've been struggling to solve
                  this error. also, i couldn't find references in the
                  documentation.<br>
                  &gt; thanks in advace.<br>
                  &gt;<br>
                  &gt; &nbsp;_ _ &nbsp; &nbsp; _ _ |. &nbsp; &nbsp;<br>
                  &gt; | | ||_|| (_||| &nbsp;\/<br>
                  &gt;<br>
                  &gt; Whoever wants to be happy, let him be so: of
                  tomorrow there's no knowing<br>
                  &gt;<br>
                  &gt; _______________________________________________<br>
                  &gt; rules-users mailing list<br>
                  &gt; <a moz-do-not-send="true"
                    href="mailto:rules-users@lists.jboss.org"
                    target="_blank">rules-users@lists.jboss.org</a><br>
                  &gt; <a moz-do-not-send="true"
                    href="https://lists.jboss.org/mailman/listinfo/rules-users"
                    target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
                  &gt;<br>
                  <br>
                  <pre><fieldset></fieldset>
_______________________________________________
rules-users mailing list
<a moz-do-not-send="true" href="mailto:rules-users@lists.jboss.org" target="_blank">rules-users@lists.jboss.org</a>
<a moz-do-not-send="true" 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 moz-do-not-send="true"
            href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a><br>
          <a moz-do-not-send="true"
            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>
      <pre wrap="">
<fieldset class="mimeAttachmentHeader"></fieldset>
_______________________________________________
rules-users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a>
<a class="moz-txt-link-freetext" href="https://lists.jboss.org/mailman/listinfo/rules-users">https://lists.jboss.org/mailman/listinfo/rules-users</a>
</pre>
    </blockquote>
  </body>
</html>