Agenda.getScheduledActivations() method is throwing NullPointerException
by ganesh.p
Hi All,
I have a init rule in which i am accessing Agenda.getScheduledActivations()
method. But it throws NullPointerException. I have tried with both
drools-core 4.0.4 and drools-core 4.0.7 jar files.
Here are the rules:
package com.demo.rules;
import java.util.Date;
import org.drools.Agenda;
import org.drools.spi.Activation;
import com.demo.metric.TxInfo;
import com.demo.rules.RuleDemo;
function void removeActivationsForRule(String ruleName, Agenda agenda) {
Activation[] actArr;
Activation act;
int len;
try {
actArr = agenda.getScheduledActivations();
len = actArr.length;
System.out.println("*** Scheduled Activation[] Length : " + len);
for(int i=0;i<len;++i) {
act = actArr[i];
if(act.getRule().getName().equals(ruleName)) {
System.out.println("*** ACTIVATION : " + act + " IS REMOVED ***");
act.remove();
}
}
} catch (NullPointerException ex) {
System.out.println("##############");
ex.printStackTrace();
System.out.println("##############");
}
}
rule 'init_rule1'
salience 10
when TxInfo(totalTime <= 100)
then
removeActivationsForRule("rule1", drools.getWorkingMemory().getAgenda());
end
rule 'rule1'
duration 60000
when TxInfo(totalTime > 100)
then
System.out.println("**** FIRING RULE : rule1 : -" + new Date() + "- ****");
end
Here is the stack trace:
##############
java.lang.NullPointerException
at
org.drools.common.DefaultAgenda.getScheduledActivations(DefaultAgenda.java:351)
at com.demo.rules.RuleDemo.removeScheduledActivations(RuleDemo.java:132)
at com.demo.rules.RuleDemo.beforeActivationFired(RuleDemo.java:175)
at
org.drools.event.AgendaEventSupport.fireBeforeActivationFired(AgendaEventSupport.java:103)
at org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:540)
at org.drools.common.DefaultAgenda.fireNextItem(DefaultAgenda.java:518)
at
org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:475)##############
##############
at
org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:439)
at com.demo.rules.RuleDemo.fireRule(RuleDemo.java:116)
at com.demo.rules.RuleDemo.main(RuleDemo.java:221)
java.lang.NullPointerException
at
org.drools.common.DefaultAgenda.getScheduledActivations(DefaultAgenda.java:351)
at
com.demo.rules.RemoveActivationsForRule.removeActivationsForRule(RemoveActivationsForRule.java:27)
at com.demo.rules.Rule_init_rule1_0.consequence(Rule_init_rule1_0.java:7)
at
com.demo.rules.Rule_init_rule1_0ConsequenceInvoker.evaluate(Rule_init_rule1_0ConsequenceInvoker.java:22)
at org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:554)
at org.drools.common.DefaultAgenda.fireNextItem(DefaultAgenda.java:518)
at
org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:475)
at
org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:439)
at com.demo.rules.RuleDemo.fireRule(RuleDemo.java:116)
at com.demo.rules.RuleDemo.main(RuleDemo.java:221)
##############
I have attached my source code.
Thanks and Regards,
Ganesh
http://www.nabble.com/file/p19429177/RuleDemo.java RuleDemo.java
--
View this message in context: http://www.nabble.com/Agenda.getScheduledActivations%28%29-method-is-thro...
Sent from the drools - dev mailing list archive at Nabble.com.
16 years, 3 months
W3C RIF in Last Call
by Adrian Paschke
Dear All,
The W3C Rule Interchange Format (RIF) Working Group recently published
"Last Call" drafts of two of its specifications:
- "RIF Basic Logic Dialect" (BLD) specifies an XML format for rules
at an intermediate expressive power. The language is roughly
Horn rules with URIs, datatypes, and builtins. This goes beyond
datalog (it has function terms), it but does not provide any kind
of negation. (Various forms of negation, and other features,
are expected to be provided by dialects which extend BLD, to be
published in the future.)
http://www.w3.org/TR/rif-bld/
- "RIF RDF and OWL Compatibility" explains and specifies how RIF
rulesets are to be used in combination with RDF and OWL.
http://www.w3.org/TR/rif-rdf-owl/
LAST CALL IS THE KEY TIME FOR EXTERNAL REVIEW. The designs are
essentially complete (the Working Group believes the design work is
done), but things can still be changed in response to external input.
Additionally, input on editorial issues (especially pointing out
ambiguities) is always welcome.
In addition to these Last Call documents, the Working Group has
published four other drafts:
- RIF Production Rule Dialect (PRD) specifies an XML format for the
exchange of production rules. PRD and BLD are expected to be the
basis of the two main dialect-branches, with RIF Core being the
things in common between the two. (We have not yet published a
document expressing that intersection, but it can be inferred
from the PRD and BLD specifications.) This is a first public
working draft. This is an exellent time to comment on the
general direction of the language, and give feedback on all the
issues mentioned as Editor's Notes in the document.
http://www.w3.org/TR/rif-prd/
- RIF Framework for Logic Dialects (FLD) and RIF Datatypes and
Builtins (DTB) provide common elements for specific dialects to
use.
http://www.w3.org/TR/rif-fld/
http://www.w3.org/TR/rif-dtb/
- RIF Uses Cases and Requirements (UCR), last published about two
years ago, has been simplified and now has examples written in
the PRD and BLD presentation syntaxes. The examples can be
hidden or revealed using Javascript controls.
http://www.w3.org/TR/rif-ucr/
Feedback on all these documents should be sent to:
public-rif-comments(a)w3.org <mailto:public-rif-comments@w3.org>
All comments (and responses to them) will be available at the public
archive:
http://lists.w3.org/Archives/Public/public-rif-comments/
Please comment by 19 September so we have time to address your comments
in incorporate any changes into our next round of publications.
Best,
Adrian Paschke
16 years, 3 months
Exporting individual packages from BRMS
by Daniel Kalcevich
Hello,
We are currently using BRMS and have about 240 rule packages loaded.
The current export only allows the export of the entire repository. I
am wondering if any thought has been given to providing the ability to
export a subset of the total packages, and then be able to import them
back? I took a look at the BRMS latest development code and found the
places where the BRMS is exporting, but did not see anything related to
individual packages. Can someone let me know their thoughts about
whether a)this is possible and b)if it has been considered? I was
thinking of trying to write the code to do it if it is possible.
Thanks,
Daniel
This email and/or any files or attachments transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed, and may contain information that is privileged, confidential and exempt from disclosure under applicable law. If you are not the intended recipient, or the employee or agent responsible for delivering the message to the intended recipient, you are hereby notified that any dissemination, distribution or copying of this e-mail and/or any files or attachments transmitted with it is strictly forbidden. If you have received this email in error, please delete the e-mail and/or any files or attachments, and also notify the system manager (PostMaster(a)mercuryinsurance.com) of the error. Please note that any views or opinions presented in this email are solely those of the author and do not necessarily represent those of the company. Finally, the recipient should check this email and any attachments for the presence of viruses. The company accepts no liability for any damage caused by any virus transmitted by this email and/or any files or attachments transmitted with it.
16 years, 3 months
Target M2 for tomorrow (September 9th)
by Edson Tirelli
All,
We will try to release M2 tomorrow, September 9th, so, if there is
anything you want to include, please do it today, but be particularly
careful to not break the build.
If you don't make it, don't worry, lets do an M3 asap after M2.
[]s
Edson
--
Edson Tirelli
JBoss Drools Core Development
JBoss, a division of Red Hat @ www.jboss.com
16 years, 4 months
Drools Boot Camp (Oct 16-21) and Texas Rules Fest goes bigger and better (Oct 22-24)
by Mark Proctor
http://blog.athico.com/2008/09/drools-boot-camp-and-texas-rules-fest.html
-------------
Due to large number of registrations the Texas Rules Fest has had to
move location from the Addison to the Sheraton Dallas:
http://www.rulesfest.org/OctoberRulesFest/Location.html
As a reminder entire Drools team will be at the *Dallas Rules Fest*,
<http://rulesfest.org/>this October 22nd to 24th. This is a *must
attend* non-profit event, with $150 registration fee, for hands on rule
training on a variety of products and disciplines with some top industry
speakers <http://rulesfestregistration.dallasrulesgroup.org/Speakers>
and a fantastic agenda
<http://rulesfestregistration.dallasrulesgroup.org/Agenda> - *just
stuff, not fluff* ;) Gary Riley will be there, author of the rules
"bible" Expert Systems
<http://www.allbookstores.com/book/9780534937447/Gary_Riley/Expert_Systems...>,
talking about his rule engine the venerable Clips
<http://clipsrules.sourceforge.net/>. Charles Forgy, the inventor of
Rete and "father" of rule engines, will be there talking about his break
through research in parallel executing rule engines. Daniel Selman from
Ilog will be there giving tutorials on the ilog engine and tooling.
The organisers have asked me to remind everyone thinking of going to
register <http://www.rulesfest.org/OctoberRulesFest/Register.html>
sooner, rather than later, as they may actually sell out if the rate of
registrations continues.
Come Join the Week Long Drools Boot Camp
The Drools team will actually be arriving the week before, on the 15th,
for our team meeting which is open to all and starts official on the the
16th in the Best Western hotel
<http://book.bestwestern.com/bestwestern/productInfo.do?propertyCode=44540>
conference room. So if you want to chat rules in general or specifically
on your problems, or just get involved in some hard core programming,
please do come along. We will be staying at the Best Western hotel
<http://book.bestwestern.com/bestwestern/productInfo.do?propertyCode=44540>
which has rooms from just $69USD per night :)
So far we have Franklin America <https://www.franklinamerican.com/> and
German Aerospace <http://www.dlr.de/en/> joining us for the team meeting
and hard core Drools coding, still room for more :)
16 years, 4 months
Changes on parser integration
by Alexandre Porcelli
Hello All,
I made some changes on DrlParser, now all the previus parse methods
signatures has a new one: adding a boolean in front of each signature.
What daes this booleans means? If this boolean is setted to true, it
activates the parse in editor-mode. Editor-mode is focused on editor
integration and it is not well optimized.
So unless you need editor information (like : Location and partial
Descrs) you should not use the editor-mode.
Kris:
I could provide you additional information for well formed sentences,
but in most cases it just returns Descrs before the first syntax
problem. Check this tes for a better reference on how to use this new
editor-mode: https://svn.jboss.org/repos/labs/labs/jbossrules/trunk/drools-compiler/sr...
[]s
Alexandre Porcelli
16 years, 4 months