Leyzerzon, Simeon | 3 Mar 2004 21:49

[drools-interest] configuration question

Hello,

I'm trying to set up the environment to run the tests provided with
drools-2.0-beta-13.
When running org.drools.examples.familyTree.Main I'm getting this error:

D:\drools\drools-examples\src\main>java org.drools.examples.familyTree.Main
Exception in thread "main" java.lang.UnsupportedClassVersionError:
org/xml/sax/h
elpers/DefaultHandler (Unsupported major.minor version 48.0)
        at java.lang.ClassLoader.defineClass0(Native Method)
        at java.lang.ClassLoader.defineClass(ClassLoader.java:695)
        at
java.security.SecureClassLoader.defineClass(SecureClassLoader.java:13
3)
        at java.net.URLClassLoader.defineClass(URLClassLoader.java:319)
        at java.net.URLClassLoader.access$400(URLClassLoader.java:92)
        at java.net.URLClassLoader$ClassFinder.run(URLClassLoader.java:677)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:238)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:514)
        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:441)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:446)
        at java.lang.ClassLoader.defineClass0(Native Method)
        at java.lang.ClassLoader.defineClass(ClassLoader.java:695)
        at
java.security.SecureClassLoader.defineClass(SecureClassLoader.java:13
3)
        at java.net.URLClassLoader.defineClass(URLClassLoader.java:319)
        at java.net.URLClassLoader.access$400(URLClassLoader.java:92)
(Continue reading)

bob mcwhirter | 3 Mar 2004 22:02

Re: [drools-interest] configuration question


I just use the parser that comes with the 1.4.x jdk, and it seems
to work.

Though, your exception actually looks like a jvm mismatch problem.
Are you compiling for 1.4 but attempting to run against a 1.3 jvm?

		-bob

On Wed, 3 Mar 2004, Leyzerzon, Simeon wrote:

> Hello,
>
> I'm trying to set up the environment to run the tests provided with
> drools-2.0-beta-13.
> When running org.drools.examples.familyTree.Main I'm getting this error:
>
> D:\drools\drools-examples\src\main>java org.drools.examples.familyTree.Main
> Exception in thread "main" java.lang.UnsupportedClassVersionError:
> org/xml/sax/h
> elpers/DefaultHandler (Unsupported major.minor version 48.0)
>         at java.lang.ClassLoader.defineClass0(Native Method)
_______________________________________________
drools-interest mailing list
drools-interest <at> lists.codehaus.org
http://lists.codehaus.org/mailman/listinfo/drools-interest

.

(Continue reading)

David Barron | 4 Mar 2004 03:56
Picon
Favicon

[drools-interest] Newcomer Q - Ruleset Editors

Hi, I find Drools intriguing (coming from a CLIPS
background), and I am wondering if the .drl file is
the standard unit to edit, or whether there is
open-source software that hides the XML "decorations"
from the ruleset author?  (I've reviewed the Fibonacci
and other examples in CVS.)

I saw an archived email about a "store lighting"
example which used a cleaner syntax, but haven't been
able to identify what editor might support that
syntax, if any.

(If I failed to look somewhere obvious, pardon.  This
may just be a naive question about how to work with
XML effectively.)

Also, I was looking for info on the minimum required
.jars (for core drl syntax with embedded java)?

Thank you kindly,
David

__________________________________
Do you Yahoo!?
Yahoo! Search - Find what you’re looking for faster
http://search.yahoo.com
_______________________________________________
drools-interest mailing list
drools-interest <at> lists.codehaus.org
http://lists.codehaus.org/mailman/listinfo/drools-interest
(Continue reading)

Rui Baeta | 4 Mar 2004 18:38
Picon
Favicon

[drools-interest] Object Persistence

Hello!

Rules Engine in my project is now roaring! But not yet finished :)

Now I come up with one question: how to assure object persistence in a rule
session? That is, if machine hangs up, how to get rule engine session in the
state it was before crash? I'm using a stateful rule session (jsr-94), could
it be backed up by some persistent resource, like jdbc connection, file, etc?

