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
14 years
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.
14 years
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.
14 years
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 ????? ?
14 years
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
>
14 years
Error running Drools Planner examples
by Anton Hughes
Hi
Im getting the following error when running the Drools Planner examples -
can someone please explain what I need to change, and where?
Exception in thread "AWT-EventQueue-0" java.lang.IllegalStateException: The
directory dataDir
(C:\jboss\Drools\drools-planner-distribution-5.4.0.Beta2\examples\sources\data\nurserostering)
does not exist. The working directory should be set to the directory that
contains the data directory. This is different in a git clone
(drools-planner/drools-planner-examples) and the release zip (examples).
at
org.drools.planner.examples.common.business.SolutionBusiness.updateDataDirs(SolutionBusiness.java:95)
at
org.drools.planner.examples.common.app.CommonApp.createSolutionBusiness(CommonApp.java:55)
at
org.drools.planner.examples.common.app.CommonApp.<init>(CommonApp.java:35)
at
org.drools.planner.examples.nurserostering.app.NurseRosteringApp.<init>(NurseRosteringApp.java:31)
at
org.drools.planner.examples.app.DroolsPlannerExamplesApp$9.actionPerformed(DroolsPlannerExamplesApp.java:111)
at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
...
Thanks, and regards,
Anton
14 years
Using Character typed properties in Drool 5.3
by Welsh, Armand
Community,
In drools 5.2 I had the following LHS"
when
BloombergColumn (columnName == "CRNCY", $cur : stringValue != null)
Country (currency == $cur, emergingMkt == 'Y' || countryCode in ("BH","HR","CZ","EE","HK","HU","IL","KR","KW","MO","OM","QA","SA","SG","SK","SI","TT"))
I am switching to Drool 5.3, and Drools Guvnor reports the following error upon validate (or compile):
[bum_code_value.currency 01] Unable to Analyse Expression emergingMkt == 'Y' || countryCode == "BH" || countryCode == "HR" || countryCode == "CZ" || countryCode == "EE" || countryCode == "HK" || countryCode == "HU" || countryCode == "IL" || countryCode == "KR" || countryCode == "KW" || countryCode == "MO" || countryCode == "OM" || countryCode == "QA" || countryCode == "SA" || countryCode == "SG" || countryCode == "SK" || countryCode == "SI" || countryCode == "TT": [Error: Comparison operation requires compatible types. Found class java.lang.Character and class java.lang.String] [Near : {... == "SK" || countryCode == "SI" || countryCode == "TT" ....}] ^ [Line: 7, Column: 28]
Looking at the emergingMkt in my data model, I see that it is defined as a Character. If I change my LHS to:
BloombergColumn (columnName == "CRNCY", $cur : stringValue != null)
Country (currency == $cur, emergingMkt == Character.valueOf('Y') || countryCode in ("BH","HR","CZ","EE","HK","HU","IL","KR","KW","MO","OM","QA","SA","SG","SK","SI","TT"))
Then the validate passes.
Was this change in behavior intentional? I don't see a reference to this change in the Drools 5.3 documentation, and this makes for a harder to read rule for our Drools analysts.
Thanks in advance,
Armand
14 years
Drools Eclipse debug views - Audit, Agenda, Working Memory, etc
by devan.vanreenen@gmail.com
Hi there,
Help needed pls.
I have read previous threads from this forum on not being able to see any
content on Drools Eclipse debug views - Audit, Agenda, Working Memory, etc
when debugging rules and still cant seem to get this working
I have tried the following suggestions
I inspect my stateless session under variables tab on eclipse debug
perpective and there is no member variable for the Working Memory to select.
I have tried suggestions around refresh issues as well.
Is there anything else I can check or do?
Thanks
Devan
--
View this message in context: http://drools.46999.n3.nabble.com/Drools-Eclipse-debug-views-Audit-Agenda...
Sent from the Drools: User forum mailing list archive at Nabble.com.
14 years
Fusion: Insert passed events
by javadude
Hi !
scenario: Event A then Event B. If there is no Event B after 5 min of A then
trigger rule.
*when
time1:(Event) from entry-point xxx
not (Event(this after[ 0,5m ] time1)) from entry-point xxx
then
...
end*
For realtime event that works fine, but in real life you have the event
coming in delayed, eg. from an interface.
Example:
Event A time: 01:00 (mm:ss) but received at 02:00
Above rule will trigger at 07:00, but the business logic would require it to
be triggered at 06:00
How do I handle this kind of requirement ?
Thanks
Sven
--
View this message in context: http://drools.46999.n3.nabble.com/Fusion-Insert-passed-events-tp3824630p3...
Sent from the Drools: User forum mailing list archive at Nabble.com.
14 years