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.
12 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.
12 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.
12 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
12 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
12 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.
12 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.
12 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 ????? ?
12 years, 9 months
Re: [rules-users] rules-users Digest
by Kumar, Ravendra
Hello All,
I am frustrated with error: 'Unable to load dialect 'org.drools.rule.builder.dialect.mvel.MVELDialectConfiguration:mvel:org.drools.rule.builder.dialect.mvel.MVELDialectConfiguration' xxx.drl
This is generated by eclipse drools plugin in problem view as a error, it would be helpful if someone help me out. I am using following artifacts
1. eclipse ide: Indigo(3.7)
2. eclipse drools plugin: 5.2.final
4. drools runtime 5.2.final (generated in eclipse)
Thanks,
Ravi
-----Original Message-----
From: rules-users-bounces(a)lists.jboss.org [mailto:rules-users-bounces@lists.jboss.org] On Behalf Of rules-users-request(a)lists.jboss.org
Sent: 08 March 2012 11:08 AM
To: rules-users(a)lists.jboss.org
Subject: rules-users Digest, Vol 64, Issue 21
Send rules-users mailing list submissions to
rules-users(a)lists.jboss.org
To subscribe or unsubscribe via the World Wide Web, visit
https://lists.jboss.org/mailman/listinfo/rules-users
or, via email, send a message with subject or body 'help' to
rules-users-request(a)lists.jboss.org
You can reach the person managing the list at
rules-users-owner(a)lists.jboss.org
When replying, please edit your Subject line so it is more specific than "Re: Contents of rules-users digest..."
Today's Topics:
1. how to invoke java method with variable arguments from drl
file (womuji)
2. Re: how to invoke java method with variable arguments from
drl file (Matteo Cusmai)
3. Simple question about String comparison in Drool (shawn)
4. Re: Simple question about String comparison in Drool
(Mauricio Salatino)
5. Re: Simple question about String comparison in Drool (shawn)
6. Persistence in fireUntilHalt() loop (Alberto R. Galdo)
7. Re: how to invoke java method with variable arguments from
drl file (Wolfgang Laun)
----------------------------------------------------------------------
Message: 1
Date: Wed, 7 Mar 2012 09:09:49 -0800 (PST)
From: womuji <cmregister(a)gmail.com>
Subject: [rules-users] how to invoke java method with variable
arguments from drl file
To: rules-users(a)lists.jboss.org
Message-ID: <1331140189049-3807314.post(a)n3.nabble.com>
Content-Type: text/plain; charset=us-ascii
We are upgrading Drools from 5.1 to 5.3, and running into some issue when invoking a Java method with String variable arguments:
methodA(String... params)
how do we invoke this in a drl file? We used to call it in 5.1 as:
objA.methodA({"string1"});
and it works fine. Now in 5.3, it complains that
"unable to resolve method using strict-mode:
objA.methodA([Ljava.lang.Object;)]"
If we tried objA.methodA(new String[]{"string1"}); it complains that "unable to resolve method using strict-mode:
objA.methodA([Ljava.lang.String;)]"
It passes the rule loading if we change to :
objA.methodA("string1");
but when actually running the rule, we are getting error saying " unable to resolve method methodA(java.lang.String)"
--
View this message in context: http://drools.46999.n3.nabble.com/how-to-invoke-java-method-with-variable...
Sent from the Drools: User forum mailing list archive at Nabble.com.
------------------------------
Message: 2
Date: Wed, 7 Mar 2012 21:41:56 +0100
From: Matteo Cusmai <cusmaimatteo(a)gmail.com>
Subject: Re: [rules-users] how to invoke java method with variable
arguments from drl file
To: Rules Users List <rules-users(a)lists.jboss.org>
Message-ID:
<CABd_zP_kqpoRUCaDvWLcXr7Q-4uQ9JrOdyH82wGy3=GVPioW3Q(a)mail.gmail.com>
Content-Type: text/plain; charset="iso-8859-1"
>From my experience, if you want call a method from then clause, it has
>to
be static method.
Bye bye,
Matteo Cusmai
Il giorno 07/mar/2012 18:10, "womuji" <cmregister(a)gmail.com> ha scritto:
> We are upgrading Drools from 5.1 to 5.3, and running into some issue
> when invoking a Java method with String variable arguments:
>
> methodA(String... params)
>
> how do we invoke this in a drl file? We used to call it in 5.1 as:
>
> objA.methodA({"string1"});
>
> and it works fine. Now in 5.3, it complains that
>
> "unable to resolve method using strict-mode:
> objA.methodA([Ljava.lang.Object;)]"
>
> If we tried objA.methodA(new String[]{"string1"}); it complains that
> "unable to resolve method using strict-mode:
> objA.methodA([Ljava.lang.String;)]"
>
> It passes the rule loading if we change to :
>
> objA.methodA("string1");
>
> but when actually running the rule, we are getting error saying "
> unable to resolve method methodA(java.lang.String)"
>
>
> --
> View this message in context:
> http://drools.46999.n3.nabble.com/how-to-invoke-java-method-with-varia
> ble-arguments-from-drl-file-tp3807314p3807314.html
> 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
>
12 years, 9 months