activationCancelled() not being executed?
by Fermion
Hi!
I'm using a JTable to display rules that have been activated.
My goal is to have the table display a set of activations ordered by their
salience. The user should then choose which one of them to fire (if you want
to know why, be invited to read the background).
Of course this makes only sense as long as the activations are valid. Rules
whose activation has been cancelled should still be displayed, but in a
different style (like greyed out).
In order to accomplish this, I want to use an implementation of the
AgendaEventListener-interface, implementing the
activationCancelled()-method.
The Listener itself works, as I use the activationCreated()-method to add
the rule as a row to my table (which works fine).
Unfortunately the activationCancelled()-method doesn't seem to be executed
at all!
I assume that I have a fundamental misunderstanding of what should trigger
an activationCancelled() event?
Background: (just if you're curious...)
I'm working as a PhD student in physics at the CERN international
high-energy physics laboratory, for the ATLAS experiment.
As a member of the Detector Control System (DCS) group, I'm going to write
an expert system in order to assist the shift crew with the detector
operation.
The operation of the detector is a difficult task, because more than 70000
parameters (like voltages, currents and temperatures) have to be controlled.
A Finite State Machine (FSM) computes a defined and limited number of states
from the given parameters (like ON, OFF, STANDBY,...).
I'm going to synchronize the expert system application to ERROR states of
the FSM, in order to extract the relevant parameters from the system (as it
would be impossible to feed all parameters into the XPS all the time).
This is handled by quite some control rules that decide which data has to be
requested, released and so on.
Once all necessary data has been received, this might lead to activations of
the (more interesting) user rules.
Those rules have an explanatory character like "The temperature of this XYZ
is too high, so please try ABC."
For a given set of facts I assume more then one rule to be activated. Whilst
the rule engine should take care of the execution (firing) of all control
related rules, the execution of the user rules should be under direct user
control.
Displaying all activations in a GUI will allow the user to pick one (try it)
and rate it (the proposed solution solved the problem "yes/no"). Changing
the rules salience according to the answer, will allow the system to
dynamically reflect the current system status. (Rules that are related to
broken connections / wrongly connected cables are likely to be found at the
beginning of the experiment but hopefully only on rare occasion later on.)
In order to ensure that no information is lost during the absence of DCS
experts (which will not always be around), a log file should be written for
each major FSM-ERROR. At the moment the WorkingMemoryFileLogger seems to be
predestined for this job. This way I hope to collect large amounts of ERROR
data during the initial phase of the experiment that helps to extract rules
for numerous error conditions.
This will become especially handy, as such errors have a tendency to come
back, even if the original detector experts are gone for years...
--
View this message in context: http://www.nabble.com/activationCancelled%28%29-not-being-executed--tf434...
Sent from the drools - user mailing list archive at Nabble.com.
16 years, 2 months
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, 5 months
Re:JUnit testing
by J. Michael Dean
>
Thanks. Sorry for few details as this has been a several message
question. I have created a Drools plugin that contains EITHER the
maximum number of jars and dependencies (i.e. ALL), or the minimum
(i.e. those needed for compiler option only processing DRL files), or
adding the entire Drools distribution to my Java extensions folder in
OS X, and in all instances, I get an error loading dialects. The
enigma for me is that all of these plugin options enable me to make a
stand alone RCP application that works fine.
Here is the test unit code:
@BeforeClass
public static void setUp() throws Exception {
Reader source;
PackageBuilderConfiguration pkgConfig = new
PackageBuilderConfiguration();
JavaDialectConfiguration javaDialectConf =
(JavaDialectConfiguration) pkgConfig.getDialectConfiguration("java");
javaDialectConf.setCompiler(JavaDialectConfiguration.ECLIPSE);
final PackageBuilder builder = new PackageBuilder(pkgConfig);
boolean exists = (new File("rules/GlucoseDroolRules00.drl")).exists();
if (exists) {
builder.addPackageFromDrl(new FileReader(
"rules/GlucoseDroolRules00.drl"));
System.out.println("Found the file!");
} 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);
}
It crashes in the line trying to instantiate the package
configuration. If I eliminate the lines that configure the package,
and invoke the package building without an argument (the default),
then the crash occurs in that line. The crash trace:
org.drools.RuntimeDroolsException: Unable to load dialect
'org.drools.rule.builder.dialect.java.JavaDialectConfiguration:java'
at
org
.drools
.compiler
.PackageBuilderConfiguration
.addDialect(PackageBuilderConfiguration.java:152)
at
org
.drools
.compiler
.PackageBuilderConfiguration
.buildDialectConfigurationMap(PackageBuilderConfiguration.java:140)
at
org
.drools
.compiler
.PackageBuilderConfiguration.init(PackageBuilderConfiguration.java:117)
at
org
.drools
.compiler
.PackageBuilderConfiguration.<init>(PackageBuilderConfiguration.java:94)
at
droolsRules.tests.AllDroolsRulesTests.setUp(AllDroolsRulesTests.java:40)
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)
Caused by: java.lang.NullPointerException
at
org
.drools
.compiler
.PackageBuilderConfiguration
.addDialect(PackageBuilderConfiguration.java:146)
... 18 more
This trace is identical in all instances. I have looked at the source
code and it appears that the Drools code is looking for the drools
configuration file, and I am not sure if this is included in the
classpath when running JUnit. However, the minimal and maximal plugin
configurations make an RCP run perfectly as a standalone application.
This is Eclipse 3.3 fall version, Mac OXX Leopard (but have run on
Tiger and same error, so not a new Apple bug), Drools 4.03, and JUnit 4.
Thanks.
> ------------------------------
>
> Message: 8
> Date: Tue, 4 Dec 2007 06:50:15 -0800 (PST)
> From: "John J. Franey" <jjfraney(a)gmail.com>
> Subject: Re: [rules-users] JUnit testing
> To: rules-users(a)lists.jboss.org
> Message-ID: <14151759.post(a)talk.nabble.com>
> Content-Type: text/plain; charset=us-ascii
>
>
>
>
> J Michael Dean wrote:
>>
>> I am having problems figuring out how to do JUnit 4 unit tests with
>> Drools and am wondering what I am missing.
>>
>
> I'm successfully using junit4 to test rules. I build a rules
> package from
> my rules file, create a stateful session, insert facts, fire all
> rules, run
> queries, and finally, perform junit asserts on the results.
>
> I can't tell you what you are missing, unless you say what you have.
>
> Regards,
> John
>
>
> --
> View this message in context: http://www.nabble.com/JUnit-testing-tf4930259.html#a14151759
> Sent from the drools - user mailing list archive at Nabble.com.
>
>
>
> ------------------------------
>
> _______________________________________________
> rules-users mailing list
> rules-users(a)lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
>
> End of rules-users Digest, Vol 13, Issue 6
> ******************************************
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, 8 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, 8 months
can't install via eclipse update manager
by howard goldberg
eclipse 3.3.1.1 or 3.3.0
Attempt to install 4.04
Got a "feature not found" error using eclipse update manager for both remote
site and archive file. Didn't see any reports in the archives or JIRA. No
problem with manual install.
Thanks,
Howard
16 years, 8 months
Serializing WorkingMemory Problem.
by Pedro Costa
Hi All,
When serializing a working memory I get the following error:
Caused by: java.io.NotSerializableException:
org.drools.util.AbstractHashTable$SingleIndex
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java
:1081)
at java.io.ObjectOutputStream.defaultWriteFields(
ObjectOutputStream.java:1375)
at java.io.ObjectOutputStream.writeSerialData(
ObjectOutputStream.java:1347)
at java.io.ObjectOutputStream.writeOrdinaryObject(
ObjectOutputStream.java:1290)
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java
:1079)
at java.io.ObjectOutputStream.writeArray(ObjectOutputStream.java
:1251)
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java
:1075)
at java.io.ObjectOutputStream.defaultWriteFields(
ObjectOutputStream.java:1375)
at java.io.ObjectOutputStream.writeSerialData(
ObjectOutputStream.java:1347)
............
I checked the docs and org.drools.util.AbstractHashTable$SingleIndex is not
serializable ...
Any ideas how I can workarround this one??
Thanks!
Pedro.
16 years, 9 months
Drools Compile Error
by Narendra Valada
Hi,
I have a rule that looks like this :
package com.sample
rule "Inner Class Test"
when
com.sample.OuterClass.InnerClass.InnerInnerClass( )
then
System.out.println( "" );
end
The inner class referenced by this rule is defined like this:
package com.sample;
public class OuterClass {
public class InnerClass {
public class InnerInnerClass { }
}
}
I am getting an error "Unable to resolve ObjectType '
com.sample.OuterClass.InnerClass.InnerInnerClass'".
What am I doing wrong? I am using XMLBeans-generated POJOs in my application
and these POJOS contain a lot of deeply nested inner classes and these are
giving me compile-errors in Drools.
Thanks,
Narendra
16 years, 9 months
Re: [rules-users] Dynamically create rules in java
by Edson Tirelli
Brian,
Look for the XXXDescr classes (e.g. RuleDescr, PatternDescr, etc) in
drools-compiler. If you populate this classes directly, you avoid the steps
of generating the DRL string and parsing them back into the descriptor
classes.
The best you can do to get one example is create a simple program with
the rule template you want, use the parser to parse it and inspect the
result to know what is expected.
[]s
Edson
2008/2/27 Brian Trezise <Brian.Trezise(a)intellidata.net>:
> Is there a way to dynamically create rules in java?
>
> Specifically, for a rule in the following general form I have a .txt list
> of
> strings I want to match against and take actions upon. I know I can make
> a
> .drl out of this list without too much trouble; however the ideal case
> would
> be to simply genearate and load the rules directly into the rulebase. Is
> this possible? And if so, can you give me a simple example?
>
>
> rule "name"
> no-loop true
> salience 0
> when
> sd : SmartDescription(description matches "string",
> possibleFamilyKeySet contains "some value",
> description : description);
>
> then
> *perform java actions*
> end
>
> Any assistance would be appreciated
> Thanks,
>
> ___________________________________________________
> Brian Trezise
> Staff Software Engineer
> IntelliData, Inc
> 3173 s. uravan way
> aurora, colorado 80013
> T: 720.524.4864
> brian.trezise(a)intellidata.net
>
> _______________________________________________
> rules-users mailing list
> rules-users(a)lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
--
Edson Tirelli
JBoss Drools Core Development
Office: +55 11 3529-6000
Mobile: +55 11 9287-5646
JBoss, a division of Red Hat @ www.jboss.com
16 years, 9 months
BRMS and Seam Configuration
by Robert Morse
Hello,
My apologies if this is not the correct forum, but does someone have
an example of using BRMS with Seam?
The example in the Seam docs appears to be missing information (namely
the linkage between the <drools: rule-agent> and <drools:managed-
working-memory>
Thanks.
16 years, 9 months