Inconsistent option property naming
by Wolfgang Laun
Looking at
WorkItemHandlerOption implements MultiValueKnowledgeSessionOption
contains
public static final String PROPERTY_NAME = "drools.workItemHandlers";
which is used as
public String getPropertyName() {
return PROPERTY_NAME+name;
}
so that some actual property setting would have to be the ugly concatenation
drools.workItemHandlerstheName = theHandler
All (!) other multi-valued options use a period to separate the fixed
part from the user-defined tag, i.e.,
public static final String PROPERTY_NAME = "drools.workItemHandlers.";
-W
11 years, 10 months
Waiting for a Revelation
by Wolfgang Laun
In org.drools.runtime.conf, there's a class with the unlikely name:
BeliefSystemTypeOption
Well, you gotta have faith, and I'm sure that one day there'll be a
revelation and tell us all about this option.
Meanwhile, we can amuse ourselves by reading the source code, where
the "belief" is frequently replaced by "belie". Since method
getBelieSystemType() is documented as "Returns the configured clock
type", it's probably not too far off.
-W
11 years, 10 months
Memory Leak in 5.4.0 and 5.5.0 [was: Garbage collection and sliding windows (Drools 5.5.0 Final)]
by Wolfgang Laun
With Drools 5.4.0.Final and 5.5.0.Final, automatic event retraction in
combination with a sliding window is broken, i.e., it suffers from a
memory leak. Full code for a demo has been posted by tai-atari; so I
just add some diagnostics that clearly indicate what goes wrong.
In the snapshot taken with jmap -histo:live after running the program
for several seconds and the insertion of 15800 AnEvent facts you can
see:
* several classes with 2000 instances each - AnEvents and the ones
required for bookkeeping the future expiry
* EventFactHandle, WindowTupleList, ObjectHashMap$ObjectEntry all
growing without restraint, indicating a memory leak.
num #instances #bytes class name
----------------------------------------------
1: 8747 8696096 [S
2: 26985 4110776 <constMethodKlass>
3: 26985 2161888 <methodKlass>
4: 47816 2046304 <symbolKlass>
5: 2414 1482672 <constantPoolKlass>
6: 6142 1434280 [I
7: 13800 1324800 org.drools.common.EventFactHandle
8: 2414 1056424 <instanceKlassKlass>
9: 1891 854664 <constantPoolCacheKlass>
10: 8348 644704 [C
11: 13800 441600 org.drools.reteoo.WindowTupleList
12: 2571 426976 [B
13: 15800 379200
org.drools.core.util.ObjectHashMap$ObjectEntry
14: 2672 256512 java.lang.Class
15: 545 246776 <methodDataKlass>
16: 7852 188448 java.lang.String
17: 4084 185496 [[I
18: 2000 176000 org.drools.common.PropagationContextImpl
19: 8 164288 [Lorg.drools.core.util.Entry;
20: 2000 160000 org.drools.common.AgendaItem
21: 2005 128320 org.drools.reteoo.WindowTuple
22: 2000 128000 org.drools.reteoo.RuleTerminalNodeLeftTuple
23: 2001 96048 java.util.concurrent.FutureTask$Sync
24: 2001 80040
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask
25: 1165 79152 [J
26: 229 75112 <objArrayKlassKlass>
27: 2001 64032
org.drools.time.impl.JDKTimerService$JDKJobHandle
28: 2001 64032 org.drools.time.impl.DefaultTimerJobInstance
29: 423 54728 [Ljava.lang.Object;
30: 2150 51600 java.util.LinkedList$Entry
31: 2052 49248 java.util.LinkedList
32: 2002 48048
org.drools.core.util.ObjectHashSet$ObjectEntry
33: 2001 48024 java.util.Date
34: 2000 48000
org.drools.reteoo.ObjectTypeNode$ExpireJobContext
35: 1958 46992 java.util.HashMap$Entry
36: 2261 36176 java.lang.Integer
37: 2006 32096 java.util.concurrent.atomic.AtomicBoolean
38: 2001 32016 org.drools.time.impl.PointInTimeTrigger
39: 2000 32000
org.drools.reteoo.ReteooWorkingMemory$WorkingMemoryReteExpireAction
40: 2000 32000 memcons.AnEvent
On 17/02/2013, tai-atari <p00temkin(a)gmail.com> wrote:
> Hi laune,
>
> Really appreciate you trying to reproduce the issue. Since you are not
> experiencing the same behavior I'm obviously missing something. I've
> attached a very simple example below which reproduces the scenario for the
> Drools versions I have tried so far: 5.2, 5.4 and 5.5.
>
> Basically this example runs an infinite loop which inserts 200 events about
> every second, and keeps a sliding window of 10 seconds. Every loop will
> print the current wm event count, which will increase to 2000 and stay put.
> This is where I expected the expired events to be available for garbage
> collection (since only 2000 are concurrently active in wm). But VisualVM
> shows that org.drools.common.EventFactHandle uses an increasing amount of
> memory over time.
>
> Start.java:
> ==================================
> package org.drools.example;
>
> import java.util.Random;
>
> import org.drools.KnowledgeBase;
> import org.drools.KnowledgeBaseConfiguration;
> import org.drools.KnowledgeBaseFactory;
> import org.drools.builder.KnowledgeBuilder;
> import org.drools.builder.KnowledgeBuilderError;
> import org.drools.builder.KnowledgeBuilderErrors;
> import org.drools.builder.KnowledgeBuilderFactory;
> import org.drools.builder.ResourceType;
> import org.drools.conf.EventProcessingOption;
> import org.drools.io.ResourceFactory;
> import org.drools.runtime.StatefulKnowledgeSession;
> import org.drools.runtime.rule.WorkingMemoryEntryPoint;
>
> public class Start {
>
> public static final void main(String[] args) {
> try {
>
> System.out.println("Init");
> KnowledgeBase kbase = readKnowledgeBase();
> StatefulKnowledgeSession ksession =
> kbase.newStatefulKnowledgeSession();
> WorkingMemoryEntryPoint eventStream =
> ksession.getWorkingMemoryEntryPoint("TheEventStream");
> Random randGen = new Random();
>
> while( true ) {
>
> // Insert 200
> int x = 0;
> while( x < 200 ) {
> AnEvent anEvent = new AnEvent();
> anEvent.setSource(randGen.nextInt());
> eventStream.insert(anEvent);
> ksession.fireAllRules();
> x++;
> }
>
> System.out.println("current event count in wm" + ": " +
> eventStream.getFactCount());
> Thread.sleep(1000);
> }
>
> //ksession.dispose();
>
> } catch (Throwable t) {
> t.printStackTrace();
> }
> }
>
> private static KnowledgeBase readKnowledgeBase() throws Exception {
>
> KnowledgeBuilder kbuilder =
> KnowledgeBuilderFactory.newKnowledgeBuilder();
> kbuilder.add(ResourceFactory.newClassPathResource("Sample.drl"),
> ResourceType.DRL);
> KnowledgeBuilderErrors errors = kbuilder.getErrors();
> if (errors.size() > 0) {
> for (KnowledgeBuilderError error: errors) {
> System.err.println(error);
> }
> throw new IllegalArgumentException("Could not parse
> knowledge.");
> }
>
> final KnowledgeBaseConfiguration kbConfig =
> KnowledgeBaseFactory.newKnowledgeBaseConfiguration();
> kbConfig.setOption(EventProcessingOption.STREAM);
> KnowledgeBase kbase = KnowledgeBaseFactory.newKnowledgeBase(kbConfig);
>
> kbase.addKnowledgePackages(kbuilder.getKnowledgePackages());
> return kbase;
> }
>
> }
> ==================================
>
> AnEvent.java:
> ==================================
> package org.drools.example;
>
> public class AnEvent {
>
> private Integer source;
>
> public AnEvent () {
> }
>
> public Integer getSource() {
> return source;
> }
>
> public void setSource(Integer source) {
> this.source = source;
> }
>
> }
> ==================================
>
> Sample.drl
> ==================================
> package org.drools.example
> import org.drools.example.AnEvent;
>
> declare AnEvent
> @role( event )
> end
>
> rule "Event print"
> when
> AnEvent ( $src: source ) over window:time(10s) from entry-point
> TheEventStream
> then
> System.out.println("---------> Received AnEvent from " + $src);
> end
> ==================================
>
> Also tried using an immutable pojo as you suggested cusmaimatteo, with
>
> AnEvent.java:
> ==================================
> package org.drools.example;
>
> public class AnEvent {
>
> private final Integer source;
>
> public AnEvent (Integer i) {
> this.source = i;
> }
>
> public Integer getSource() {
> return source;
> }
> }
> ==================================
>
> and using instead using
>
> eventStream.insert(new AnEvent(randGen.nextInt()));
>
> but with the same memory issues noted.
>
>
>
>
>
> --
> View this message in context:
> http://drools.46999.n3.nabble.com/Garbage-collection-and-sliding-windows-...
> Sent from the Drools: User forum mailing list archive at Nabble.com.
> _______________________________________________
> rules-users mailing list
> rules-users(a)lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
11 years, 10 months
More on Field binding
by Wolfgang Laun
On 18/02/2013, Mark Proctor <mproctor(a)codehaus.org> wrote:
>
> On 18 Feb 2013, at 18:38, Wolfgang Laun <wolfgang.laun(a)gmail.com> wrote:
>
> I don't like nested bindings, I think it was there before due to backwards
> compatibility.
5.1.1 permitted a binding to the field on which a constraint was based, e.g.,
Person( $a: age > 10 || $sa: sibling.age > 10 )
>
> If we drop it for DRL6, we need to figure out a migration strategy. One
> possible way is we allow it in the parser stiff, as a config option (off by
> default, with warning of deprecated feature).
>
> Also field bindings are hangover from the Lisp days. Maybe we don't need
> property bindings anymore within patterns. Most use cases can use the
> pattern binding accessor for property access.
I'd say that field bindings must have some attraction in addition to
their heritage. Note that Lisp-ish CLIPS can access fact properties
based on a binding to the fact and the field name, but field bindings
are there all the same. (And, just because something's been used in
another language doesn't mean it's bad and must be avoided like the
plague.)
Simple field bindings is the one feature that permits me to write
rules tersely, lets me introduce an abbreviation for lengthy
factref.nameOfTheField and - if used consistently - signals a
pattern's dependency on some fact field.
And what about the positional bindings? I guess they are here to stay.
If so, it would be bizarre to the extreme if you could write
Foo( $a, $b; )
but not
Foo( $a: a, $b: b )
Consider: a feature requiring annotations on the unordered fields Java
class is permitted, but a very similar feature NOT requiring
annotations is not...?
Summary: Retain simple forms for binding "on the fly" to a field.
IMHO, there's no need to go overboard to permit it anywhere in complex
expressions (Edson's worry).
-W
> when
> $p : Pattern()
> then
> println( $p.name );
> end
>
> Field bindings allow bindings to complex expression results, involving
> nested accessors. We can use the "set" proposal I mentioned, and keep those
> outside of patterns.
> when
> $p : Pattern()
> $age : { $p.age * someGlobalIt } // $age will bind to the result of the
> expression
> then
> println( $p.name + ":" + $age );
> end
>
11 years, 10 months
[Bug]: 5.5.0: binding makes parser accept non-boolean constraint
by Wolfgang Laun
Below is a self-contained DRL which should not compile because the sum
isn't a boolean expression. (Note that omitting "$x:" results in the
correct diagnostic "predicate ... must be a boolean".)
declare Foo
a: double
b: double
end
rule what
when
$c: Foo( $x: a + b )
then
System.out.println( "foo: " + $c );
end
11 years, 10 months
[Bug] 5.5.0 Correctly compiled DRL runs into run time error: "incompatible types"
by Wolfgang Laun
Below is a fully self-contained DRL that compiles correctly but runs
into a runtime error when the LHS of rule "match" is evaluated. The
"culprit" is the test "this != $c", but one would expect simply a true
result from the comparison.
declare Person
name: String
end
declare Customer
extends Person
rating: int
end
declare Employee
extends Person
wage: int
end
rule initphone
salience 100
when
then
insert( new Customer( "Joe", 100 ) );
insert( new Employee( "Paul", 2100 ) );
end
rule match
when
$c: Customer()
$e: Employee( this != $c )
then
System.out.println( "c/e " + $c + " " + $e );
end
Exception in thread "main" Exception executing consequence for rule
"initphone" in express: [Error: incompatible types in statement: class
express.Customer (compared from: class express.Employee)]
[Near : {... this != $c ....}]
^
[Line: 1, Column: 1]
at org.drools.runtime.rule.impl.DefaultConsequenceExceptionHandler.handleException(DefaultConsequenceExceptionHandler.java:39)
at org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:1297)
at org.drools.common.DefaultAgenda.fireNextItem(DefaultAgenda.java:1221)
at org.drools.common.DefaultAgenda.fireAllRules(DefaultAgenda.java:1456)
at org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:710)
at org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:674)
at org.drools.impl.StatefulKnowledgeSessionImpl.fireAllRules(StatefulKnowledgeSessionImpl.java:230)
at express.Main.execute(Main.java:92)
at express.Main.main(Main.java:126)
Caused by: [Error: incompatible types in statement: class
express.Customer (compared from: class express.Employee)]
[Near : {... this != $c ....}]
^
[Line: 1, Column: 1]
at org.mvel2.ast.BinaryOperation.<init>(BinaryOperation.java:84)
at org.mvel2.util.CompilerTools.finalizePayload(CompilerTools.java:118)
at org.mvel2.compiler.ExpressionCompiler._compile(ExpressionCompiler.java:287)
at org.mvel2.compiler.ExpressionCompiler.compile(ExpressionCompiler.java:62)
at org.mvel2.MVEL.compileExpression(MVEL.java:810)
at org.drools.base.mvel.MVELCompilationUnit.compile(MVELCompilationUnit.java:435)
at org.drools.base.mvel.MVELCompilationUnit.getCompiledExpression(MVELCompilationUnit.java:238)
at org.drools.rule.constraint.MvelConstraint.createMvelConditionEvaluator(MvelConstraint.java:206)
at org.drools.rule.constraint.MvelConstraint.evaluate(MvelConstraint.java:190)
at org.drools.rule.constraint.MvelConstraint.isAllowedCachedRight(MvelConstraint.java:184)
at org.drools.common.SingleBetaConstraints.isAllowedCachedRight(SingleBetaConstraints.java:134)
at org.drools.reteoo.JoinNode.propagateFromRight(JoinNode.java:156)
at org.drools.reteoo.JoinNode.assertObject(JoinNode.java:148)
at org.drools.reteoo.SingleObjectSinkAdapter.propagateAssertObject(SingleObjectSinkAdapter.java:59)
at org.drools.reteoo.ObjectTypeNode.assertObject(ObjectTypeNode.java:235)
at org.drools.reteoo.EntryPointNode.assertObject(EntryPointNode.java:240)
at org.drools.common.NamedEntryPoint.insert(NamedEntryPoint.java:350)
at org.drools.common.NamedEntryPoint.insert(NamedEntryPoint.java:311)
at org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:903)
at org.drools.base.DefaultKnowledgeHelper.insert(DefaultKnowledgeHelper.java:192)
at org.drools.base.DefaultKnowledgeHelper.insert(DefaultKnowledgeHelper.java:186)
at express.Rule_initphone_aea184dfceb14326841c37daadabfdbc.defaultConsequence(Rule_initphone_aea184dfceb14326841c37daadabfdbc.java:8)
at express.Rule_initphone_aea184dfceb14326841c37daadabfdbcDefaultConsequenceInvokerGenerated.evaluate(Unknown
Source)
at express.Rule_initphone_aea184dfceb14326841c37daadabfdbcDefaultConsequenceInvoker.evaluate(Unknown
Source)
at org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:1287)
... 7 more
11 years, 10 months
Github commit rights cleanup
by Geoffrey De Smet
Hi guys,
Stemming from the SVN era, a lot of community contributers still have
full commit rights on the blessed repositories.
Because GitHub offers the "pull request" paradigm,
the lack of commit rights are far less intrusive than in SVN.
Many community contributors seem to prefer contributing changes through
pull request paradigm,
as it forces a core developer to sign off on the changes.
Having direct commit rights can even be counter-intuitive:
for example, if you edit a file directly on github, it doesn't create a
pull request, but applies the changes directly.
Commits from contributors that come in via pull requests are still
attributed to the original author
and count towards the original author's stats, so there are no
additional disadvantages.
Following that logic, I propose to *remove the commit rights on blessed
for these contributors* in 72 hours:
Please note that we appreciate past and future commits. Please keep the
contributions coming! :)
bauna
bbrodt
dennyxu
dgutierr
diega
jcoleman0redhat0com
jrenaat
jsvitak
JuanmaGonzalez
KurtStam
laune
lazarotti
leogomes
lucazamador
michaelneale
michiBK
mswiderski
nheron
nickboldt
nmirasch
pefernan
RickJWagner
ryanzhang
saifulomar
tkobayas
trefor
wmedvede
yurloc
If you're on this list and want to keep your commits rights on blessed,
just reply to this mail and I 'll take you off the list. No long
argumentation needed :)
*Keep commits rights on the blessed repositories*
etirelli
ge0ffrey
jervisliu
krisv
manstis
mariofusco
mdproctor
mrietveld
porcelli
pzapata
Rikkola
Salaboy
sotty
tsurdilo
*Might keep commits right on the blessed repositories*
I 'll ask these people what they prefer and do that.
esteban-aliverti
triceo
zenix
11 years, 10 months
RuleML 2013: 7th International Web Rule Symposium - Extended Call for Papers, Demos and Phd Papers
by Adrian Paschke
++++ Abstract/Paper Deadline Extended to Feb. 21st/Feb. 28th ++++++
Call for Papers, Call for Demos, Call for PhD Papers
RuleML 2013: 7th International Web Rule Symposium
University of Washington, Seattle,USA, July 11-13, 2013
http://2013.ruleml.org
The RuleML2013 Conference is also hosting:
- The 7th International Rule Challenge
- The 3rd Doctoral Consortium on Rules
- The OASIS Legal RuleML TC Meeting and Tutorial
=================================
The annual International Web Rule Symposium (RuleML) is an international conference on research, applications, languages and standards for rule technologies. RuleML is the leading conference for building bridges between academia and industry in the field of rules and its applications, especially as part of the semantic technology stack. It is devoted to rule-based programming and rule-based systems including production rules systems, logic programming rule engines, and business rules engines/business rules management systems; Semantic Web rule languages and rule standards (e.g., RuleML, SWRL, RIF, PRR, SBVR); Legal RuleML; rule-based event processing languages (EPLs) and technologies; hybrid rule-based methods; and research on inference rules, transformation rules, decision rules, production rules, and ECA rules.
The 7th International Symposium on Rules and the Web (RuleML 2013) will be held on July 11-13, 2013 just prior to the AAAI conference at the University of Washington, Seattle, USA. Selected papers will be published in book form in the Springer Lecture Notes in Computer Science (LNCS) series.
Objectives
==========
RuleML-2013 will stimulate cooperation and interoperability between research and business in a community of researchers and practitioners who are interested in the theory and applications of rules. The symposium's areas of research and development have helped drive the rapid progress in technologies for practical rule and event processing. As a result,
RuleML-2013 promises to be an exciting venue for the exchange of new ideas and experiences on issues related to engineering, management, integration, interoperability of rule systems, and interchange of rules in distributed enterprise, intranets, and open distributed environments. Industry practitioners, rule-system providers, users of rules, technical experts and developers, and researchers who are exploring foundational issues, developing systems and applications, or using rule-based systems are invited to share ideas, results, and experiences.
Topics
=======
We invite high-quality submissions related (but not limited) to one or more of the following topics:
* Rules and automated reasoning
* Rule-based policies, reputation, and trust
* Rule-based event processing and reaction rules
* Rules and the web
* Fuzzy rules and uncertainty
* Logic programming and nonmonotonic reasoning
* Non-classical logics and the web (e.g modal and epistemic logics)
* Hybrid methods for combining rules and statistical machine learning techniques (e.g., conditional random fields, PSL)
* Rule transformation, extraction, and learning
* Vocabularies, ontologies, and business rules
* Rule markup languages and rule interchange formats
* Rule-based distributed/multi-agent systems
* Rules, agents, and norms
* Rule-based communication, dialogue, and argumentation models
* Vocabularies and ontologies for pragmatic primitives (e.g. speech acts and deontic primitives)
* Pragmatic web reasoning and distributed rule inference / rule execution
* Rules in online market research and online marketing
* Applications of rule technologies in health care and life sciences
* Legal rules and legal reasoning
* Industrial applications of rules
* Controlled natural language for rule encoding (e.g. SBVR, ACE, CLCE)
* Standards activities related to rules
* General rule topics
Conference Chair
=================
Adrian Paschke (Freie Universitaet Berlin, Germany)
Program Chairs
===============
Leora Morgenstern (Science Applications International Corporation, USA)
Petros Stefaneas (NTUA, Greece)
Important Dates
===============
Abstract submission (extended): Feb. 21, 2013 23:59 UTC-12
Paper submission (extended): Feb. 28, 2013, 23:59 UTC-12
Notification of acceptance/rejection: April 12, 2013
Camera-ready copy due: May 3, 2013
RuleML-2013 dates: July 11-13, 2013
Submission guidelines
=====================
Papers must be original contributions written in English and must be submitted at http://www.easychair.org/conferences/?conf=ruleml2013 as:
* Full Papers (15 pages in the proceedings)
* Short Papers (8 pages in the proceedings)
Please upload all submissions in LNCS format (http://www.springer.de/comp/lncs/authors.html). To ensure high quality, submitted papers will be carefully peer-reviewed by 3 PC members based on originality, significance, technical soundness, and clarity of exposition.
Selected papers will be published in book form in the Springer Lecture Notes in Computer Science (LNCS) series.
7th International Rule Challenge
==========================
Open Call for Demos:
http://www.csw.inf.fu-berlin.de/ruleml2013/content/7th-international-rule...
Submission deadlines - RuleML-2013 Challenge:
Submission deadline for demo papers and demo systems: May 3rd, 2013
Notification of accepted demo papers and demo systems: June 7th, 2013
Camera-ready deadline: June 21st, 2013
3rd Doctoral Consortium
==========================
Call for PhD Papers:
http://www.csw.inf.fu-berlin.de/ruleml2013/content/3rd-ruleml-doctoral-co...
Submission deadlines - RuleML 2013 Doctoral Consortium:
Submission deadline for demo papers and demo systems: May 3rd, 2013
Notification of accepted demo papers and demo systems: June 7th, 2013
Camera-ready deadline: June 21st, 2013
11 years, 10 months
A fix for the Expert manual
by Wolfgang Laun
Will someone please take the time and replace the sentence from Expert
4.8.1, Rule Attributes (on activation-group), as given below.
Thanks
Wolfgang
In other words, the first rule in an activation-group to fire will
cancel the other rules' activations, i.e., stop them from firing.
===>
More precisely, the first rule in an activation-group to fire will
cancel all pending activations of all rules in the group, i.e., stop
them from firing.
11 years, 10 months
jsr94
by Mark Proctor
Out of interest, does anyone actually use JSR94 any more? Or is that pretty much a dead module?
Mark
11 years, 10 months