Follow up on high availability -
I'm planning to use Drools for Capacity Management. In my use-case I need to
track # of hours of planned capacity that has been consumed based on hours
allocated. I'm planning on having a StatefulKnowledgeSession that will have
facts that store the # of hours of c
That worked. Thanks for clearing this up.
--
View this message in context:
http://drools.46999.n3.nabble.com/ConcurrentModificationException-loading-facts-from-db-Hibernate-tp4018431p4018437.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
In my use case, I have ~ 200,000 rows in a table that I need lookup in order
to price an item. Rather than load the entire table into working memory,I'm
trying load the relevant rows (based on a matching criteria) and load those
as facts and then have my rules evaluate the loaded facts. Based on th
I'm trying to use the enabled function to ensure that some rules only fire
under certain conditions.
I have the following in my DRL :
rule "Load pricelist"
salience 1
when
$unitPrice : Pricelist() from
PricelistUtilities.getPriceLists()
then
Hello,
In our environment we need to develop a framework wherein we would have
about a dozen rule templates whose data will be provided by users using
spreadsheets. Basically users will upload excel workbooks containing 10-12
worksheets and we'll be using ExternalSpreadsheetCompiler to generate th
Hello all,
We're getting the following exception executing our rules in Drools 5.2.1 :
WARN: Execution of JMS message listener failed
java.lang.NoClassDefFoundError: org/drools/factmodel/traits/Thing
at
org.drools.compiler.PackageBuilder.initBuiltinTypeDeclarations(PackageBuilder.java:33
That worked. Thanks. Also in the course of running into this, i did manage to
find a better way to do it. I move the for loop into the LHS and that worked
too. I think I'll go with the latter - I think it's a better way anyway...
--
View this message in context:
http://drools.46999.n3.nabble.com/
laune,
Unfortunately, the earlier test worked when I set the dialect to "java". It
does not work when it's set to "mvel".
When the rule is written as follows :
rule "Hello World"
dialect "mvel"
when
$cur: Message()
$others : ArrayList ( size > 0 ) fro
Thanks W,
It worked after I moved opening brace to the same line as the 'for'.
But 'wow - we've spent several hours trying to resolve this on our own. And
we did not want to post before we confirmed that we've taking care of all
the obvious..
But seriously - someone is advocating that MVEL use
Hi,
I have a situation where I need to iterate over an ArrayList in the RHS of a
rule. The ArrayList is created in the LHS of the rule as follows :
rule "Hello World"
dialect "mvel"
when
$cur: Message()
$others : ArrayList ( size > 0 ) from collect(Mess
oh - ok - My bad then - I need to read up more on how to write proper hashing
algorithm - for what ever reason, I thought that == use object reference
when comparing objects ! I guess that's not the case and that it's using the
object's hash code to compare objects.
Thanks for pointing this issue
Just ran another test, I removed the check for 'price == null' in the 'Set
Options Price' rule - so the rules now reads :
rule "Set Options price"
salience 50
when
$prod : Product ( )
$option : Option ( product == $prod )
then
Thanks for the response Wolfgang.
I am not calling ksession.fireAllRules(1). I just have
ksession.fireAllRules();
I tried inserting 2 pairs - One product with a price set and the other left
as null. The one with the null still does not fire the 'Set Options Price'
after it's price has been set by
Hello all,
For some reason I have a rule that does not fire after a Modify/Update.
I have 2 facts - Product and Option. The relationship between them is that a
'Product' can have 0 - N 'Option'(s).
Based on that, I added a 'product' field to the 'Option' object. I'm
creating and inserting my fac
Duh !!! Of course - I forgot the import statement. For some reason I thought
KnowledgeHelper would already be imported.
Thanks for your help once again W !
--
View this message in context:
http://drools-java-rules-engine.46999.n3.nabble.com/is-is-possible-to-insert-facts-into-working-memory-
Hello all,
As the title states, I need to create new facts and insert them into working
memory from a function. Is it possible to do that ? I tried to create a
function with 'KnowledgeHelper' as a parameter and my rule file failed to
compile. Then I even tried to reference 'drools' instance variab
ok ! It looks like Wolf, your idea of using 'for' in the RHS worked using
rule templates.
It's still 'java' code though. I just wish there was a cleaner way to load
facts into WM without going through java. Declaring types in rules is a very
nice feature. If there's a cleaner way to 'load' these
I was hoping to be able to give the Business Analysts an overall process to
use Drools by avoiding as much java code as possible. If there was some way
to do this, I could have just had them create different templates they would
need (based on the format of the spreadsheets they currently use) and
All,
Thanks for the quick responses.
Mantis, I did try using from [ "one","two","three" ] syntax, but it did not
work. It gave me a parser error.
Basically I need to create a spreadsheet reader that inserts values into WM
before reasoning over them. The spreadsheet that the users are currently
Hello all,
In one of my use cases, I need to insert a variable collections of facts
into working memory in order to be able to test for those values later :
So I was wondering if there's a way to do something like this
when
$vals : String() from [ "A 12345", "B 45678", "C 8695" ]
Ok - I managed to get this to work. Now the main question - I've used
ExternalSpreadsheetCompiler. This is still considered 'Experimental' per the
5.1.1 documentation ! And when I look at some history it looks like
RuleTemplates have been around since August of 2008. Is there a road map of
when Rul
Thanks for advise W -
I like your idea :
'you could insert them as facts and run simple generic rules to contrast
them to another set of facts taken from the data base'.
So if I understand you right - I should be able to create a template that
declares a type and then using a template I should b
Manstis,
You are correct. There are parameters that users will provide in the
spreadsheet that I need to validate. Actually there will be one spreadsheet.
It's going to serve 2 purposes. Provide a decision table AND also be a
container of data for a few Rule Templates. The concept is that if a pro
Hello all,
In my use case, I am planning on using decision tables to implement rules
that contain product information (product attributes - like product grade,
product style etc). I've managed to put together the spreadsheet and have
been successful in generating different set of rules (using rule
Thanks for the pointer Wolfgang. I'll change the DRL accordingly.
--
View this message in context:
http://drools-java-rules-engine.46999.n3.nabble.com/Getting-different-results-from-decision-tables-based-on-number-of-facts-all-other-fact-information-s-tp2467364p2468740.html
Sent from the Drools
Never mind. I figured it out. I had not merged the fact cell over the 2
columns that had the unit constraint. I'm good. Thanks for looking though.
--
View this message in context:
http://drools-java-rules-engine.46999.n3.nabble.com/Getting-different-results-from-decision-tables-based-on-number-o
Background :
I have an object model is as follows :
Units 1 ---> 0..N Options
where a unit (basically an item in stock), can have 0 … N Options.
Items themselves have 2 primary fields - an item type (called group - a 3
digit number that represents the category the item
Wolfgang - adding the dialect to the 'Functions' cell worked like a charm.
Edson's solution did not work without the dialect mvel. So in this case MVEL
is a must have. But then your suggestion to add the dialect next to the
cell keyed Functions worked.
Thanks again for your help.
--
View this m
Edson/Wolfgang,
Thanks to your suggestions, I've got this working the way I need it using
rules defined in a .drl file. I think I have just one hurdle left before I
start working out how to get it working through decision tables - and that
is how to specific 'mvel' dialect for decision tables.
2011/1/29 groovenarula <[hidden email]>
Edson,
I did manage to use the 'CollectSetAccumulateFunction' as a template
for the
MatchAll and have also successfully 'called' the accumulate function
from a
rule written in a .drl f
Edson,
I did manage to use the 'CollectSetAccumulateFunction' as a template for the
MatchAll and have also successfully 'called' the accumulate function from a
rule written in a .drl file. But I'm stuck at one point - how to send the
value of $param to the accumulate method ? From what I understa
/org/drools/base/accumulators/CollectSetAccumulateFunction.java
<https://github.com/droolsjbpm/droolsjbpm/blob/master/drools-core/src/main/java/org/drools/base/accumulators/CollectSetAccumulateFunction.java>
  Edson
2011/1/26 groovenarula <[hidden email]>
Thanks Wolfgang
on titled "Accumulate Functions".
>
> You could also use accumulate with all the steps in inline code, which is
> documented in the preceding section.
>
> -W
>
>
>
> On 26 January 2011 16:50, groovenarula <[hidden email]> wrote:
>
> Thanks for
Thanks for outlining the approach, Edson.
Unfortunately, I'm a newbie using drools, so I just need some clarification
on what you mean by 'matchAll is your own accumulate function with the
semantics you described.' ? Do you mean that I have to create a 'custom'
accumulate function ?
Edson, if t
Thanks for the options, Bruno and Wolfgang.
But is there a more 'generic' way to do the matches ? The problem I have is
that the # of instances that might match could vary. And I have to provide a
means for the business users to be able to provide that 'option's code'
using a decision table. Bas
Hello,
I have a fact called 'Option' :
public class Option {
private String code;
private Item item;
public String getCode() {
return code;
}
public void setCode(String optionCode) {
this.code = optionCode;
}
At an
>
> NAME
>
> CONDITION
>
> ACTION
>
>
>
> l :Line
>
>
>
>
>
> eval(!l.getPromos().contains(new Promotion("$param")))
>
> System.out.println("$param");
>
> Rule Name
>
> Number Directors
>
> Warning
>
;
> eval(!l.getPromos().contains(new Promotion("$param")))
>
> System.out.println("$param");
>
> Rule Name
>
> Number Directors
>
> Warning
>
> example1
>
> Hotbuys
>
> Hotbuys missing
>
>
> Hope that helps,
>
> Thomas
>
&g
Hello all,
Is it possible to define the follow rule in a decision table :
rule "Activate Promotion"
when
l : Line( )
not ( Promotion ( code == "HOTBUY" ) from l.promos )
then
#do some action
end
The rule above works perfectly for wha
39 matches
Mail list logo