Help with "contains" keyword
by Bynum, Joe
I'm doing some simple evaluation of jrules and I ran into a problem.
Here's the rule I'm having problems with:
rule "751845 - Check Stages"
when
order : Order( stages excludes 921 )
then
System.out.println( "This order contains " + order.getStages()
);
end
OUTPUT:
This order contains [804, 921]
I'm actually trying to do the opposite using 'stages contains 921'.
stages is defined as follows in the Order object.
private ArrayList<Integer> stages;
I'm using the 3.0.6 binaries on W2K w/Eclipse.
Any ideas what I'm doing wrong here?
17 years, 7 months
allowing self joining combinations
by Michael Neale
I know that we by default remove self joins, ie:
when
Foo()
Foo()
will not match for the same instance of Foo - is it possible to turn that
off? I know we talked about it at one point, not sure what the latest
position is (someone was asking me and I can't recall what our final
position is). FYI Jess and Jrules both self join by default.
17 years, 7 months
ClassFieldInspector and Groovy Classes
by Terry Laurenzo
The attached diff (against 3.0.5 sources) adds a condition to the
ClassFieldInspector to not analyze methods named <clinit>. For some
reason, the Groovy compiler is outputing classes that were causing
this check to choke and throw an IllegalArgumentException because of
a <clinit> method with ACC_PUBLIC access code.
Applying this patch allows Drools to operate correctly with compiled
Groovy Fact classes.
This seems like a pretty innocuous change that someone should apply
to SVN. Unfortunately, it is rather difficult to create a test case
for it.
Terry Laurenzo
17 years, 7 months
Persistent store and web administration
by Schwenker, Stephen
Hello,
We have been using jboss rules for 6 months now and find it to be a good
tool overall. On the other hand we have noticed a few down sides.
Currently our rule engine runs on a jboss server and is deployed in a
sar. Every time we want to change the rules, we have to re-package and
re-deploy the app.
We want to advance our solution by providing a web application to
administer the rules. The first step of this will be to create a form
of persistent store for the rules. My first thought is to put it into a
database because we can then manage it easily with a web admin. Has
anyone done some work on this or can give me some ideas on how I should
start working on this? I'm willing to contribute some of my code to the
project if anyone is interested.
Thank you,
Steve.
17 years, 7 months
Persistent store and web administration
by Schwenker, Stephen
Hello,
We have been using jboss rules for 6 months now and find it to be a good
tool overall. On the other hand we have noticed a few down sides.
Currently our rule engine runs on a jboss server and is deployed in a
sar. Every time we want to change the rules, we have to re-package and
re-deploy the app.
We want to advance our solution by providing a web application to
administer the rules. The first step of this will be to create a form
of persistent store for the rules. My first thought is to put it into a
database because we can then manage it easily with a web admin. Has
anyone done some work on this or can give me some ideas on how I should
start working on this? I'm willing to contribute some of my code to the
project if anyone is interested.
Thank you,
Steve.
17 years, 7 months
What is the real benifit of 'From' - DB performance Vs Rete
by Arjun Dhar
Hi,
I'm aware that you are working on 'From', to pull external data and use it in
the Rule conditions for comparison with that external data.
Three Questions:
Q1. I could define my own business object that fetches in the data? Cant I?
What additional benifit does 'From' give me?
Q2. I use Decision Tables extensively; how do I use 'From' in a decision table?
is it like a Keyword,.. but I cant imagine how it would be used? Could you
please give an example.
Q3. When executing PL/SQL logic, the data is at the database itself and so is
the logic.
3.1. If we decide to abstract the logic to rules and fetch data from the
database, in theory wouldnt pure PL/SQL be faster inspite of Rete running the
logic?
3.2. Since most mainstream applications use external data, when we talk about
SPEED how significant can the rule engine be? If my conditions depend on
external data, does the speed of the rule engine really count? Unless the rule
engine is sitting inside the database I have my doubts.
... The above are pratical issues that am sure everyone would ask.
Thanks,
Arjun
17 years, 7 months
build error on jbrms 3.1.0-M1
by Nishant Anshul
Hi,
I m trying to configure JBRMS and have checkedout all the stuff from
http://anonsvn.labs.jboss.com/labs/jbossrules/tags/3.1.0-M1/
Maven 2.0.6 is installed on my m/c.
When I run > maven install
It throws a build error...
Appreciate if someone can help.
************************************************************************
***
C:\Program Files\Subversion\xyz>mvn install
[INFO] Scanning for projects...
[INFO] Reactor build order:
[INFO] Drools
[INFO] Drools :: Rete-OO Core
[INFO] Drools :: Compiler
[INFO] Drools :: JSR-94 API Module
[INFO] Drools :: Decision Tables
[INFO]
------------------------------------------------------------------------
-
---
[INFO] Building Drools
[INFO] task-segment: [install]
[INFO]
------------------------------------------------------------------------
-
---
Downloading:
http://repo1.maven.org/maven2/org/apache/maven/plugins/maven-site-p
lugin/2.0-beta-5/maven-site-plugin-2.0-beta-5.pom
2K downloaded
Downloading:
http://repo1.maven.org/maven2/org/apache/maven/plugins/maven-plugin
s/1/maven-plugins-1.pom
3K downloaded
Downloading:
http://repo1.maven.org/maven2/org/apache/maven/maven-parent/1/maven
-parent-1.pom
6K downloaded
Downloading:
http://repo1.maven.org/maven2/org/apache/apache/1/apache-1.pom
3K downloaded
...........................
...........................
.............................
Downloading:
http://repository.jboss.com/maven2//org/apache/maven/doxia/doxia-de
coration-model/1.0-alpha-8/doxia-decoration-model-1.0-alpha-8.jar
115K downloaded
[WARNING] *** CHECKSUM FAILED - Checksum failed on download: local =
'54a6889ed8
0e1f300af58630a6e5d6a383cce830'; remote =
'831bbaf463d4594782d78415eb96980f638de
477' - RETRYING
Downloading:
http://repository.jboss.com/maven2//org/apache/maven/doxia/doxia-de
coration-model/1.0-alpha-8/doxia-decoration-model-1.0-alpha-8.jar
115K downloaded
[WARNING] *** CHECKSUM FAILED - Checksum failed on download: local =
'b52e3f094a
c3f24a22a190aaa8e2eb34f7e2459b'; remote =
'831bbaf463d4594782d78415eb96980f638de
477' - IGNORING
Downloading:
http://repo1.maven.org/maven2/org/apache/maven/doxia/doxia-site-ren
derer/1.0-alpha-8/doxia-site-renderer-1.0-alpha-8.jar
33K downloaded
Downloading:
http://repository.jboss.com/maven2//org/codehaus/plexus/plexus-i18n
/1.0-beta-6/plexus-i18n-1.0-beta-6.jar
90K downloaded
[WARNING] *** CHECKSUM FAILED - Checksum failed on download: local =
'10c8835260
d4db9c1c5f307885e49227b567c1e4'; remote =
'0de20e1eea680fc277fddb66bc24ba40d4491
68b' - RETRYING
Downloading:
http://repository.jboss.com/maven2//org/codehaus/plexus/plexus-i18n
/1.0-beta-6/plexus-i18n-1.0-beta-6.jar
90K downloaded
[WARNING] *** CHECKSUM FAILED - Checksum failed on download: local =
'a02dd72369
c6a3ec6c00ff2f238bd16891cab73c'; remote =
'0de20e1eea680fc277fddb66bc24ba40d4491
68b' - IGNORING
Downloading:
http://repo1.maven.org/maven2/org/mortbay/jetty/jetty/6.0.0beta12/j
etty-6.0.0beta12.jar
463K downloaded
Downloading:
http://repository.jboss.com/maven2//commons-collections/commons-col
lections/2.0/commons-collections-2.0.jar
Downloading: file://C:\Program
Files\Subversion\xyz/repository/commons-collectio
ns/commons-collections/2.0/commons-collections-2.0.jar
Downloading:
http://repo1.maven.org/maven2/commons-collections/commons-collectio
ns/2.0/commons-collections-2.0.jar
88K downloaded
Downloading:
http://repo1.maven.org/maven2/org/codehaus/plexus/plexus-utils/1.1/
plexus-utils-1.1.jar
164K downloaded
Downloading:
http://repository.jboss.com/maven2//org/mortbay/jetty/servlet-api-2
.5/6.0.0beta12/servlet-api-2.5-6.0.0beta12.jar
Downloading: file://C:\Program
Files\Subversion\xyz/repository/org/mortbay/jetty
/servlet-api-2.5/6.0.0beta12/servlet-api-2.5-6.0.0beta12.jar
Downloading:
http://dist.codehaus.org/org.mortbay.jetty/jars/servlet-api-2.5-6.0
.0beta12.jar
Downloading:
http://repo1.maven.org/maven2/org/mortbay/jetty/servlet-api-2.5/6.0
.0beta12/servlet-api-2.5-6.0.0beta12.jar
157K downloaded
Downloading:
http://repository.jboss.com/maven2//org/apache/maven/doxia/doxia-co
re/1.0-alpha-8/doxia-core-1.0-alpha-8.jar
325K downloaded
[WARNING] *** CHECKSUM FAILED - Checksum failed on download: local =
'3baede12cc
6e9451c9f7633ffcc26b30b33652de'; remote =
'd3f4514ab8813a8cf879b947b477e4ed78dc6
275' - RETRYING
Downloading:
http://repository.jboss.com/maven2//org/apache/maven/doxia/doxia-co
re/1.0-alpha-8/doxia-core-1.0-alpha-8.jar
325K downloaded
[WARNING] *** CHECKSUM FAILED - Checksum failed on download: local =
'd576928c83
5f71469dfafb6978c3ae84dc1d80af'; remote =
'd3f4514ab8813a8cf879b947b477e4ed78dc6
275' - IGNORING
-----------------------------------------------------
this realm =
app0.child-container[org.apache.maven.plugins:maven-site-plugin]
urls[0] = file:/C:/Documents and
Settings/nishant_anshul/.m2/repository/org/apac
he/maven/plugins/maven-site-plugin/2.0-beta-5/maven-site-plugin-2.0-beta
-5.jar
urls[1] = file:/C:/Documents and
Settings/nishant_anshul/.m2/repository/org/code
haus/plexus/plexus-i18n/1.0-beta-6/plexus-i18n-1.0-beta-6.jar
urls[2] = file:/C:/Documents and
Settings/nishant_anshul/.m2/repository/org/mort
bay/jetty/jetty/6.0.0beta12/jetty-6.0.0beta12.jar
urls[3] = file:/C:/Documents and
Settings/nishant_anshul/.m2/repository/org/code
haus/plexus/plexus-velocity/1.1.3/plexus-velocity-1.1.3.jar
urls[4] = file:/C:/Documents and
Settings/nishant_anshul/.m2/repository/velocity
/velocity-dep/1.4/velocity-dep-1.4.jar
urls[5] = file:/C:/Documents and
Settings/nishant_anshul/.m2/repository/oro/oro/
2.0.7/oro-2.0.7.jar
urls[6] = file:/C:/Documents and
Settings/nishant_anshul/.m2/repository/org/code
haus/plexus/plexus-utils/1.1/plexus-utils-1.1.jar
urls[7] = file:/C:/Documents and
Settings/nishant_anshul/.m2/repository/org/apac
he/maven/doxia/doxia-site-renderer/1.0-alpha-8/doxia-site-renderer-1.0-a
lpha-8.j
ar
urls[8] = file:/C:/Documents and
Settings/nishant_anshul/.m2/repository/commons-
collections/commons-collections/2.0/commons-collections-2.0.jar
urls[9] = file:/C:/Documents and
Settings/nishant_anshul/.m2/repository/org/apac
he/maven/doxia/doxia-core/1.0-alpha-8/doxia-core-1.0-alpha-8.jar
urls[10] = file:/C:/Documents and
Settings/nishant_anshul/.m2/repository/org/apa
che/maven/doxia/doxia-decoration-model/1.0-alpha-8/doxia-decoration-mode
l-1.0-al
pha-8.jar
urls[11] = file:/C:/Documents and
Settings/nishant_anshul/.m2/repository/velocit
y/velocity/1.4/velocity-1.4.jar
urls[12] = file:/C:/Documents and
Settings/nishant_anshul/.m2/repository/org/mor
tbay/jetty/servlet-api-2.5/6.0.0beta12/servlet-api-2.5-6.0.0beta12.jar
Number of imports: 4
import: org.codehaus.classworlds.Entry@4891bb28
import: org.codehaus.classworlds.Entry@f8e44ca4
import: org.codehaus.classworlds.Entry@c51bc9e7
import: org.codehaus.classworlds.Entry@bece5185
this realm = plexus.core
urls[0] = file:/D:/maven-2.0.6/bin/../lib/maven-core-2.0.6-uber.jar
Number of imports: 4
import: org.codehaus.classworlds.Entry@4891bb28
import: org.codehaus.classworlds.Entry@f8e44ca4
import: org.codehaus.classworlds.Entry@c51bc9e7
import: org.codehaus.classworlds.Entry@bece5185
-----------------------------------------------------
[INFO]
------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO]
------------------------------------------------------------------------
[INFO] Internal error in the plugin manager executing goal
'org.apache.maven.plu
gins:maven-site-plugin:2.0-beta-5:attach-descriptor': Unable to find the
mojo 'o
rg.apache.maven.plugins:maven-site-plugin:2.0-beta-5:attach-descriptor'
in the p
lugin 'org.apache.maven.plugins:maven-site-plugin'
com.trend.iwss.jscan.appscan.runtime.PolicyProps: method <init>()V not
found
[INFO]
------------------------------------------------------------------------
[INFO] For more information, run Maven with the -e switch
[INFO]
------------------------------------------------------------------------
[INFO] Total time: 2 minutes 41 seconds
[INFO] Finished at: Thu Apr 12 13:43:30 GMT+05:30 2007
[INFO] Final Memory: 4M/8M
[INFO]
------------------------------------------------------------------------
......
.........
.........
************************************************************************
************
Nishant Anshul
Tech Architect, SETLabs, Infosys, Bangalore
Extn:31951, Direct:91-80-39131951
**************** CAUTION - Disclaimer *****************
This e-mail contains PRIVILEGED AND CONFIDENTIAL INFORMATION intended solely for the use of the addressee(s). If you are not the intended recipient, please notify the sender by e-mail and delete the original message. Further, you are not to copy, disclose, or distribute this e-mail or its contents to any other person and any such actions are unlawful. This e-mail may contain viruses. Infosys has taken every reasonable precaution to minimize this risk, but is not liable for any damage you may sustain as a result of any virus in this e-mail. You should carry out your own virus checks before opening the e-mail or attachment. Infosys reserves the right to monitor and review the content of all messages sent to or from this e-mail address. Messages sent to or from this e-mail address may be stored on the Infosys e-mail system.
***INFOSYS******** End of Disclaimer ********INFOSYS***
17 years, 7 months
build error on jbrms 3.1.0-M1
by Nishant Anshul
Hi,
I m trying to configure JBRMS and have checkedout all the stuff from
http://anonsvn.labs.jboss.com/labs/jbossrules/tags/3.1.0-M1/
Maven 2.0.6 is installed on my m/c.
When I run > maven install
It throws a build error...
Appreciate if someone can help.
************************************************************************
***
C:\Program Files\Subversion\xyz>mvn install
[INFO] Scanning for projects...
[INFO] Reactor build order:
[INFO] Drools
[INFO] Drools :: Rete-OO Core
[INFO] Drools :: Compiler
[INFO] Drools :: JSR-94 API Module
[INFO] Drools :: Decision Tables
[INFO]
------------------------------------------------------------------------
-
---
[INFO] Building Drools
[INFO] task-segment: [install]
[INFO]
------------------------------------------------------------------------
-
---
Downloading:
http://repo1.maven.org/maven2/org/apache/maven/plugins/maven-site-p
lugin/2.0-beta-5/maven-site-plugin-2.0-beta-5.pom
2K downloaded
Downloading:
http://repo1.maven.org/maven2/org/apache/maven/plugins/maven-plugin
s/1/maven-plugins-1.pom
3K downloaded
Downloading:
http://repo1.maven.org/maven2/org/apache/maven/maven-parent/1/maven
-parent-1.pom
6K downloaded
Downloading:
http://repo1.maven.org/maven2/org/apache/apache/1/apache-1.pom
3K downloaded
...........................
...........................
.............................
Downloading:
http://repository.jboss.com/maven2//org/apache/maven/doxia/doxia-de
coration-model/1.0-alpha-8/doxia-decoration-model-1.0-alpha-8.jar
115K downloaded
[WARNING] *** CHECKSUM FAILED - Checksum failed on download: local =
'54a6889ed8
0e1f300af58630a6e5d6a383cce830'; remote =
'831bbaf463d4594782d78415eb96980f638de
477' - RETRYING
Downloading:
http://repository.jboss.com/maven2//org/apache/maven/doxia/doxia-de
coration-model/1.0-alpha-8/doxia-decoration-model-1.0-alpha-8.jar
115K downloaded
[WARNING] *** CHECKSUM FAILED - Checksum failed on download: local =
'b52e3f094a
c3f24a22a190aaa8e2eb34f7e2459b'; remote =
'831bbaf463d4594782d78415eb96980f638de
477' - IGNORING
Downloading:
http://repo1.maven.org/maven2/org/apache/maven/doxia/doxia-site-ren
derer/1.0-alpha-8/doxia-site-renderer-1.0-alpha-8.jar
33K downloaded
Downloading:
http://repository.jboss.com/maven2//org/codehaus/plexus/plexus-i18n
/1.0-beta-6/plexus-i18n-1.0-beta-6.jar
90K downloaded
[WARNING] *** CHECKSUM FAILED - Checksum failed on download: local =
'10c8835260
d4db9c1c5f307885e49227b567c1e4'; remote =
'0de20e1eea680fc277fddb66bc24ba40d4491
68b' - RETRYING
Downloading:
http://repository.jboss.com/maven2//org/codehaus/plexus/plexus-i18n
/1.0-beta-6/plexus-i18n-1.0-beta-6.jar
90K downloaded
[WARNING] *** CHECKSUM FAILED - Checksum failed on download: local =
'a02dd72369
c6a3ec6c00ff2f238bd16891cab73c'; remote =
'0de20e1eea680fc277fddb66bc24ba40d4491
68b' - IGNORING
Downloading:
http://repo1.maven.org/maven2/org/mortbay/jetty/jetty/6.0.0beta12/j
etty-6.0.0beta12.jar
463K downloaded
Downloading:
http://repository.jboss.com/maven2//commons-collections/commons-col
lections/2.0/commons-collections-2.0.jar
Downloading: file://C:\Program
Files\Subversion\xyz/repository/commons-collectio
ns/commons-collections/2.0/commons-collections-2.0.jar
Downloading:
http://repo1.maven.org/maven2/commons-collections/commons-collectio
ns/2.0/commons-collections-2.0.jar
88K downloaded
Downloading:
http://repo1.maven.org/maven2/org/codehaus/plexus/plexus-utils/1.1/
plexus-utils-1.1.jar
164K downloaded
Downloading:
http://repository.jboss.com/maven2//org/mortbay/jetty/servlet-api-2
.5/6.0.0beta12/servlet-api-2.5-6.0.0beta12.jar
Downloading: file://C:\Program
Files\Subversion\xyz/repository/org/mortbay/jetty
/servlet-api-2.5/6.0.0beta12/servlet-api-2.5-6.0.0beta12.jar
Downloading:
http://dist.codehaus.org/org.mortbay.jetty/jars/servlet-api-2.5-6.0
.0beta12.jar
Downloading:
http://repo1.maven.org/maven2/org/mortbay/jetty/servlet-api-2.5/6.0
.0beta12/servlet-api-2.5-6.0.0beta12.jar
157K downloaded
Downloading:
http://repository.jboss.com/maven2//org/apache/maven/doxia/doxia-co
re/1.0-alpha-8/doxia-core-1.0-alpha-8.jar
325K downloaded
[WARNING] *** CHECKSUM FAILED - Checksum failed on download: local =
'3baede12cc
6e9451c9f7633ffcc26b30b33652de'; remote =
'd3f4514ab8813a8cf879b947b477e4ed78dc6
275' - RETRYING
Downloading:
http://repository.jboss.com/maven2//org/apache/maven/doxia/doxia-co
re/1.0-alpha-8/doxia-core-1.0-alpha-8.jar
325K downloaded
[WARNING] *** CHECKSUM FAILED - Checksum failed on download: local =
'd576928c83
5f71469dfafb6978c3ae84dc1d80af'; remote =
'd3f4514ab8813a8cf879b947b477e4ed78dc6
275' - IGNORING
-----------------------------------------------------
this realm =
app0.child-container[org.apache.maven.plugins:maven-site-plugin]
urls[0] = file:/C:/Documents and
Settings/nishant_anshul/.m2/repository/org/apac
he/maven/plugins/maven-site-plugin/2.0-beta-5/maven-site-plugin-2.0-beta
-5.jar
urls[1] = file:/C:/Documents and
Settings/nishant_anshul/.m2/repository/org/code
haus/plexus/plexus-i18n/1.0-beta-6/plexus-i18n-1.0-beta-6.jar
urls[2] = file:/C:/Documents and
Settings/nishant_anshul/.m2/repository/org/mort
bay/jetty/jetty/6.0.0beta12/jetty-6.0.0beta12.jar
urls[3] = file:/C:/Documents and
Settings/nishant_anshul/.m2/repository/org/code
haus/plexus/plexus-velocity/1.1.3/plexus-velocity-1.1.3.jar
urls[4] = file:/C:/Documents and
Settings/nishant_anshul/.m2/repository/velocity
/velocity-dep/1.4/velocity-dep-1.4.jar
urls[5] = file:/C:/Documents and
Settings/nishant_anshul/.m2/repository/oro/oro/
2.0.7/oro-2.0.7.jar
urls[6] = file:/C:/Documents and
Settings/nishant_anshul/.m2/repository/org/code
haus/plexus/plexus-utils/1.1/plexus-utils-1.1.jar
urls[7] = file:/C:/Documents and
Settings/nishant_anshul/.m2/repository/org/apac
he/maven/doxia/doxia-site-renderer/1.0-alpha-8/doxia-site-renderer-1.0-a
lpha-8.j
ar
urls[8] = file:/C:/Documents and
Settings/nishant_anshul/.m2/repository/commons-
collections/commons-collections/2.0/commons-collections-2.0.jar
urls[9] = file:/C:/Documents and
Settings/nishant_anshul/.m2/repository/org/apac
he/maven/doxia/doxia-core/1.0-alpha-8/doxia-core-1.0-alpha-8.jar
urls[10] = file:/C:/Documents and
Settings/nishant_anshul/.m2/repository/org/apa
che/maven/doxia/doxia-decoration-model/1.0-alpha-8/doxia-decoration-mode
l-1.0-al
pha-8.jar
urls[11] = file:/C:/Documents and
Settings/nishant_anshul/.m2/repository/velocit
y/velocity/1.4/velocity-1.4.jar
urls[12] = file:/C:/Documents and
Settings/nishant_anshul/.m2/repository/org/mor
tbay/jetty/servlet-api-2.5/6.0.0beta12/servlet-api-2.5-6.0.0beta12.jar
Number of imports: 4
import: org.codehaus.classworlds.Entry@4891bb28
import: org.codehaus.classworlds.Entry@f8e44ca4
import: org.codehaus.classworlds.Entry@c51bc9e7
import: org.codehaus.classworlds.Entry@bece5185
this realm = plexus.core
urls[0] = file:/D:/maven-2.0.6/bin/../lib/maven-core-2.0.6-uber.jar
Number of imports: 4
import: org.codehaus.classworlds.Entry@4891bb28
import: org.codehaus.classworlds.Entry@f8e44ca4
import: org.codehaus.classworlds.Entry@c51bc9e7
import: org.codehaus.classworlds.Entry@bece5185
-----------------------------------------------------
[INFO]
------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO]
------------------------------------------------------------------------
[INFO] Internal error in the plugin manager executing goal
'org.apache.maven.plu
gins:maven-site-plugin:2.0-beta-5:attach-descriptor': Unable to find the
mojo 'o
rg.apache.maven.plugins:maven-site-plugin:2.0-beta-5:attach-descriptor'
in the p
lugin 'org.apache.maven.plugins:maven-site-plugin'
com.trend.iwss.jscan.appscan.runtime.PolicyProps: method <init>()V not
found
[INFO]
------------------------------------------------------------------------
[INFO] For more information, run Maven with the -e switch
[INFO]
------------------------------------------------------------------------
[INFO] Total time: 2 minutes 41 seconds
[INFO] Finished at: Thu Apr 12 13:43:30 GMT+05:30 2007
[INFO] Final Memory: 4M/8M
[INFO]
------------------------------------------------------------------------
......
.........
.........
************************************************************************
************
Nishant Anshul
Tech Architect, SETLabs, Infosys, Bangalore
Extn:31951, Direct:91-80-39131951
**************** CAUTION - Disclaimer *****************
This e-mail contains PRIVILEGED AND CONFIDENTIAL INFORMATION intended solely for the use of the addressee(s). If you are not the intended recipient, please notify the sender by e-mail and delete the original message. Further, you are not to copy, disclose, or distribute this e-mail or its contents to any other person and any such actions are unlawful. This e-mail may contain viruses. Infosys has taken every reasonable precaution to minimize this risk, but is not liable for any damage you may sustain as a result of any virus in this e-mail. You should carry out your own virus checks before opening the e-mail or attachment. Infosys reserves the right to monitor and review the content of all messages sent to or from this e-mail address. Messages sent to or from this e-mail address may be stored on the Infosys e-mail system.
***INFOSYS******** End of Disclaimer ********INFOSYS***
17 years, 7 months
Re: [rules-users] Problems with int and Integer inside Return Value and Predicate Expression
by Felipe Piccolini
I tested this changing all attributes to Long and happens the same
error:
s: Solicitud( sumaLCG: sumaMontoLCG < max, sumaGTIA:
sumaMontoGarantia >= ( new Long( sumaLCG.intValue() - min.intValue
() )) )
public class Solicitud implements Serializable {
private Long sumaMontoLCG; // suma de los montos contenidos en
cada LineaCredito contenida en la lista LCG
private int resolucion; // se guarda el RES_PUEDE_APROVAR o el
RES_DEBE_RECOMENDAR
private boolean aprovada; //si esta finalmente aprovada o no.
private Long sumaMontoGarantia;//suma de montos de garantias de
todos los productos del LCG
public Solicitud(){
this.LCG = new ArrayList<LineaCredito>();
this.sumaMontoLCG = new Long(0);
this.resolucion = Solicitud.RES_SIN_RESOLUCION;
this.aprovada = false;
this.sumaMontoGarantia = new Long(0);
}
public Long getSumaMontoLCG() {
recalculaSumaMontoLCG();
return sumaMontoLCG;
}
public void setSumaMontoLCG(int sumaMontoLCG) {
this.sumaMontoLCG = new Long(sumaMontoLCG);
}
public void setSumaMontoLCG(long sumaMontoLCG) {
this.sumaMontoLCG = new Long(sumaMontoLCG);
}
public void setSumaMontoLCG(Long sumaMontoLCG) {
this.sumaMontoLCG =sumaMontoLCG;
}
....
org.drools.RuntimeDroolsException:
java.lang.ArrayIndexOutOfBoundsException: 1
at org.drools.rule.ReturnValueConstraint.isAllowed(Unknown Source)
at org.drools.common.BetaNodeBinder.isAllowed(Unknown Source)
at org.drools.reteoo.TupleSource.attemptJoin(Unknown Source)
at org.drools.reteoo.JoinNode.assertTuple(Unknown Source)
at org.drools.reteoo.LeftInputAdapterNode.createAndAssertTuple
(Unknown Source)
at org.drools.reteoo.LeftInputAdapterNode.assertObject(Unknown Source)
at org.drools.reteoo.ObjectSource.propagateAssertObject(Unknown Source)
at org.drools.reteoo.AlphaNode.assertObject(Unknown Source)
at org.drools.reteoo.ObjectSource.propagateAssertObject(Unknown Source)
at org.drools.reteoo.ObjectTypeNode.assertObject(Unknown Source)
at org.drools.reteoo.Rete.assertObject(Unknown Source)
at org.drools.reteoo.ReteooRuleBase.assertObject(Unknown Source)
at org.drools.reteoo.ReteooWorkingMemory.doAssertObject(Unknown Source)
at org.drools.common.AbstractWorkingMemory.assertObject(Unknown Source)
at org.drools.common.AbstractWorkingMemory.assertObject(Unknown Source)
at
cl.bluesoft.jbrules.loader.solcred.SolcredRulesPoC.fireRulesSOLCRED
(SolcredRulesPoC.java:83)
at cl.bluesoft.jbrules.loader.solcred.SolcredRulesPoC.main
(SolcredRulesPoC.java:38)
Caused by: java.lang.ArrayIndexOutOfBoundsException: 1
at org.drools.reteoo.FactHandleList.get(Unknown Source)
at org.drools.reteoo.TupleKey.get(Unknown Source)
at org.drools.reteoo.ReteTuple.get(Unknown Source)
at org.drools.reteoo.ReteTuple.get(Unknown Source)
at
cl.bluesoft.jbrules.rules.solcred.Rule_montos_maximos_y_minimos_0ReturnV
alue0Invoker.evaluate
(Rule_montos_maximos_y_minimos_0ReturnValue0Invoker.java:12)
... 17 more
On 11-04-2007, at 11:59, Felipe Piccolini wrote:
> The Solicitud object has sumaMontoLCG and sumaMontoGarantia atts as
> int (primitives).
>
> Im using 3.0.6 and java 1.5
>
> I have this simple rule:
>
> rule "montos maximos y minimos"
> salience 888
> when
> a: Actor(tipo :tipoActor == Actor.JefeOficina, max: limiteMaximo,
> min: limiteMinimo)
> s: Solicitud( sumaLCG: sumaMontoLCG < max, sumaGTIA:
> sumaMontoGarantia -> ( (sumaLCG.intValue() - sumaGTIA.intValue()) <
> min.intValue()) )
> then
> System.out.println("Suma LCG:"+sumaLCG);
> System.out.println("Actor lim max:"+max);
> System.out.println("Actor tipo:"+tipo);
> end
>
> Fire the rule shows me this error:
> org.drools.RuntimeDroolsException:
> java.lang.ArrayIndexOutOfBoundsException: 1
> at org.drools.rule.PredicateConstraint.isAllowed(Unknown Source)
> at org.drools.common.BetaNodeBinder.isAllowed(Unknown Source)
> at org.drools.reteoo.TupleSource.attemptJoin(Unknown Source)
> at org.drools.reteoo.JoinNode.assertTuple(Unknown Source)
> at org.drools.reteoo.LeftInputAdapterNode.createAndAssertTuple
> (Unknown Source)
> at org.drools.reteoo.LeftInputAdapterNode.assertObject(Unknown
> Source)
> at org.drools.reteoo.ObjectSource.propagateAssertObject(Unknown
> Source)
> at org.drools.reteoo.AlphaNode.assertObject(Unknown Source)
> at org.drools.reteoo.ObjectSource.propagateAssertObject(Unknown
> Source)
> at org.drools.reteoo.ObjectTypeNode.assertObject(Unknown Source)
> at org.drools.reteoo.Rete.assertObject(Unknown Source)
> at org.drools.reteoo.ReteooRuleBase.assertObject(Unknown Source)
> at org.drools.reteoo.ReteooWorkingMemory.doAssertObject(Unknown
> Source)
> at org.drools.common.AbstractWorkingMemory.assertObject(Unknown
> Source)
> at org.drools.common.AbstractWorkingMemory.assertObject(Unknown
> Source)
> at
> cl.bluesoft.jbrules.loader.solcred.SolcredRulesPoC.fireRulesSOLCRED
> (SolcredRulesPoC.java:85)
> at cl.bluesoft.jbrules.loader.solcred.SolcredRulesPoC.main
> (SolcredRulesPoC.java:40)
> Caused by: java.lang.ArrayIndexOutOfBoundsException: 1
> at org.drools.reteoo.FactHandleList.get(Unknown Source)
> at org.drools.reteoo.TupleKey.get(Unknown Source)
> at org.drools.reteoo.ReteTuple.get(Unknown Source)
> at org.drools.reteoo.ReteTuple.get(Unknown Source)
> at
> cl.bluesoft.jbrules.rules.solcred.Rule_montos_maximos_y_minimos_0Predi
> cate0Invoker.evaluate
> (Rule_montos_maximos_y_minimos_0Predicate0Invoker.java:14)
> ... 17 more
>
>
> When I change the column to:
> s: Solicitud( sumaLCG: sumaMontoLCG < max, sumaGTIA:
> sumaMontoGarantia -> ( (sumaLCG - sumaGTIA) < min) )
>
> its shows this error:
> org.drools.rule.InvalidRulePackage: Rule Compilation error The
> operator - is undefined for the argument type(s) java.lang.Integer,
> java.lang.Integer
>
> at org.drools.rule.Package.checkValidity(Unknown Source)
> at org.drools.common.AbstractRuleBase.addPackage(Unknown Source)
> at cl.bluesoft.jbrules.loader.solcred.SolcredRulesPoC.readRule
> (SolcredRulesPoC.java:60)
> at cl.bluesoft.jbrules.loader.solcred.SolcredRulesPoC.main
> (SolcredRulesPoC.java:36)
>
> This happens in a predicate or in a value expression, so I cant use
> this formula... What is wrong?
>
> Thx.
>
>
>
> Felipe Piccolini M.
> felipe.piccolini(a)bluesoft.cl
>
>
>
>
> _______________________________________________
> rules-users mailing list
> rules-users(a)lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
Atentamente,
______________________
Felipe Piccolini Marfull
Jefe de Proyectos
Agustina 1141 Piso 8-B
Santiago
Fono +(56 2) 68830837
E-mail felipe.piccolini(a)bluesoft.cl

17 years, 7 months
two great bugs
by Mark Proctor
Found two great bugs this weekend:
http://jira.jboss.com/jira/browse/JBRULES-778 (fixed)
when
$p : Person( $cheese : cheese )
then
modify( $cheese )
end
The above would actually use the $p fact handle for the modify, causing
the handle to reference $cheese instead of $p. This is now fixed, field
bindings now have their fact hand cleared, so on modify when the fact
handle is null it retrieves it from the working memory.
http://jira.jboss.com/jira/browse/JBRULES-780 (in the process of fixing)
no-loop is currently trapped with:
// if the current Rule is no-loop and the origin rule is the
same then return
if ( this.rule.getNoLoop() && this.rule.equals(
context.getRuleOrigin() ) ) {
return;
}
That means we have a tuple that reached the terminal node, but is not
added to the memory or an activation created and attached. Thus on a
modify or a retract the Tuple reaches the RuleTerminalNode and causes a
NullPointer.
17 years, 7 months