Thanks!
Rui Baeta
--
Opensoft, Lda
Taguspark, NĂșcleo Central, Sala 204
2780-920 Porto Salvo
Portugal

_______________________________________________
drools-interest mailing list
drools-interest <at> lists.codehaus.org
http://lists.codehaus.org/mailman/listinfo/drools-interest

.

jayanthi kumar | 6 Mar 2004 05:52
Picon
Favicon

[drools-interest] Re: [Drools-interest]Regarding the DataStructure


Hello,
              Iam newbee to this mailing list.Currently iam doing project in building the rule engine.Drools engine inspired me a lot.Because it deals directly with the objects.I have a doubt  regarding to the the format of the datastructure used before the Rete-oo network generation.In which format all the rule semantic stuctures has been converted before the network generation.
 
Thanks in Advance
Jayanthi

Do you Yahoo!?
Yahoo! Search - Find what you
Steven Warren | 8 Mar 2004 02:48

[drools-interest] Resetting working memory to a known state

Hi,
  I would like to see a feature that allowed me to reset the working memory to a "checkpoint" state. That is, efficiently retract all facts asserted after the "checkpoint". Please let me know what you all think of that kind of feature.
 
  In the meantime, I can achieve a similar result if I could retrieve all facts from working memory (and retract the ones I don't want to keep). However, the interface for working memory doesn't allow that. Is there a reason for this, or should I just add a getFacts() method akin to the getObjects() method?
 
Regards
Steve
Florent LIOULT | 10 Mar 2004 19:57
Favicon

[drools-interest] Re: All conditions are tested even if a prior condition is false

>I think what can happen is that the semantic modules can just generate
addtional rules to handle the
>"else" conditions on the fly as they come across "else" consequences.

What do you mean by "else". If condition C is true when do action A else do
action A'. But, when do you know that C is not true ? In general rule engine,
you never know that. Think about existential rule such "if exist A such A = 5
then do something". The rule is potentialy never false because you can always
add fact to satisfy it. There are solution in case of less expressive rule
engine but it still requires noticable change in the RETE code. If you want
to do the work at the semantic module, you must find a way to negate a
condition. It's not trivial at all.

>Even though the first condition is not satisfied (no matching trigger
instance exists), the third
>condition is being tested (and gets a null pointer violation. Shouldn't the
later conditions not be
>tested if the earlier condition is not satisfied. I thought that was the
point of making the condition
>ests a list rather then a set.

There is a strong paradigm in rule engine based on RETE algorithm : there is
no guarantee about the order of evaluation. If you break this rule, just
don't use a RETE based engine because it will become useless. All of this
optimization work is related to this ability to "explode" condition.

  <rule name="Calculate the extrema of two evaluation points" >
    <parameter identifier="a">
      <java:class>Alpha</java:class>
    </parameter>
    <parameter identifier="b">
      <java:class>Beta</java:class>
    <java:condition>a == 5</java:condition>
    <java:condition>b == 3</java:condition>
    <java:consequence>
        ...
    </java:consequence>
  </rule>

If you insert a 'Beta' fact into the working memory, the second part of the
condition will be tested. Then engine won't wait until an 'Alpha' is
inserted. Why ? Because this test could be shared among many rules. You can
have antother rule with the "b == 3" test inside. The power of RETE is to
mutualize all common tests in order to execute them once. If you really need
such a feature, write something like :

  <rule name="Calculate the extrema of two evaluation points" >
    <parameter identifier="a">
      <java:class>Alpha</java:class>
    </parameter>
    <parameter identifier="b">
      <java:class>Beta</java:class>
    <java:condition>a == 5 && b == 3</java:condition>
    <java:consequence>
        ...
    </java:consequence>
  </rule>

This way you will benefit of Java ordered evaluation. If you always use this
kind of trick, think about using something else than Drools. A rule engine
without RETE feature is very easy to realize.

- Florent Lioult
_______________________________________________
drools-interest mailing list
drools-interest <at> lists.codehaus.org
http://lists.codehaus.org/mailman/listinfo/drools-interest

.

Walsh, John E | 10 Mar 2004 20:15

RE: [drools-interest] Re: All conditions are tested even if a pri or condition is false

Hi all,

Maybe I'm not getting this right but it seems to me that this is along the
lines of adding an 'OR' type expression. I thought that in Rule Systems 'OR'
conditions were prohibited and that one should only use 'AND' logical
expressions. Isn't it the case that if you need to handle the 'else'
situations, that should be encapsulated into a separate Rule? I don't see
the advantage of making the rules so convoluted. Also, it seems that adding
an else situation would be rather dangerous as there is far more of an
unknown quantity with alternative conditions.

John Walsh

-----Original Message-----
From: Florent LIOULT [mailto:flioult <at> financeactive.com] 
Sent: Wednesday, March 10, 2004 1:57 PM
To: drools-interest <at> lists.codehaus.org
Subject: [drools-interest] Re: All conditions are tested even if a prior
condition is false

>I think what can happen is that the semantic modules can just generate
addtional rules to handle the
>"else" conditions on the fly as they come across "else" consequences.

What do you mean by "else". If condition C is true when do action A else do
action A'. But, when do you know that C is not true ? In general rule
engine,
you never know that. Think about existential rule such "if exist A such A =
5
then do something". The rule is potentialy never false because you can
always
add fact to satisfy it. There are solution in case of less expressive rule
engine but it still requires noticable change in the RETE code. If you want
to do the work at the semantic module, you must find a way to negate a
condition. It's not trivial at all.

>Even though the first condition is not satisfied (no matching trigger
instance exists), the third
>condition is being tested (and gets a null pointer violation. Shouldn't the
later conditions not be
>tested if the earlier condition is not satisfied. I thought that was the
point of making the condition
>ests a list rather then a set.

There is a strong paradigm in rule engine based on RETE algorithm : there is
no guarantee about the order of evaluation. If you break this rule, just
don't use a RETE based engine because it will become useless. All of this
optimization work is related to this ability to "explode" condition.

  <rule name="Calculate the extrema of two evaluation points" >
    <parameter identifier="a">
      <java:class>Alpha</java:class>
    </parameter>
    <parameter identifier="b">
      <java:class>Beta</java:class>
    <java:condition>a == 5</java:condition>
    <java:condition>b == 3</java:condition>
    <java:consequence>
        ...
    </java:consequence>
  </rule>

If you insert a 'Beta' fact into the working memory, the second part of the
condition will be tested. Then engine won't wait until an 'Alpha' is
inserted. Why ? Because this test could be shared among many rules. You can
have antother rule with the "b == 3" test inside. The power of RETE is to
mutualize all common tests in order to execute them once. If you really need
such a feature, write something like :

  <rule name="Calculate the extrema of two evaluation points" >
    <parameter identifier="a">
      <java:class>Alpha</java:class>
    </parameter>
    <parameter identifier="b">
      <java:class>Beta</java:class>
    <java:condition>a == 5 && b == 3</java:condition>
    <java:consequence>
        ...
    </java:consequence>
  </rule>

This way you will benefit of Java ordered evaluation. If you always use this
kind of trick, think about using something else than Drools. A rule engine
without RETE feature is very easy to realize.

- Florent Lioult
_______________________________________________
drools-interest mailing list
drools-interest <at> lists.codehaus.org
http://lists.codehaus.org/mailman/listinfo/drools-interest
_______________________________________________
drools-interest mailing list
drools-interest <at> lists.codehaus.org
http://lists.codehaus.org/mailman/listinfo/drools-interest

.

Jaime Garza | 10 Mar 2004 23:31
Favicon

[drools-interest] Languages quesdtion

Probably for Bob, but let's see...

I have a group of people in my organization that are javascript geeks,
who would be my target goup for writing rules. I am looking to see if I
implement a BSF based javascript engine with Mozilla Rhino.  I started
thinking I could clone the drools-java module (copy/paste is a design
pattern ;-).) While doing a review of the java source code, I realized
that a run of parsing/lexing of the expressions is done with antlr 2.7
to extract the parameters, for some reason I cannot see.

Questions:

1. Why did you guys did not do jakarta commons BSF all the way (it
supports BSH natively)?
2. Is there a reason for all this parsing?
3. If I do my own BSF implementation, does the license require me to
send you the code (i.e. GPL-like licensing)? Will you guys care for such
a codebase? This is important before I start, because I would code as
org.drools, as opposed to com.newscale as my package base.

- Jaime Garza
_______________________________________________
drools-interest mailing list
drools-interest <at> lists.codehaus.org
http://lists.codehaus.org/mailman/listinfo/drools-interest

.

Steven Warren | 10 Mar 2004 23:48

RE: [drools-interest] Re: All conditions are tested even if a prior condition is false

Hi!
  Well, let me talk to both emails at the same time as the questions
overlap.

I agree with your first point Florent, that is that a "NOT" and also a
"NOT NOT" (in other words "EXISTS") feature in drools needs to be built.
That is already covered in a different JIRA, so my JIRA just assumes it
will be done :)

Having the other JIRA satisfied, It can (as you agree I think) be built
at a semantic level.

On your second point, I disagree. I don't think I said anything about
the order in which the conditions are evaluated (although you do make an
excellent point on that, Bob, I believe, is pondering the particular use
cases as we speak :) ). I only asserted about whether prior listed
conditions are matched. Let me give an example which I hope will clear
up John's question as well:

