Re: [rules-users] Drools silently fails when I screw up
by ge0ffrey
barnesjd wrote
>
> Hi everyone. I'm new to Drools (using 5.2). I'm using it in Grails
> (2.0.1) with the drools-gorm plugin (0.5.6) (warning: Grails is also new
> for me). I've noticed that whenever I do something that is perhaps
> syntactically invalid, my rules simply don't fire. Given that I'm new to
> Drools, it would be nice if I could actually know what mistake I made.
>
> Are there some options I can use that will make Drools more vocal about my
> mistakes?
>
> Thanks!
> Joe
>
use knowledgebase.hasErrors()
--
View this message in context: http://drools.46999.n3.nabble.com/Drools-silently-fails-when-I-screw-up-t...
Sent from the Drools: User forum mailing list archive at Nabble.com.
13 years, 9 months
Doubt when modifying facts on an action
by Zeta
Hi all,
my spreedsheet received 4 facts. I need all of them to check conditions but
not all of them are used in all rules. There are some rules that modify a
fact which is not used in any of the conditions and thus, it is not
"declared" on the left side of the rule.
Let me show you an example:
CONDITION CONDITION ACTION
Customer c Tariff t
name value
customer.setOffer($param)
RULE1 "pepe" 5 "lot of
offers"
RULE2 100 "lot of
offers"
When I try to compile this, I get a compilation error:
[ERROR] | 2012-03-14 17:21:30,238 |
es....ruleengine.impl.RuleEngineUpgradeImpl[RuleEngineUpgradeImpl.java:117]
| Rule Compilation error customer cannot be resolved
customer cannot be resolved
Any suggestion please?
Thanks,
Zoraida.-
--
View this message in context: http://drools.46999.n3.nabble.com/Doubt-when-modifying-facts-on-an-action...
Sent from the Drools: User forum mailing list archive at Nabble.com.
13 years, 9 months
Knowing which constraints are broken for final best solution in drools-planner
by maraoz
Hi! I'm new to this forum so... my name is Manuel and I'm using drools
planner to solve an exam scheduling problem :)
I need to analyze which constraints are broken while the algorithm is
running and when the solver finishes also. Geoffrey pointed me to the
examples, where that is done.
I copied the getScoreDetailList() idea from that example, and it works
perfectly fine for when the algorithm is running (constraints are found and
I can inspect them). The basic idea is that this method obtains the working
memory and obtains from it the objects of type ConstraintOccurrence.
The thing is, when the solver finishes and I call this method, it returns no
constraints, even though I know by the score that some constraints are still
broken. Am I doing something wrong? Or is this the expected behaviour? It
seems as if working memory erases the ConstraintOccurrences when the solver
finishes, but I don't really know. In that case, how can I obtain the
constraints broken for the final solution?
Hope I made myself clear! Thanks!
--
View this message in context: http://drools.46999.n3.nabble.com/Knowing-which-constraints-are-broken-fo...
Sent from the Drools: User forum mailing list archive at Nabble.com.
13 years, 9 months
Create a deep copy of KnowledgeAgent
by srinivasasanda
Hi One and All,
To over come from
Knowledge agent rebuilding knowledge base with scanner/notifier does not
work with declared fact caused
java.lang.ClassCastException when change rule condition and declarative
facts/events are used
1. I had a method which creates and loads the knowledge Agent.
2. I had a another method to execute rules which uses step 1 knowledge agent
(work on infinite loop)
3. Using knowledge Agent Event listener for method afterChangeSetApplied()
again i newly create and load knowledge agent.
4. while loading again got same error.
Note: Can u please help me to create deep copy of knowledge agent which
does not have references, i.e when i update rules the changes show not it
should not be affected it should run with old copy.
using java object clone method i can create deep copy but clone is not
available for Knowledge agent.
Thanks & Regards
Srinivasa sanda
--
View this message in context: http://drools.46999.n3.nabble.com/Create-a-deep-copy-of-KnowledgeAgent-tp...
Sent from the Drools: User forum mailing list archive at Nabble.com.
13 years, 9 months
Metadata in Guvnor-created rules
by Stephen Masters
Hi folks,
I'm curious about what metadata should be on a rule when created in Guvnor. I was assuming that any of the metadata fields shown under the "Attributes" tab should be available as metadata items when the rule gets activated. i.e. Title, categories, Created date, etc...
However, when I call event.getActivation().getRule().getMetaData() on an AfterActivationFiredEvent, the map returned is completely empty.
Or is the "metadata" for a rule in Guvnor not the same thing? I was rather hoping to be able to take note of the categories of each rule that fires.
fyi ... I'm using 5.3.0.Final.
Thanks for any assistance you can provide.
Steve
13 years, 9 months
Planner - scoring with Java (not DRL)
by David Erickson
Hi I saw the JIRA issue on this topic here:
https://issues.jboss.org/browse/JBRULES-3367
I'm wondering if any work has been done to enable this yet, or if not if
this is something that could trivially be done? I have some very
complicated domain logic to determine a score and shudder to consider
porting this to a language I know nothing about (DRL). I'm also under
significant time pressure, but would love to use Planner for some SA and
TS runs. Any help or pointers here would be greatly appreciated. For a
first run I'd be happy with completely recomputing the score at each
step, but as an optimization would obviously want to do incremental
where possible.
Thanks!
David
13 years, 9 months
Exception in thread "main" java.lang.ClassCastException:
by srinivasasanda
Hi One and All,
I used resource scanner in my program to update changes automatically.
Every thing works fine.
I had one method Method1 to create knowledge base.
I had another method Method2 :
with an infinite loop where i had a set of facts insert into in
command list, and ksession.execute.
Now i tested the application whether the changes are applying or not :
After adding or modifying rule ,I validate and build package.
Now from infinite loop i got an error at line
ksession.execute(CommandFactory.newBatchExecution(cmds));
Exception in thread "main" java.lang.ClassCastException:
pricing.specification cannot be cast to pricing.specification
at
org.drools.base.pricing.specification26362458$getSmsusage.getValue(Unknown
Source)
at
org.drools.base.extractors.BaseObjectClassFieldReader.isNullValue(BaseObjectClassFieldReader.java:179)
at org.drools.base.ClassFieldReader.isNullValue(ClassFieldReader.java:179)
at
org.drools.reteoo.CompositeObjectSinkAdapter$HashKey.setValue(CompositeObjectSinkAdapter.java:606)
at
org.drools.reteoo.CompositeObjectSinkAdapter$HashKey.<init>(CompositeObjectSinkAdapter.java:568)
at
org.drools.reteoo.CompositeObjectSinkAdapter.propagateAssertObject(CompositeObjectSinkAdapter.java:362)
at org.drools.reteoo.ObjectTypeNode.assertObject(ObjectTypeNode.java:215)
at org.drools.reteoo.EntryPointNode.assertObject(EntryPointNode.java:244)
at org.drools.common.NamedEntryPoint.insert(NamedEntryPoint.java:330)
at org.drools.common.NamedEntryPoint.insert(NamedEntryPoint.java:291)
at
org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:886)
at
org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:845)
at
org.drools.impl.StatefulKnowledgeSessionImpl.insert(StatefulKnowledgeSessionImpl.java:255)
at
org.drools.command.runtime.rule.InsertObjectCommand.execute(InsertObjectCommand.java:84)
at
org.drools.command.runtime.rule.InsertObjectCommand.execute(InsertObjectCommand.java:38)
at
org.drools.command.runtime.BatchExecutionCommandImpl.execute(BatchExecutionCommandImpl.java:155)
at
org.drools.command.runtime.BatchExecutionCommandImpl.execute(BatchExecutionCommandImpl.java:76)
at
org.drools.impl.StatelessKnowledgeSessionImpl.execute(StatelessKnowledgeSessionImpl.java:264)
at
net.treetechnologies.bss.ruleengine.PricingRules.evaluatePriceRules(PricingRules.java:159)
at net.treetechnologies.bss.ruleengine.RunRule.price(RunRule.java:184)
at net.treetechnologies.bss.ruleengine.RunRule.main(RunRule.java:50)
Thanks and regards
Srinivasa sanda
--
View this message in context: http://drools.46999.n3.nabble.com/Exception-in-thread-main-java-lang-Clas...
Sent from the Drools: User forum mailing list archive at Nabble.com.
13 years, 9 months
Re: [rules-users] Drools Planner data / input file creation
by ge0ffrey
hartnellg wrote
>
> Thanks for the suggestions for reading from Excel files.
> I've used poi previously, and it will be worth having a look at jexcelapi.
>
> As far as the text files in the input directory, it's about how best to
> create new ones.
> For example where I have different shifts, unwanted patterns etc to the
> examples input files
> In particular getting the sequence numbers right.
> I'm doing this manually, but it is time consuming and error prone.
> How were these originally created.
>
> Thanks for reading and any help
>
the files are from the inrc competion who ectracted them manually from a
real hospital
--
View this message in context: http://drools.46999.n3.nabble.com/Drools-Planner-data-input-file-creation...
Sent from the Drools: User forum mailing list archive at Nabble.com.
13 years, 9 months
checking string property for key-words
by Frank Langelage
Hello,
I'm working on module checking and processing incoming mails.
I'd like to use drools expert to check the mails and determine the
target folder for the further processing.
So one of the first things is to check the subject of mail for keywords.
I'm using decision tables.
The first shot was to use regular expressions for this.
CONDITION ACTION
javax.mail.Message
subject matches "$1" insert(new String("$1"));
.* [Ss]pam .* Spam
.* Order .* Orders/inbox
.* Activity .* Workflow/inbox
This works so far, but I'm not totally happy with this regular expressions.
I'd prefer to see only the key-word in the cells.
CONDITION ACTION
javax.mail.Message
??????????? insert(new String("$1"));
spam Spam
Spam Spam
Order Orders/inbox
Activity Workflow/inbox
But what to fill in for the ????? ?
13 years, 9 months