RE: Rules with Lookup Tables...
by Rahul Phadnis
Have you looked at
http://labs.jboss.com/portal/jbossrules/subversion.html
I think that page is not uptodate since at the bottom
it says "Trunk is unstable and may often not build. If
you wish to build form Subversion source the latest
tag is:
http://anonsvn.labs.jboss.com/labs/jbossrules/tags/3.0.3-GA/
"
Are n't we at 3.0.5 already?
-Rahul
--- jjdepaul(a)us.ibm.com wrote:
> Rahul -
>
> Where can I find Maven2 repository that has the
> nightly builds for Drools project?! I've looked
> around on a couple of well-known ones abut no luck
> finding anything above D3.0.5
>
> thanks,
> james
> >
> > The "from" CE (conditional expression) is not
> > available in the current released jboss rules
> version
> > (3.0.5) and you probably have to use the nightly
> build
> > to use it.
> >
> > -Rahul
> >
> >
>
>
16 years, 6 months
Accessing maps (hashmaps) keys and values in rules
by Ryan, Dennis (Dennis)
We are using Maps (HashMaps) in our rules and the only way we have found
to access keys and values in the Map in the "when" clauses is thru use
on eval() which I know is a big no-no by rules purists. Is there a
better way, maybe some shorthand I'm not familiar with to deal with Maps
in the when clause?
Thanks,
Dennis
16 years, 9 months
How do you use Ruleflows with StatelessSession's?
by Shahad Ahmed
Does anyone know if it's possible to use a ruleflow with a StatelessSession?
The current documentation and API seem to show examples with
StatefullSessions i.e.:
statefullSession.startProcess(id);
statefullSession.fireAllRules();
etc...
However, there doesn't seem to be anything equivalent in the API for
StatelessSesssion's. I'd really like to be able to use the new sequential
mode (i.e. with a StatelessSession) and ruleflow.
Regards,
Shahad
16 years, 9 months
BRMS
by Markus Helbig
Hi,
i tryed to deploy the BRMS on a WebSphere Server, but i get
incompatibility errors. It seems BRMS can not be used with JRE 1.4.x,
right? Why? JRE 1.4.x is still very common and often used in
enterprises ...
Cheers
Markus
Stacktrace is:
Could not be defined due to: (org/jboss/seam/servlet/SeamListener) bad
major version at offset=6
This is often caused by having a class defined at multiple
locations within the classloader hierarchy. Other potential causes
include compiling against an older or newer version of the class
that has an incompatible method signature.
Dumping the current context classloader hierarchy:
==> indicates defining classloader
16 years, 10 months
How to write constraint about a Map inside a Map?
by Felipe Piccolini
Suppouse I have a Map attribute and one of the values is another
Map...how can I check a member of the inner Map?
class MyFact{
Map map;
public MyFact(){
this.map = new HashMap();
}
....setter and getter...
}
-- test --
MyFact myFact = new MyFact();
Map innerMap = new HashMap();
innerMap.put("innerKey", new String("InnerValue"));
Map map = new HashMap();
map.put("mapKey", innerMap);
myFact.setMap(map);
.... set the RuleBase and insert myFact as a fact for the
WorkingMemory...
-------
Now... how should I write the rule to check the innerKey ??
rule "test InnerMap"
when
$mf: MyFact( map['mapKey']['innerKey'] ==
"InnerValue" ) // doesnt work...
....
$mf: MyFact( map['mapKey'].this['innerKey'] ==
"InnerValue" ) // doesnt work...
$mf: MyFact( map['mapKey'].['innerKey'] == "InnerValue" ) //
doesnt work...
$mf: MyFact( $innerMap: map['mapKey'], $innerMap['innerKey'] ==
"InnerValue" ) // doesnt work...
$mf: MyFact( $innerMap: map['mapKey'] -> ($innerMap
['innerKey'] == "InnerValue" )) // doesnt work...
Thanks.
Felipe Piccolini M.
felipe.piccolini(a)bluesoft.cl
16 years, 11 months
Using JBoss Rules in cases where users need to add / remove rules
by Robert Burdick
Hello All:
I am trying to figure out if JBoss Rules will be suitable for my
application
needs. Maybe you can give some insight.
My application needs to implement / use a rules engine for evaluating
conditions and firing off events when those conditions are met. So far
this
sounds exactly like the sort of thing that JBoss Rules is for. The
twist is
that my application will also provide an administrative utility that
allows
admins to add or remove rules, as well as modify the conditions that
trigger
these rules. Can JBoss Rules be used to do this? All of the examples
I've
seen so far seem to incorporate rules whose consequences are fixes, but
with
changeable conditions. For example, there are lots of samples out there
like an insurance application. Such an example has consequences such as
offerQuote, turnDownCustomer etc. that don't change, but with conditions
that do change. For example, today offer quotes to all good drivers,
tomorrow change the rule to offer quotes to all good drivers over the
age of
18. The conditions change, but the basic actions in the system are
common.
What I think my requirement implies is a way to define rules with
conditions
and the corresponding consequences code at runtime. This seems to imply
that the application code needs to be dynamic, in order to allow users
to
define arbitrary consequence code. Has anyone ever tried to do
something
this generic with JBoss Rules, and better, can you fill me in on how to
go
about this?
Thanks, Robert
17 years
Get compiled Java Code of Rules
by Markus Helbig
Hi,
is there any possibility to get the compiled java code of the rules
... could be helpful for several reasons ...
Cheers
Markus
17 years
Invalid signature file
by J Michael Dean
I have created a plugin to contain the core Drools jars and
dependencies, and this plugin is then used by my RCP. This works, a
couple rules fire correctly, etc. Now I want to set up a testing
framework (JUnit4) and have the following code, which causes an
Invalid signature file error. My core plugin was created in Eclipse
simply by wrapping the Drools jars and dependencies, and as I said,
the RCP itself works. Any assistance is greatly appreciated.
- Mike
@BeforeClass
public static void setUp() throws Exception {
Reader source;
final PackageBuilder builder = new PackageBuilder();
boolean exists = (new File("rules/GlucoseDroolRules00.drl")).exists();
if (exists) {
builder.addPackageFromDrl(new FileReader(
"rules/GlucoseDroolRules00.drl"));
} else {
System.out.println("Cannot locate the file - will try as resource");
source = new InputStreamReader(AllDroolsRulesTests.class
.getResourceAsStream("rules/GlucoseDroolRules00.drl"));
builder.addPackageFromDrl(source);
}
if (builder.hasErrors()) {
System.out.println(builder.getErrors().toString());
}
Package pkg = builder.getPackage();
ruleBase = RuleBaseFactory.newRuleBase();
ruleBase.addPackage(pkg);
}
The code dies in the line instantiating the PackageBuilder builder:
java.lang.SecurityException: Invalid signature file digest for
Manifest main attributes
at
sun
.security
.util.SignatureFileVerifier.processImpl(SignatureFileVerifier.java:221)
at
sun
.security
.util.SignatureFileVerifier.process(SignatureFileVerifier.java:176)
at java.util.jar.JarVerifier.processEntry(JarVerifier.java:233)
at java.util.jar.JarVerifier.update(JarVerifier.java:188)
at java.util.jar.JarFile.initializeVerifier(JarFile.java:325)
at java.util.jar.JarFile.getInputStream(JarFile.java:390)
at
sun
.net
.www
.protocol.jar.JarURLConnection.getInputStream(JarURLConnection.java:136)
at java.net.URL.openStream(URL.java:1007)
at
org
.drools.util.ChainedProperties.loadProperties(ChainedProperties.java:
245)
at
org
.drools.util.ChainedProperties.loadProperties(ChainedProperties.java:
216)
at org.drools.util.ChainedProperties.<init>(ChainedProperties.java:123)
at org.drools.util.ChainedProperties.<init>(ChainedProperties.java:31)
at
org
.drools
.compiler
.PackageBuilderConfiguration.init(PackageBuilderConfiguration.java:108)
at
org
.drools
.compiler
.PackageBuilderConfiguration.<init>(PackageBuilderConfiguration.java:94)
at org.drools.compiler.PackageBuilder.<init>(PackageBuilder.java:124)
at org.drools.compiler.PackageBuilder.<init>(PackageBuilder.java:86)
at
droolsRules.tests.AllDroolsRulesTests.setUp(AllDroolsRulesTests.java:37)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun
.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:
39)
at
sun
.reflect
.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:
25)
at java.lang.reflect.Method.invoke(Method.java:585)
at
org
.junit
.internal
.runners.BeforeAndAfterRunner.invokeMethod(BeforeAndAfterRunner.java:74)
at
org
.junit
.internal
.runners.BeforeAndAfterRunner.runBefores(BeforeAndAfterRunner.java:50)
at
org
.junit
.internal
.runners.BeforeAndAfterRunner.runProtected(BeforeAndAfterRunner.java:33)
at
org.junit.internal.runners.TestClassRunner.run(TestClassRunner.java:52)
at
org
.eclipse
.jdt
.internal
.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:38)
at
org
.eclipse
.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at
org
.eclipse
.jdt
.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:
460)
at
org
.eclipse
.jdt
.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:
673)
at
org
.eclipse
.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:
386)
at
org
.eclipse
.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:
196)
17 years
Drools and BRMS (60,000+ rules)
by Carlsen, Len
Hello,
I am wondering if anyone has any experience in managing very large rule
sets and facts and could share their experiences in the design and
management of this.
We are embarking on a new Student Information System project here at UBC
in conjunction with several other American universities. We have pretty
much decided to use Drools as our rules engine and maybe also the Drools
BRMS for our business rules management. Our first application is the
course curriculum application/module where we will manage course
co-requisites, pre-requisites, etc. and we estimate that we will have
about 20,000 course rules. We currently have about 15,000 course rules
(QuickRules) in production now. We will also have security rules,
input/form validation rules, student awards rules, degree rules,
enrolment rules, admission rules, student financial rules etc. which
will total about 40,000 rules. So currently we are looking at managing
about 60,000 rules (not including versioning). If we include versioning
then there would probably be more than 100,000 rules.
Example:
A single course could have 10 or more rules per course version. We
currently have about 2000 course and most courses have more than 1
version.
We are looking into developing our own rules management system to define
dependencies between rules, courses (facts) and course + rule versions.
E.g. Course CHEM101 version 1 links to CHEM101 a single rule or a rule
set/package version 1 by a rule id.
We need the ability to notify users when rules are modified which
impacts other rules and what impact changing a rule can cause for
example a degree program. E.g. changing a course's pre-requisite may
affect other courses' pre-requisites; rules about rules. We also need
the ability to find out why a student was not able to register for a
course etc. We will also need to show the course dependency graph
visually (the RDBMS can probably help us here). Later, we are hoping to
use the Drools Solver for course and exam scheduling and also to use it
for student degree planning and student awards.
We will need to translate the rules into English language syntax for
publication in the course calendar and later into other languages (first
French) since the SIS application will be used internationally. Listing
requirements could just be shown in bulleted form. Probably can't use
the DSL in this case since we would need to support several languages or
maybe I am wrong here?
If we use the Drools BRMS to store all of our rules on a relational
database, will we be able to write SQL queries to get at specific
rules/packages to link facts (courses) to rules? Or do we have to go
through the BRMS to get at the rules. Does BRMS have a facility to
validate rules against facts so you can see if your rules execute
correctly against your data/facts before committing your rules. Or maybe
we need a testing framework for this.
Other issues are the performance of the Drools Solver and having
thousands of rules compiled, loaded and running. During registration we
could have thousands of rules executing concurrently. The rules engine
and the BRMS would be services as part of an SOA infrastructure (and an
OSGi service environment). Anyone got any experience with Drools in an
OSGi environment with respect to class loading issues when compiling
rules and facts from other bundles since rules and facts may be in
different bundles? Bundle buddy class loading?
Later, we will need translators to/from other rule engines; maybe ruleML
and JCR can help us here.
So far, I think Drools can do most of this; am I correct here? Does any
of this sound plausible?
Thanks very much for any tips, thoughts or comments.
Len
Len Carlsen
Enrolment Services - Student Systems
University of British Columbia
17 years
Re: Choosing JackRabbit 1.3 JNDI PersistenceManager
by mmquelo massi
I think I worked it out.
It's just a matter of making the jndi name global.
It seems that JBoss does not allow me to use the mysql
repository name as a local "java:" name.
I made it global and everything went smoothly!
Now I am just wondering whether there is a chance
to make it local in someway....
Is it possible? Is it a JBoss 4.2.2 BUG?
I post the old .xml files again:
(In the current version I just disabled the local namespace setting:
<use-java-context>false</use-java-context>)
<datasources>
<local-tx-datasource>
<jndi-name>jdbc/MySQLDB</jndi-name>
<connection-url>jdbc:mysql:///brms-db</connection-url>
<driver-class>com.mysql.jdbc.Driver </driver-class>
<user-name>drools</user-name>
<password>drools</password>
<min-pool-size>5</min-pool-size>
<max-pool-size>20</max-pool-size>
<idle-timeout-minutes>5</idle-timeout-minutes>
<exception-sorter-class-name>
com.mysql.jdbc.integration.jboss.ExtendedMysqlExceptionSorter
</exception-sorter-class-name>
<valid-connection-checker-class-name>
com.mysql.jdbc.integration.jboss.MysqlValidConnectionChecker
</valid-connection-checker-class-name>
</local-tx-datasource>
</datasources>
I've got the following persistence manager set-up in
<jboss_home>\bin\repository.xml:
<PersistenceManager class="
org.apache.jackrabbit.core.persistence.db.JNDIDatabasePersistenceManager">
<param name="dataSourceLocation" value="java:jdbc/MySQLDB"/>
<param name="schema" value="mysql"/>
<param name="schemaObjectPrefix" value="${*wsp.name* <http://wsp.name/>
}_"/>
<param name="externalBLOBs" value="false" />
</PersistenceManager>
Hope u can help with this.....
Massi
17 years