Let's say you write the following rules (I'm making up the syntax):

<rule name="Get the apple">
  <parameter identifier="monkey">
    <java:class>Monkey</java:class>
  </parameter>
  <java:condition>monkey.isOnTable()</java:condition>
  <java:condition>monkey.hasPole()</java:condition>
  <java:consequence>
    System.out.println("Monkey hits the apple with the pole");
  </java:consequence>
</rule>

<rule name="Get the pole">
  <parameter identifier="monkey">
    <java:class>Monkey</java:class>
  </parameter>
  <parameter identifier="goal">
    <java:class>java.lang.String</java:class>
  </parameter>
  <java:condition>goal.equals("GETPOLE")</java:condition>
  <java:condition>!monkey.hasPole()</java:condition>
  <java:consequence>
    System.out.println("Monkey get's the pole");
    retractObject(goal);
  </java:consequence>
</rule>

Now I could write all the rules that resolve into the monkey needing the
pole and invoking the getpole rule, or if I had the "else" feature I
could write the rules like this:

<rule name="Hit the apple">
  <parameter identifier="monkey">
    <java:class>Monkey</java:class>
  </parameter>
  <parameter identifier="pole">
    <java:class>Pole</java:class>
  </parameter>
  <java:condition>monkey.isOnTable()</java:condition>
  <java:condition else="Need pole">pole.isOnTable()</java:condition>
  <java:consequence>
    System.out.println("Monkey hits the apple with the pole");
  </java:consequence>
  </java:consequence else="Need pole">
    assertObject("GETPOLE");
  </java:consequence>
