How to Access and Execute Rules from Database
by Ashish Soni
Hi All ,
I am able to configure oracle database in drools but now i am not able to
find how can i load rules from the DB and execute them , I gone through the
documentation but not able to get much information or might be i am missing
something.
If any one can provide me a example or some pointer ,hints then it would be
helpful.
Regards,
Ashish
13 years, 4 months
About for and inheritance
by Chris Woodrow
Hi,
I recently find out a few issues using for, and I wanted to share it with
you. I made a simple exemple to illustrate my purpose.
My classes are (I did not represent accessors & constructors):
public class Cheese {
protected String name;
}
public class FrenchCheese extends Cheese{
private String smell;
}
public class Person {
private Cheese likes;
}
Here is my rule set :
package rules
rule "likes cheese"
when
$person : Person ()
Cheese( ) from $person.getLikes()
then
System.out.println("likes cheese");
end
rule "likes french cheese"
when
$person : Person ()
FrenchCheese( ) from $person.getLikes()
then
System.out.println("likes french cheese");
end
First test :
Cheese cheese = new FrenchCheese("good", "camembert");
Person person = new Person();
person.setLikes(cheese);
Output :
likes french cheese
likes cheese
Wich is expected...
Second test :
Cheese cheese = new Cheese();
Person person = new Person();
person.setLikes(cheese);
Output :
likes french cheese
likes cheese
That's the first strange thing. As far as I am concerned, rule "likes french
cheese" should not match (since a Cheese is not a FrenchCheese).
I made a change to the second rule :
rule "likes french cheese"
when
$person : Person ()
FrenchCheese( smell == "good" ) from $person.getLikes()
then
System.out.println("likes french cheese");
end
Third test :
Cheese cheese = new Cheese();
Person person = new Person();
person.setLikes(cheese);
output :
It throwed an exception : Exception in thread "main"
java.lang.ClassCastException: rules.Cheese
I am not saying the ClassCastException is not to expect in such a case but I
think I would simply expect it not to match (as far as a Cheese is not a
FrenchCheese).
Chris
13 years, 10 months
Drools 4.0, Support for multiple pattern in accumulate source pattern
by Juergen
It appears as if accumulate does support only a single pattern CE as
source pattern, e.g.:
Number() from accumulate(
Cheese(
price : price
),
sum( price )
)
Is it possible to have more than one pattern in the source pattern, e.g.:
Number() from accumulate(
Cheese(
price : price,
type : type
)
Person(
favouriteCheese == type,
age > 30
),
sum( price )
)
The same could be said for collect, but there the problem to specify
which item of a matching tuple is to be collected, but this could be
handled recreating collect via accumulate, e.g.:
Collection() from accumulate(
cheese : Cheese(
type : type
)
Person(
favouriteCheese == type,
age > 30
),
collect( cheese )
)
13 years, 11 months
Blurring the lines of jBPM and Drools
by keithnielsen
I have been researching both jBPM and Drools for sometime now and am
wondering what the future holds for jBPM. This is based on my research of
Drools 5, which is bringing what I would consider more BPM constructs into
the core engine, things such as Wait States, Human Tasks, etc. One of the
main things I don't see yet is the whole persistence and support of long
running processes. My question is will the trend with Drools continue,
eventually consuming jBPM?
I must say that my perception is that Drools is more active which makes me
wonder if I should go with Drools hoping that it builds out more BPM
features going forward.
Thanks
--
View this message in context: http://www.nabble.com/Blurring-the-lines-of-jBPM-and-Drools-tp20099731p20...
Sent from the drools - user mailing list archive at Nabble.com.
14 years, 1 month
Decision Tree input?
by Wilson O Ojwang
All,
Is there something in the works to support Decision Tree Inputs in
addition to Decision Table?
Regards
Wilson
14 years, 4 months
java.lang.NoSuchMethodError on every Action node
by Ana F Santos
Hi everyone.
I've been trying to use Drools for the past month, and sometimes I have
problems I can't guess anymore how to solve.
This time, every action I try to insert in a ruleflow, I receive a
java.lang.NoSuchMethodError. I'm even trying a really simple ruleflow with
just one simple action - like System.out.println("Test"); - and all I get
is a java.lang.NoSuchMethodError.
[
The stack trace:
java.lang.NoSuchMethodError:
br.com.pst.packages.ruleflows.Process_br_com_pst_packages_ruleflows_0.action0(Lorg/drools/spi/KnowledgeHelper;Lorg/drools/spi/ProcessContext;)V
at
br.com.pst.packages.ruleflows.Process_br_com_pst_packages_ruleflows_0Action0Invoker.execute(
Process_br_com_pst_packages_ruleflows_0Action0Invoker.java:20)
at
org.drools.workflow.instance.node.ActionNodeInstance.internalTrigger(
ActionNodeInstance.java:54)
at org.drools.workflow.instance.impl.NodeInstanceImpl.trigger(
NodeInstanceImpl.java:111)
at
org.drools.workflow.instance.impl.NodeInstanceImpl.triggerConnection(
NodeInstanceImpl.java:142)
at
org.drools.workflow.instance.impl.NodeInstanceImpl.triggerCompleted(
NodeInstanceImpl.java:128)
at
org.drools.workflow.instance.node.StartNodeInstance.triggerCompleted(
StartNodeInstance.java:49)
at
org.drools.workflow.instance.node.StartNodeInstance.internalTrigger(
StartNodeInstance.java:41)
at org.drools.workflow.instance.impl.NodeInstanceImpl.trigger(
NodeInstanceImpl.java:111)
at
org.drools.ruleflow.instance.RuleFlowProcessInstance.internalStart(
RuleFlowProcessInstance.java:16)
at org.drools.process.instance.impl.ProcessInstanceImpl.start(
ProcessInstanceImpl.java:185)
at
org.drools.workflow.instance.impl.WorkflowProcessInstanceImpl.start(
WorkflowProcessInstanceImpl.java:230)
at org.drools.common.AbstractWorkingMemory.startProcess(
AbstractWorkingMemory.java:1639)
at org.drools.common.AbstractWorkingMemory.startProcess(
AbstractWorkingMemory.java:1604)
at org.drools.impl.StatefulKnowledgeSessionImpl.startProcess(
StatefulKnowledgeSessionImpl.java:267)
at br.com.pst.packages.ServicePackages.main(
ServicePackages.java:99)
]
Actually, the beginning problem was with my project, with a process and
subprocess. The subprocess works fine, but the main process throws a
java.lang.NoSuchMethodError always on any node I put after a specific
RuleFlowGroup node. Everyting used to work before, but when I begin to
enlarge it, nothing seems to work anymore. And, as I told, I can't always
guess the exact problem as the thrown exceptions are very generic.
Hope anyone could help me!
Thanks a lot
ANA FLÁVIA FONSECA DOS SANTOS
Analista de Desenvolvimento de Software
PST Eletrônica S/A
Phone: +55 19 3787 6379
aflavia(a)pst.com.br
www.pst.com.br
www.positron.com.br
14 years, 4 months
Drools Roadmap - Planned Release 5.1 release date
by McDonald, Daniel
Hi,
I was wondering if there is a planned release date for Release 5.1?
Thank you,
Daniel McDonald
Fidelity National Information Services - Research & Development
Office phone: (972) 691-6593
Mobile phone (214) 697-8163
_____________
The information contained in this message is proprietary and/or confidential. If you are not the
intended recipient, please: (i) delete the message and all copies; (ii) do not disclose,
distribute or use the message in any manner; and (iii) notify the sender immediately. In addition,
please be aware that any message addressed to our domain is subject to archiving and review by
persons other than the intended recipient. Thank you.
_____________
14 years, 6 months
ANT Compile issues
by Bhamidi, Krishna
Hi,
I am using DROOLs 5.0.0 CR1 and use the compiler from Drools-Ant. When I attempt to execute the rules using a rule agent, I get an exception that in part reads
java.lang.NullPointerException
at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1820)
(Full stack follows this e-mail.) However, when I download the pkg file for the same ruleset from Guvnor and use it in the rule agent, it runs fine.
I use the following for building -
<taskdef name="compiler" classname="org.drools.contrib.DroolsCompilerAntTask" classpathref="compiler.classpath" />
<compiler srcdir="../${rulesDirectory}" tofile="../${buildDirectory}/${projectName}_rules.pkg"
classpath="../${buildDirectory}/${projectName}_rules.jar"
binformat="package">
<include name="*.drl" />
<include name="*.brl" />
<include name="*.xml" />
<include name="*.dslr" />
<include name="*.xls" />
</compiler>
What I should do to compile correctly?
Full Stack
java.lang.NullPointerException
at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1820)
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1719)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1305)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:348)
at org.drools.rule.DialectRuntimeRegistry.readExternal(DialectRuntimeRegistry.java:41)
at java.io.ObjectInputStream.readExternalData(ObjectInputStream.java:1755)
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1717)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1305)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:348)
at org.drools.rule.Package.readExternal(Package.java:197)
at java.io.ObjectInputStream.readExternalData(ObjectInputStream.java:1755)
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1717)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1305)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:348)
at org.drools.util.DroolsStreamUtils.streamIn(DroolsStreamUtils.java:189)
at org.drools.util.DroolsStreamUtils.streamIn(DroolsStreamUtils.java:158)
at org.drools.agent.FileScanner.readPackage(FileScanner.java:136)
at org.drools.agent.FileScanner.getChangeSet(FileScanner.java:82)
at org.drools.agent.FileScanner.loadPackageChanges(FileScanner.java:56)
at org.drools.agent.DirectoryScanner.loadPackageChanges(DirectoryScanner.java:69)
at org.drools.agent.RuleAgent.checkForChanges(RuleAgent.java:410)
at org.drools.agent.RuleAgent.refreshRuleBase(RuleAgent.java:362)
at org.drools.agent.RuleAgent.configure(RuleAgent.java:347)
at org.drools.agent.RuleAgent.init(RuleAgent.java:247)
at org.drools.agent.RuleAgent.newRuleAgent(RuleAgent.java:187)
at org.drools.agent.RuleAgent.newRuleAgent(RuleAgent.java:147)
14 years, 6 months