4.2 roadmap (as I see it)
by Michael Neale
This is how I see the 4.2 roadmap (main "big ticket" features) - I think
this is realistic for a short schedule (and I am probably missing things,
but lets keep it realistic):
(FYI this is only what *I* know is going on)
of course critical fixes will take priority, and there are many other small
tasks that will make it in as well - I am just trying to avoid a bloat that
means 4.2 is 5 ;)
BRMS/Tooling:
* Role/capability based security (using seam security) in the BRMS
* GUI for analysis tool/QA reporting on package quality (based on
contributions from Toni Rikkola)
* Declarative testing tools in BRMS (web GUI)
- junit extension for unit testing single rules
* IDE GUI to build/deploy a package
* Ruleflow stuff (Kris??)
* Web Service deployment of "decision services"
Core/lang:
* Improved error messages (relies on bug reports/examples)
* pluggable extractors (for future ontology)
UNKNOWN:
* IDE/BRMS integration
* Data driven "enums" in BRMS (this probably has to wait for a fuller
ontology I am afraid - else it is a can of worms - can hack something)
17 years, 4 months
Custom PackageBuilder
by Andreas Kinell
Hi all
I am trying to write a custom package builder in order to create rules
programmatically.
The most important feature are simple tests against object attributes like:
"if (position.getValue() > 100) then"
In Drools 3 I managed this the following way:
LiteralDescr literalDescr = new LiteralDescr("value", ">", "100");
// define what class the rule refers to
ColumnDescr columnDescr = new ColumnDescr("com.sample.bl.Position", "p");
columnDescr.addDescr(literalDescr);
// assemble condition
AndDescr andDescr = new AndDescr();
andDescr.addDescr(columnDescr);
ruleDescriptor.setLhs(andDescr);
packageDescriptor.addRule(ruleDescriptor);
Upgrading to Drools 4 the above code breaks and in search of a replacement
for ColumnDescr I stumbled across a FieldConstraintDescr which seems
appropriate according to the Pattern Entity Relationship Diagram (Figure
6.11) of paragraph 6.5 in the documentation.
Using it throws the following exception:
Exception in thread "main" org.drools.RuntimeDroolsException: BUG: no
builder found for descriptor class class
org.drools.lang.descr.FieldConstraintDescr
at
org.drools.rule.builder.GroupElementBuilder.build(GroupElementBuilder.java:7
7)
at org.drools.rule.builder.RuleBuilder.build(RuleBuilder.java:53)
at org.drools.compiler.PackageBuilder.addRule(PackageBuilder.java:420)
at
org.drools.compiler.PackageBuilder.addPackage(PackageBuilder.java:283)
What does that mean? Did I misunderstand the concept? Is there an easier way
to achieve what I want?
I appreciate any hints.
Thanks and regards,
Andreas
17 years, 4 months
Some performance ideas for 4.1
by Mark Proctor
1) Lazy latch nodes, that means the parent node does not propagate
unless there is something to join against in the child node.
2) Lazy latch querries. Add the DroolsQuery pattern to the end. Find
either the last unshared node or the root beta node and put in a "block"
semaphore, that means no data will propagate that is specific to the
query rule. When the DroolsQuery object is propagated to the JoinNode it
signals the "block" semaphore to propagate all its data. All data sets a
specail flag on the Tuple to say that no left memory is to be remember,
similar to how sequential works. Maybe the check for sequentail node
memory and this can be merged.
3) Collapse similar shared node groups into single execution units. This
can be used for sequential mode and standard mode, will need to add a
method for someone to declare that standard mode will not have it's
rulebase changed - i.e. its sealed/final or what ever we want to call
it. We can also optionaly JIT this
4) re-order alpha nodes to maximise sharing, this will also improve 3).
5) Static Agenda. Here the node memories use a linkedhashmap which
enables the join iteration in propagation order, Activations fire when
they reach the TerminalNode - there is no Agenda. This will approximate
a combination of LIFO+Rule Declaration Order and while it will be
slightly heavier for node memories will do a lot less work for
situations where there are a large number of conflict sets where only a
small percentage of them fire.
6) Allow some data to be marked as "closed world". This means the data
will only ever be created inside of the WorkingMemory. This way we can
analyse the rules and handle the life cycle of the data and allow us to
auto-unpropagate it back to the ObjectTypeNode when we know it will have
no further impact.
17 years, 4 months
SumIntegerAccumulateFunction not possible?
by Geoffrey De Smet
It looks like the value objects of the accumulate framework are always
Long's - even when they are Integers?
Caused by: java.lang.ClassCastException: java.lang.Long cannot be cast
to java.lang.Integer
at
org.drools.base.accumulators.SumIntegerAccumulateFunction.accumulate(SumIntegerAccumulateFunction.java:36)
at
org.drools.base.accumulators.JavaAccumulatorFunctionExecutor.accumulate(JavaAccumulatorFunctionExecutor.java:79)
Here's the piece of code:
public void accumulate(Object context,
Object value) {
SumIntegerAccumulateFunction.SumData data =
(SumIntegerAccumulateFunction.SumData) context;
data.total += ((Integer) value).intValue(); // breaks
}
Here's the drl:
when
$totalDistance : Integer() from accumulate(
Hop($distance : distance),
sumInteger($distance)
);
Here's the Hop object:
public int getDistance() {
...
}
Look ma, no longs :) Still a ClassCastException on them though.
I must be missing something really obvious?
--
With kind regards,
Geoffrey De Smet
17 years, 4 months
[accumulate] sum is always a double? What if it's only an int?
by Geoffrey De Smet
Hi guys,
I finally got around to experimenting with the accumulate support in
LocalSearchSolver. Thanks for implementing it :)
I use nothing but int's in my calculations,
but I get a ClassCastExceptions, as sum() always returns a Double and
setSoftConstraintsBroken(int) failes.
In a previous benchmarks I 've proven that summing integers in double's
instead of int's hurts performance for 10% or more (which is rather big).
Is there a sumInteger() available (or do I need to write it)? Or can it
be overloaded over sum() in a much cleaner way?
rule "ScoreCalculator"
when
$scoreFact : ScoreFact(); // singleton
$total : Integer() from accumulate(
Hop($distance : distance ), // distance is an int
sum($distance)
);
then
$scoreFact.setSoftConstraintsBroken($total);
end
svn is still here, till it's ready for drools:
https://taseree.svn.sourceforge.net/svnroot/taseree/trunk
--
With kind regards,
Geoffrey De Smet
17 years, 4 months
Missing package name for rule package
by pns77
Hi,
Am new to Drools. Trying to use the Java version of Drools with rules in an
xml file.
The following is the code i use
"....
InputStreamReader isr = new
InputStreamReader(this.getClass().getResourceAsStream("/rules/test/" +
rulesFile));
System.out.println("<<<<<<<<<<<< After getting InputStream
Reader"+isr.toString());
rules = RuleBaseLoader.getInstance().loadFromReader(isr);
.."
Have included the following jar files in the classpath.
1) drools-compiler-4.0.0.jar
2) drools-core-4.0.0.jar
3) antlr-runtime-3.0.jar
4) core-3.2.3.v_686_R32x.jar
5) mvel14-1.2rc1.jar
Have placed the rules in an xml file. The xml file is placed in the
folder/package "rules/test". When the application tries to call the
"loadFromReader" method, after getting the InputStreamReader, i get the
following exception
[8/10/07 13:16:24:173 GMT] 00000045 SystemErr R
org.drools.compiler.PackageBuilder$MissingPackageNameException: Missing
package name for rule package.
Would appreciate if someone could guide me on this.
I am using jdk1.4 with RAD6.0.
--
View this message in context: http://www.nabble.com/Missing-package-name-for-rule-package-tf4248947.htm...
Sent from the drools - dev mailing list archive at Nabble.com.
17 years, 5 months
Performance of Drools
by hare ram
Hello everyone,
I have a question regarding the performance of drools. The scenario is
this.I have a huge file. This file is produced by one of the 30 devices we
have in the lab.We have to figure out which of the device produced this file
. Each of the device has a its own "signature line", by which I can
distinguish each of the devices. So, previously what I was doing was,
reading each line in the file,checking if it is the "signature line" for
that device.All this is ordered. So if is my correct device is 30th, I have
to read this huge file 30 times,thus wasting a lot of time
I thought drools might come in handy in this scenario. So I have the rules,
which basically reads a line in the file and asserts into the memory. Each
time a new line is asserted into the memory,the rules for all of the
remaining 30 devices, check if it is its signature line. If so, i have found
out my device and clear the agenda.
But unfortunately i find that parsing the file 30 times id giving me a
better performance then using the drools. Is there something I am missing
17 years, 5 months
Featured Drools Job - Tier One Investment Bank
by Mark Proctor
http://blog.athico.com/2007/08/featured-drools-job-tier-one-investment.html
<original blog link>
Caspian One <http://www.caspian1.co.uk/> is the first company to place a
job advert on the Drools Job Board <http://jobs.athico.com>, as such I
thought I'd give it wider promotion :)
Intro: Caspian One is working with a tier one investment bank who is
looking to recruit a Java Developer to work within the Credit
Derivatives Front Office. Project description the successful candidate
will be given the opportunity to develop MiFID integration feeds in the
Drools framework. The team is responsible for hands on development of
implementation, feeds, integration and database infrastructure for an
in-house MiFID solution. This is all using SOA strategies, JBoss Drools
framework, JDBC, relational database design and SQL coding with either
MS SQL or Sybase. Also an essential is good knowledge of modern Java
development; Spring /Hibernate. The candidate must have a proven track
record of being able to work in a highly dynamic environment with some
experience in investment banking. As such we are looking for candidates
with good Java skills, who can design database using either MS SQL
coding or Sybase and the must is good experience using Drools.
Sales bit: The successful candidate will gain excellent exposure to
investment banking business areas, as well as the opportunity to work in
a technically challenging, delivery focused environment, within a fast
moving business areas.
You can view and apply for this this role at the Drools Job Board here
<http://jobs.athico.com/job/4e3e3d8ab8e221b47f90d5d5924f574f/?d=1>.
17 years, 5 months
Fwd: I need help, guided editor rules in the drools-examples-brms dont work
by Edgardo
Hi rules-dev list, (my english is very poor, sorry) I am interested in
using the
BRMS of JBoss Rules, but when I use the guided editor, this rules dont
work, and in drools-examples-brms example, this dont work too, the error
message (in the
"Driver is Crazy" rule)is:
RuleAgent(insuranceconfig) INFO (Fri Aug 03 16:05:58 CLT 2007): Adding
package called org.acme.insurance
org.mvel.CompileException: class or class reference not found: Rejection()
at
org.mvel.optimizers.impl.asm.ASMAccessorOptimizer.optimizeObjectCreation(ASMAccessorOptimizer.java:1771)
at
org.mvel.ast.NewObjectNode.getReducedValueAccelerated(NewObjectNode.java:49)
at org.mvel.MVELRuntime.execute(MVELRuntime.java:87)
at org.mvel.CompiledExpression.getValue(CompiledExpression.java:98)
at org.mvel.CompiledExpression.getValue(CompiledExpression.java:93)
at
org.mvel.ast.TypedVarNode.getReducedValueAccelerated(TypedVarNode.java:36)
at org.mvel.MVELRuntime.execute(MVELRuntime.java:87)
at org.mvel.CompiledExpression.getValue(CompiledExpression.java:98)
at org.mvel.MVEL.executeExpression(MVEL.java:202)
at org.drools.base.mvel.MVELConsequence.evaluate(MVELConsequence.java:32)
at org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:545)
at org.drools.common.DefaultAgenda.fireNextItem(DefaultAgenda.java:509)
at
org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:430)
at
org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:392)
at
org.acme.insurance.launcher.InsuranceBusiness.testDriverCrazy(InsuranceBusiness.java:93)
at
org.acme.insurance.launcher.InsuranceBusiness.executeExample(InsuranceBusiness.java:19)
at org.acme.insurance.launcher.MainClass.main(MainClass.java:13)
org.drools.spi.ConsequenceException: org.mvel.CompileException: class or
class reference not found: Rejection()
at org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:549)
at org.drools.common.DefaultAgenda.fireNextItem(DefaultAgenda.java:509)
at
org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:430)
at
org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:392)
at
org.acme.insurance.launcher.InsuranceBusiness.testDriverCrazy(InsuranceBusiness.java:93)
at
org.acme.insurance.launcher.InsuranceBusiness.executeExample(InsuranceBusiness.java:19)
at org.acme.insurance.launcher.MainClass.main(MainClass.java:13)
Caused by: org.mvel.CompileException: class or class reference not found:
Rejection()
at
org.mvel.optimizers.impl.asm.ASMAccessorOptimizer.optimizeObjectCreation(ASMAccessorOptimizer.java:1771)
at
org.mvel.ast.NewObjectNode.getReducedValueAccelerated(NewObjectNode.java:49)
at org.mvel.MVELRuntime.execute(MVELRuntime.java:87)
at org.mvel.CompiledExpression.getValue(CompiledExpression.java:98)
at org.mvel.CompiledExpression.getValue(CompiledExpression.java:93)
at
org.mvel.ast.TypedVarNode.getReducedValueAccelerated(TypedVarNode.java:36)
at org.mvel.MVELRuntime.execute(MVELRuntime.java:87)
at org.mvel.CompiledExpression.getValue(CompiledExpression.java:98)
at org.mvel.MVEL.executeExpression(MVEL.java:202)
at org.drools.base.mvel.MVELConsequence.evaluate(MVELConsequence.java:32)
at org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:545)
... 6 more
Thanks :), I am waiting for you response...
--
Edgardo Ibañez O.
17 years, 5 months