</rule>

<rule name="Get the pole">
  <parameter identifier="monkey">
    <java:class>Monkey</java:class>
  </parameter>
  <parameter identifier="goal">
    <java:class>java.lang.String</java:class>
  </parameter>
  <java:condition>goal.equals("GETPOLE")</java:condition>
  <java:consequence>
    System.out.println("Monkey get's the pole");
    modifyObject(pole);
    retractObject(goal);
  </java:consequence>
</rule>

The above syntax would (on the fly) generate the following additional
rule (of course assuming the "not" feature):

<rule name="Hit the apple - generated goal of: Need pole">
  <parameter identifier="monkey">
    <java:class>Monkey</java:class>
  </parameter>
  <parameter identifier="pole">
    <java:class>Pole</java:class>
  </parameter>
  <java:condition>monkey.isOnTable()</java:condition>
  <java:condition match="NOT">pole.isOnTable()</java:condition>
  </java:consequence>
    assertObject("GETPOLE");
  </java:consequence>
</rule>

And the semantic module could generate all those extra rules, THAT would
be much much easier to read and maintain. It also doesn't do anything
you can't do by hand, it's just very error prone and hard to maintain if
you try to do this by hand in more complex cases.

Steve

-----Original Message-----
From: drools-interest-admin <at> lists.codehaus.org
[mailto:drools-interest-admin <at> lists.codehaus.org] On Behalf Of Walsh,
John E
Sent: Wednesday, March 10, 2004 11:16 AM
To: drools-interest <at> lists.codehaus.org
Subject: RE: [drools-interest] Re: All conditions are tested even if a
prior condition is false

