Is it possible to get Drools to load all the rules table within an excel
spreadsheet if they are spread across multiple worksheets?
From the documentation I have read it appears drools will only load the rules
from the first/a specified worksheet.
The only way I have found to do it is to load
I've been trying to get agenda groups working and after a bit of poking
around have realised that agenda group support is broken.
Looking on jira somebody has already raised the bug and supplied a
simple patch (https://jira.jboss.org/jira/browse/JBRULES-2208) when is
this patch likely to be
Have you tried removing the System.out.println statement from the rule? Writing
to the console can be very very slow.
You could also get rid of the audit logger which could be spitting out a lot of
data into a file (or it may not, I've not actually tried it).
Thomas
-Original Message-
There is a bug here though if the hashcodes are equals.
You need to make it
$w : Widget( $name : name )
Widget( this != $w, hashCode = $w.hashCode, name == $name )
And live with the fact there is a chance that the rule does fire twice - which
is probably a better scenario that it failing
My advice is always to include a rulename (NAME) column and explicitly specify
all the rule names.
That way the name of the rule is deterministic and doesn't suddenly change if
someone happens to insert a rule in the row above - this is particularly useful
if you log or audit the rules that
on it but as it is currently running behind I'm not sure
if that is going to happen or not.
Thomas
Swindells, Thomas wrote:
My advice is always to include a rulename (NAME) column and
explicitly
specify all the rule names.
That way the name of the rule is deterministic
I've got a fact which contains a collection (a set of strings to be
precise). I want to write a rule which fires if there are any invalid
values (where the valid values are defined as a list).
What I'm trying to do is express this within a decision table.
Expressed as a drl rule the following
Please could someone clarify exactly how activation-groups work.
My understanding of them is that if a set of rules are all in the same
activation group then only one of them will fire.
Is this correct? In particular what happens if a rule becomes deactivated, can
another rule in the same
Hi Gurvinder.
Not sure where new lines have gone from your email - it makes it very hard to
read!
I've also been working on a project which uses decision tables and I couldn't
find any way to use from statements either. I'm hoping to get some time within
the project to work on the drools
I'd agree, and to join up with the other thread is the exact reason why we need
some decent 'design pattern' documentation to explain what does and doesn't
easily work in drools.
Depending what you are trying to do you may be able to use eval to perform the
logic for you, though this will
doesn't work easily in drools. I think this is the
most
important category. Every framework has a degree of flexibility and
whilst
drools is extremely flexible, the consequences may not be that
pleasant.
2009/12/4 Swindells, Thomas tswinde...@nds.com
I’d agree, and to join up
Have you tried making your classes beans?
Eg adding getters and setters. (As a style guide in java you should generally
avoid public fields and class names should start with a capital letter).
This would give you the following:
public class Message {
private Numbers[] numbersArray;
Broadcast: asset metadata manipulation and validation
From: rules-users-boun...@lists.jboss.org
[mailto:rules-users-boun...@lists.jboss.org] On Behalf Of Wolfgang Laun
Sent: 17 December 2009 08:24
To: Rules Users List
Subject: [rules-users] A quick survey of application areas
Folks who have a
My gut instinct would say that this is possibly correct.
I've not looked at the mvel code but if all your types are strings then it
makes sense for it to pick the most type specific operator first.
Multiplication only works on numbers so it attempts to convert them but the +
operator is defined
priority is Date 1. If Date 1 and Date 2
are not null and the rest are null then my priority is Date 2 and so
no.so we are looking at 16 different possibilites and the
prioritieshow can i set the priority in this case...
Thanks
Swindells, Thomas wrote:
The key thing
This looks to be a maven issue.
The most likely cause is probably that your networks proxy hasn't been
configured properly in your maven settings.xml file, alternatively your proxy
may be blocking the downloads or you were just unlucky and the site was down!
Thomas
From:
I believe currently you can only apply rules on POJO, you could use JAXB to
convert from XML to POJO but this doesn't work very well on deeply nested or
complex data structures if you wish to perform updates on the data.
XML support is something I've been pondering over as to how easy it would
It would help if you specify what the exact error message you are getting.
Have you imported the required classes?
From: rules-users-boun...@lists.jboss.org
[mailto:rules-users-boun...@lists.jboss.org] On Behalf Of Da Sun
Sent: 06 January 2010 14:31
To: rules-users@lists.jboss.org
Subject:
I'd vote to keep it on here, the traffic isn't that high and people like me can
learn about what other features exist. Plus it makes searching for answers so
much easier.
Thomas
-Original Message-
From: rules-users-boun...@lists.jboss.org [mailto:rules-users-
Have you tried using 'this.hasStudent($param)'? Or just writing
'hasStudent($param).
Thomas
-Original Message-
From: rules-users-boun...@lists.jboss.org [mailto:rules-users-
boun...@lists.jboss.org] On Behalf Of djb
Sent: 08 January 2010 16:30
To: rules-users@lists.jboss.org
The most likely reason for this is that your rule action goes and updates
classroom which then causes the rule to be evaluated and matched again.
-Original Message-
From: rules-users-boun...@lists.jboss.org [mailto:rules-users-
boun...@lists.jboss.org] On Behalf Of djb
Sent: 11
The easiest pattern is to create a GroupLatch helper object has a name.
Then add two columns, a Condition column which checks that there doesn't exist
a Latch with the given name, and an action column which inserts a new Latch
with the given name into the working memory. If multiple rules have
As I see it you have a number of options,
As you have said you could scope your latches so that they only apply to a
particular object, rather than generating a UUID you can probably get away with
using the object reference itself; however you will also need to watch out for
memory leaks, this
Sounds like you want to use truthmaintenance and probably insertlogical.
There's a good tutorial/description on it here
http://feeds.athico.com/~r/DroolsRSS/~3/BbuYJS41FDc/drools-inference-and-truth-maintenance.html
Basically, in your cases, you would insert a 'result' object with a given name
Is there any documentation on how to write these custom evaluators anywhere? I
don't recall seeing them mentioned anywhere before.
Thanks,
Thomas
From: rules-users-boun...@lists.jboss.org
[mailto:rules-users-boun...@lists.jboss.org] On Behalf Of Edson Tirelli
Sent: 31 January 2010 16:24
To:
XOR-Groups are supported using a column of ACTIVATION-GROUP.
AGENDA-GROUP is meant to be supported but in fact isn't - the column name works
but in fact aren't https://jira.jboss.org/jira/browse/JBRULES-2208.
There is a patch against the issue so I don't know if it has been fixed in
trunk, I've
But isn't the way Rete work is that it creates a decision tree to work out
which rules to evaluate. Right at the top of the tree will be a check on the
fact type that is being inserted, as the fact being inserted doesn't match
against any of the 20k rules (it is a totally different object
Sounds like a sensible document to have.
The hints that I have picked up (which may or may not be accurate).
Make facts as small and isolated as possible - the more fields a fact has then
the more rules that may be effected if any one of those fact fields are
updated. From (and even more so
Have you tried:
Applicant ( $ApplicantNumber : applicantNumber )
Eg your field should start with a lower case letter?
Thomas
From: rules-users-boun...@lists.jboss.org
[mailto:rules-users-boun...@lists.jboss.org] On Behalf Of
tom.e.mur...@wellsfargo.com
Sent: 09 February 2010 11:44
To:
Does drools have a work item which is able to act as a client to a soap service?
Also what other work items dose flow support and where is it documented. In
eclipse I just see work items for email and log but on the main drools flow
page (http://jboss.org/drools/drools-flow.html) it mentions a
If it works fine with an and operator then I’d imagine that startDate
$regDate returns false, with an this would abort evaluation immediately but
with an or it would mean that startDate endDate is evaluated and so
presumably it is this bit that is throwing the NPE. I’d imagine that the most
Have you got the stack trace, that may give a clue? Also what are the actual
values of start date and end date?
Thomas
From: rules-users-boun...@lists.jboss.org
[mailto:rules-users-boun...@lists.jboss.org] On Behalf Of dhari
Sent: 23 February 2010 11:30
To: rules-users@lists.jboss.org
Am I being blind or are in and not in not actually documented in the drools
expert user guide? In particular the fact that the syntax for the list is to
put it in round brackets (1,2,3) and not the square brackets [1,2,3] which you
would expect from the mvel documentation.
Also why can't
I'm not convinced about the silent failure argument as I don't see how it is
any different from the silent failure you get if the type doesn't exist in the
'main' knowledge base - this is probably because the way I conceptualize the
from keyword is to say don't use the normal knowledge base but
From what Mark Proctor posted in another thread:
Edson has just merged the Rete algorithm updates into trunk, we have one
remaining issue with planner and after that we 5.1M2. If thins go well we
should 5.1 final this month.
-Original Message-
From:
One of the big challenges of using drools is thinking declaratively and not the
iterative method of normal programming. Your first paragraph actually pretty
much sums up your rules nicely. One thing to comment on is that working on
collections (using the from keyword) isn't a particularly
What output do you get if you do
System.out.println(ucells[i].getClass().getName())?
My guess is that you either don't actually have an array of type UtranCell's or
you haven't imported UtranCell correctly.
Thomas
From: rules-users-boun...@lists.jboss.org
Odd,
Looks like it is a problem in the internal of mvel, there's two things I'd
suggest you could try:
Firstly try change it to be something similar to:
for (int i=0; iucells.length; i++)
{
UnltranCell toInsert = ucells[i];
insert( toInsert );
}
If you are lucky this may
Presumably all your RHS do is insert your Proven objects. If this is the case
then my first question is do you actually need to put in an optimisation here?
How much is the work of evaluating a few extra rule nodes compared to the work
and memory that will be required to evaluate the shadow
The most likely reason for this is that one of your rules is trying to evaluate
a value which is null. The when part of a rule is evaluated as the fact is
inserted and may be evaluated even if the then part will never be reached.
Looking at your stack trace it looks like the rule involved may
Have you tried removing the or and just splitting it into two separate rules?
From: rules-users-boun...@lists.jboss.org
[mailto:rules-users-boun...@lists.jboss.org] On Behalf Of Sebastian Furth
Sent: 29 March 2010 09:37
To: Rules Users List
Subject: [rules-users] Combined OR/NOT Rules results in
It's not a forum it is a mailing with a forum user interface bolted on the
front.
One option is for you to use the digest mode which sends you all the messages
in a single digest format, the other option is to setup mail rules to delete
everything you don't care about. You can see more here
The same way you call it from any other code? Create a knowledge session and
start using it as per the documentation here:
http://downloads.jboss.com/drools/docs/5.0.1.26597.FINAL/drools-expert/html_single/index.html#d0e237
If you want to share the knowledge session then using it is just the
If the aim is purely optimization then in that case it won't work (even
ignoring the fact you haven't told drools you are updating $co).
Activations are evaluated first then rules are fired. If an activation updates
an object then activations are recalculated.
Are you actually having
The easiest way to do this is to use regular expressions with matches
Eg
state matches AZ|CA|NV
if you don't care about the case then use (?i)AZ|CA|NV
You can find details of regex here
http://java.sun.com/javase/6/docs/api/java/util/regex/Pattern.html
There are also the in and memberof
Presumably ConcreteType1 extends BaseType. In this case the rule will evaluate
true as ConcreateType1 IS A BaseType and therefore the same object matches both
the o1 condition and the o2 conditions. This is why the tuple contains only 1
entry as there was only one unique object matched (o1 ==
I'm not convinced that converting a java exception to a process fault with the
same name is a solid behaviour.
In java it is perfectly permissible and valid for a piece of code to change the
exception it throws to a subclass of that exception (eg throw a
FileNotFoundException instead of a
What conditions are you placing on the rule?
If you haven't got any conditions on them then the number of possible
combinations (and so activations) that the rule can match will grow
exponentially.
If you rule has 10 objects all of the same type and no conditions preventing
them from being set
What is in your hashmap? Hashmap is only serializable if all the keys and
values within it are also serializable.
Thomas
-Original Message-
From: rules-users-boun...@lists.jboss.org [mailto:rules-users-
boun...@lists.jboss.org] On Behalf Of slawlor
Sent: 14 April 2010 12:26
To:
This is probably better asked on the LCDS mailing lists, as you correctly say
you can just treat drools as any other java application.
What you will probably need to do is make sure you have all the drools jar you
project depends on in the classpath of lcds, you may get away with putting them
And are you actually using drools flow? If not you should remove the
ruleflow-group.
Thomas
From: rules-users-boun...@lists.jboss.org
[mailto:rules-users-boun...@lists.jboss.org] On Behalf Of Wolfgang Laun
Sent: 20 April 2010 08:14
To: Rules Users List
Subject: Re: [rules-users] Rules Not
As ever the answer is it depends on how you want to do it and where you want to
put the logic. I'm not convinced that necessarily need to use flow, instead
just use a stateful knowledge session (one per client session).
Your servlet populate it with your constraints and whatever, runs a query
Probably not relevant but the standard language code for the UK is en-GB not
en-UK,
Thomas
From: rules-users-boun...@lists.jboss.org
[mailto:rules-users-boun...@lists.jboss.org] On Behalf Of Mauricio Salatino
Sent: 22 April 2010 17:22
To: Rules Users List
Subject: Re: [rules-users] Drools
You should probably restrict it so that
$cell2 : Cell(this != $cell1)
Thomas
From: rules-users-boun...@lists.jboss.org
[mailto:rules-users-boun...@lists.jboss.org] On Behalf Of Ryan Fitzgerald
Sent: 26 April 2010 15:34
To: rules-users@lists.jboss.org
Subject: [rules-users] How to make this rule
than 50% of the original, but still
quadratic.
-W
2010/4/26 Swindells, Thomas tswinde...@nds.com:
You should probably restrict it so that
$cell2 : Cell(this != $cell1)
Thomas
From: rules-users-boun...@lists.jboss.org
[mailto:rules-users-boun...@lists.jboss.org
Isn't the simplest solution just to add the imports at the start of the
imported drl file?
That is the users don't need to worry about writing the imports but before you
feed the files into your code simply prepends the required imports.
You can do this easily in memory with something like the
I'm not a guru but I'm pretty certain all modern JVMs support multiple cores
well. You will probably make sure you are using the server VM (-server) and
not the client VM (assuming you are using the standard VM). Depending on what
you current machine is and whether or not you have 2 cpu's or
Why is it an issue?
Your rule modifies holder so that the accumulate is no longer needed for that
particular holder, presumably init is called so that the accumulator can
restart its state from scratch and so release the memory it no longer needs. I
don't know if it does but this would then
My advice is to try just having a single column:
strValue matches $param.*
you could also compare the performance of that to
eval(strValue.startsWith($param))
Also presumably you are only wanting the first matching rule in your table to
fire, looking at the table below drools will fire all of
Yes,
How you do it depends on what you are wanting to do.
If you just want to use the newly created object from other rules then you
should insert it into the knowledge base.
If you just want to pass back your newly created object into your application
then the easiest way is to insert a global
You've got a problem.
Probably with what your rules are trying to do, possibly with the design of
your fact class.
Use a process of elimination to work out which rule is the problem and
construct the simplest example you can which causes this problem.
Then try working out if there is anything in
Why are you trying to remove a knowledge package while you are in the middle of
running rules? I'm not a drools developer and don't know whether it has been
designed to allow this area of code to be re-entrant but to me it seems like
you are trying to pull the rug (or at least part of it) out
-Original Message-
From: rules-users-boun...@lists.jboss.org [mailto:rules-users-
boun...@lists.jboss.org] On Behalf Of ramram
Sent: 21 May 2010 09:25
To: rules-users@lists.jboss.org
Subject: Re: [rules-users] Drools Rule Engine
Hi,
I have checked the rule template. I have
I might be wrong but I think the answer is there isn't a roadmap and concrete
dates can't really exist when its a subjective of when the code has reached the
milestone (there are no artificial constraints of customer deadlines to force a
particular release date).
What the more important
You can solve this if you are able to put an ordering on the Things.
Eg you could have
$that : Thing(...)
$other : Thing(this != $that, name $that.name)
This assumes that names are unique.
Thomas
From: rules-users-boun...@lists.jboss.org
[mailto:rules-users-boun...@lists.jboss.org] On Behalf
Hi everyone,
Is there any easy way to convert a workflow into an image file.
The only way I've found of doing it so far is to take a screenshot of it opened
in eclipse but I was wondering if anyone had any better ways of doing it?
Thanks
Thomas
associated with the
editor...next to the buttons allowing you to automatically reorganize your
nodes.
It exports in png
De : rules-users-boun...@lists.jboss.org
[mailto:rules-users-boun...@lists.jboss.org] De la part de Swindells, Thomas
Envoyé : mercredi 26 mai
I've been trying to learn how to use pipelines to execute some rules.
I've had a look at the JaxbSimpleJmsMessengerTest as that seemed a good place
to start and copy the code from (using drools 5.0.1).
However running the test doesn't seem to actually run any of the rules - I've
tried adding
You can't call one rule from another as rule evaluation isn't procedural, when
working with rules you are declaring what should happen in different
circumstances and it's up to the rules engine to decide how to evaluate it.
One very important thing to remember is that rule evaluation happens
I've still not managed to work this out,
How do I actually get my rules to fire when using a pipeline?
Thanks,
Thomas
From: rules-users-boun...@lists.jboss.org
[mailto:rules-users-boun...@lists.jboss.org] On Behalf Of Swindells, Thomas
Sent: 30 May 2010 18:47
To: Rules Users List
Subject
.
2010/6/2 Swindells, Thomas tswinde...@nds.commailto:tswinde...@nds.com
I've still not managed to work this out,
How do I actually get my rules to fire when using a pipeline?
Thanks,
Thomas
From:
rules-users-boun...@lists.jboss.orgmailto:rules-users-boun...@lists.jboss.org
[mailto:rules-users
Proctor
Sent: 03 June 2010 07:28
To: rules-users@lists.jboss.org
Subject: Re: [rules-users] Using pipelines
On 02/06/2010 11:15, Swindells, Thomas wrote:
I'm not trying to fire a particular rule, I'm trying to get the pattern
matching inside the knowledge session to actually run, eg the equivalent
...@lists.jboss.org] On Behalf Of Mark Proctor
Sent: 03 June 2010 11:47
To: rules-users@lists.jboss.org
Subject: Re: [rules-users] Using pipelines
On 03/06/2010 11:05, Swindells, Thomas wrote:
I tried looking for one but couldn't see one in the PipelineFactory that can be
used when I've received
In fact in your case you when condition doesn't make any sense - B will never
equal the empty string as B isn't a string.
You probable want the following:
rule foo
when
$a :A(Type == Prod , objectB == null)
then
B bobject = new B();
bobject.setType(Prod);
This isn't really a Drools question just a basic java programming question.
You are trying to read your input files from the current working directory
(which defaults to the root of your project in eclipse).
What you probably want to be doing is reading your files from the classpath
instead.
Hi Everyone,
I'm trying to get my head round how to use Drools Flow in a reliable manner.
In particular I'm trying to understand how to defensively program against
exceptions thrown within Action Nodes (eg NullPointerException).
In 5.0.1 it is absolutely horrendous as if the action throws an
Or just add a global AlertNotifier alertNotifier and in your rules call
alertNotifier.raiseAlert(...).
Of course you will have to actually write AlertNotifier yourself to do whatever
you want it to do but that is trivial as it's just a POJO.
Thomas
From: rules-users-boun...@lists.jboss.org
Look into the drools KnowledgeAgent api (do a google you should find old
discussion/blog posts about it).
Alternatively if you know where your drl files live and just want to do it at
startup just use the standard File methods to list all the *.drl files in
that particular directory.
Thomas
Generally the advice when using drools is that if you are wanting to use an
array (or other type of collection) then you should probably be normalising
your data and putting the values of the collection into the working memory as
their own object (pretend that drools is a relational database
You technical description isn't at all accurate.
You need to read up on Rete Trees, I'm still a bit vague on them myself but a
hopefully slightly more accurate description is as follows:
When the rules are compiled each of their conditions is converted to a node on
the graph. If rules share the
] Write Drools Books - Packt Publishing.
(Mark Proctor)
2. How to break the rules execution if one has been satisfied ??
(Nikhil S. Kulkarni)
3. Re: How to break the rules execution if one has been
satisfied ?? (Swindells, Thomas
Looks like your classpath is missing a jar that contains
org.drools.brms.server.util.BRXMLPersistence
Your either missing a dependency that you need or you may have a mix of
different versions causing problems.
What's in your classpath and how are you managing it?
Thomas
-Original
Why are you trying to read it from your classpath? As it wasn't in your
classpath when you loaded java doesn't know about it.
You already have the File object so you can just make a FileReader object from
that.
Reader source = new FileReader(drlFile);
Don't forget to close your reader when
The key difference of using collections over working memory is what happens
when you update a fact.
When you use update/modify you tell drools that that object has changed. Drools
then works out which rules are affected by the change and re-computes the
affected part of the rule and triggers
What you are asking for is incredibly insecure and bad for so many reasons...
If you really want to be passing around your passwords in the url for anybody
to see then what you may be able to do is to use the standard http method of
embedding the credentials:
Rather maintaining global lists have you looked into using queries against the
working memory to get out what you need?
Thomas
From: rules-users-boun...@lists.jboss.org
[mailto:rules-users-boun...@lists.jboss.org] On Behalf Of Fnu Mahalakshmi
Sent: 18 June 2010 14:58
To:
Download the drools source code, there are loads of examples in the
drools-decisiontables unit tests.
Thomas
From: rules-users-boun...@lists.jboss.org
[mailto:rules-users-boun...@lists.jboss.org] On Behalf Of amit bhardwaj
Sent: 19 June 2010 20:21
To: rules-users@lists.jboss.org
Subject: Re:
So what you are trying to say is that you want a rule to fire if there exists a
name from (a, b, c) such that there are no object with that name?
Which is probably something like the following:
global $collection (which is set to the list
exists (
$name: String from $collection
not Object(name
I don't think you can unfortunately.
You've got a number of options:
1. define a global (in sheet headers) and insert the actual values from code
(perhaps reading from the spreadsheet).
2. Define a custom datatype Name, have a table with which each row inserts a
Name object with associated value
in the grammar we could not get
rid of this limitation yet. Maybe in the future.
Edson
2010/6/23 Swindells, Thomas tswinde...@nds.commailto:tswinde...@nds.com
I don't think you can unfortunately.
You've got a number of options:
1. define a global (in sheet headers) and insert the actual values from
What's in your manifest in your jar file?
Also should it be CP=drools/*:drools/lib/*:. Rather than droos?
Thomas
From: rules-users-boun...@lists.jboss.org
[mailto:rules-users-boun...@lists.jboss.org] On Behalf Of Wolfgang Laun
Sent: 23 June 2010 15:45
To: rules-users@lists.jboss.org
Subject:
You don't access rules in excel, you define rules in excel which are
generated and loaded into the knowledge base as you have done below.
You then need to create a session, add some facts to it and execute it:
Eg:
If collection is a collection of the facts you want to run through your model
Having the same JAR containing the same class in the classpath within the same
classloader shouldn't make a difference.
However having different jars (or other sources) containing potentially
different versions of the same class can cause significant problems.
Furthermore drools doesn't
You can write your own custom work item handler which can handle performing all
the necessary glue however you want that part of the system to work.
The drools workflow docs provide details on how to go about doing this - plus I
think you may be able to find some further tutorials and blog posts
want to write a custom work item that helps me to pass some of the data from
the process to some other application through its interface. Will I be able to
do that??
Thanks.
Santosh Mukherjee.
On Wed, Jul 14, 2010 at 5:22 PM, Swindells, Thomas
tswinde...@nds.commailto:tswinde...@nds.com wrote
Your missing something - the human task handler is just a 'standard' custom
work item handler, it doesn't do anything special that nobody elee can do.
What you basically need to do is ensure that your flows are persisted, your
work item handler doesn't complete immediately instead it
You probably want to read up on agenda listeners - this will let you get the
information you want.
Thomas
-Original Message-
From: rules-users-boun...@lists.jboss.org [mailto:rules-users-
boun...@lists.jboss.org] On Behalf Of G3
Sent: 15 July 2010 14:16
To:
Your rules are probably written wrong, or your application, or you have a dodgy
computer, or you have a race condition, or it is doing exactly what it should
be doing and your expectations are wrong.
There's also possibly a small chance that there is a bug in drools but with
absolutely no
I think I answered this on the mailing list before,
From what I can remember the currency parser that is being used is locale
specific, you either need to configure your locale or change your dat file to
make sure the prices are in your local currency.
Hopefully that will fix it,
Thomas
Why is rule 1 written the way it is? Why can't you just do:
rule Rule 1 - Remove all A's that have property set to 123
salience 1000
when
$anA : A( property == 123 )
then
retract ($anA)
end
Thomas
From: rules-users-boun...@lists.jboss.org
[mailto:rules-users-boun...@lists.jboss.org]
1 - 100 of 287 matches
Mail list logo