Hi all,

Maybe I'm not getting this right but it seems to me that this is along
the lines of adding an 'OR' type expression. I thought that in Rule
Systems 'OR' conditions were prohibited and that one should only use
'AND' logical expressions. Isn't it the case that if you need to handle
the 'else' situations, that should be encapsulated into a separate Rule?
I don't see the advantage of making the rules so convoluted. Also, it
seems that adding an else situation would be rather dangerous as there
is far more of an unknown quantity with alternative conditions.

John Walsh

-----Original Message-----
From: Florent LIOULT [mailto:flioult <at> financeactive.com] 
Sent: Wednesday, March 10, 2004 1:57 PM
To: drools-interest <at> lists.codehaus.org
Subject: [drools-interest] Re: All conditions are tested even if a prior
condition is false

>I think what can happen is that the semantic modules can just generate
addtional rules to handle the
>"else" conditions on the fly as they come across "else" consequences.

What do you mean by "else". If condition C is true when do action A else
do action A'. But, when do you know that C is not true ? In general rule
engine, you never know that. Think about existential rule such "if exist
A such A = 5 then do something". The rule is potentialy never false
because you can always add fact to satisfy it. There are solution in
case of less expressive rule engine but it still requires noticable
change in the RETE code. If you want to do the work at the semantic
module, you must find a way to negate a condition. It's not trivial at
all.

>Even though the first condition is not satisfied (no matching trigger
instance exists), the third
>condition is being tested (and gets a null pointer violation. Shouldn't

>the
later conditions not be
>tested if the earlier condition is not satisfied. I thought that was 
>the
point of making the condition
>ests a list rather then a set.

There is a strong paradigm in rule engine based on RETE algorithm :
there is no guarantee about the order of evaluation. If you break this
rule, just don't use a RETE based engine because it will become useless.
All of this optimization work is related to this ability to "explode"
condition.

  <rule name="Calculate the extrema of two evaluation points" >
    <parameter identifier="a">
      <java:class>Alpha</java:class>
    </parameter>
    <parameter identifier="b">
      <java:class>Beta</java:class>
    <java:condition>a == 5</java:condition>
    <java:condition>b == 3</java:condition>
    <java:consequence>
        ...
    </java:consequence>
  </rule>

If you insert a 'Beta' fact into the working memory, the second part of
the condition will be tested. Then engine won't wait until an 'Alpha' is
inserted. Why ? Because this test could be shared among many rules. You
can have antother rule with the "b == 3" test inside. The power of RETE
is to mutualize all common tests in order to execute them once. If you
really need such a feature, write something like :

  <rule name="Calculate the extrema of two evaluation points" >
    <parameter identifier="a">
      <java:class>Alpha</java:class>
    </parameter>
    <parameter identifier="b">
      <java:class>Beta</java:class>
    <java:condition>a == 5 && b == 3</java:condition>
    <java:consequence>
        ...
    </java:consequence>
  </rule>

This way you will benefit of Java ordered evaluation. If you always use
this kind of trick, think about using something else than Drools. A rule
engine without RETE feature is very easy to realize.

- Florent Lioult _______________________________________________
drools-interest mailing list
drools-interest <at> lists.codehaus.org
http://lists.codehaus.org/mailman/listinfo/drools-interest
_______________________________________________
drools-interest mailing list
drools-interest <at> lists.codehaus.org
http://lists.codehaus.org/mailman/listinfo/drools-interest

_______________________________________________
drools-interest mailing list
drools-interest <at> lists.codehaus.org
http://lists.codehaus.org/mailman/listinfo/drools-interest

.


Gmane