How to write a Heuristic Knowledge in Drools Expert?
by Daniel Souza
Today I was reading the book Expert System Principle and Programming and I
noticed a view point about *Knowledge Domain*:
/"A pratical limitation of many expert systems today is lack of *casual
knowledge*. That is, the expert systems do not have an understanding of the
underlying causes and effects in a system. It's much easier to program
expert systems with *shallow knowledge* based on empirical and heuristic
knowledge than with *deep knowledge* based on the basic structures,
functions, and behaviors of objects. For example, it's much easier to
program an expert system to prescribe an aspirin for a person's headache
than to program all the underlying biochemical, physiological, anatomical,
and neurological knowledge about human body..."/ In my case bioinformatics.
/"One type of shallow knowledge is *heuristic knowledge*."/
Should I use drools planning instead just drools expert? I know that drools
planning use heuristic to score the planning problem.
Daniel Souza
--
View this message in context: http://drools.46999.n3.nabble.com/How-to-write-a-Heuristic-Knowledge-in-D...
Sent from the Drools: User forum mailing list archive at Nabble.com.
13 years, 8 months
Retriving an Object Array in the when clause of a rule.
by Amal Gupta
Hi All,
Is there a way to retrieve an object array from a Class getter in the when clause of a rule in a drl file ? I have tried a lot of things but they did not work out. The Problem is detailed below :-
The following class has a private parameter Column1 which is an Object type array.
public class EightColumnGenericClass {
private Object[] Column1;
/** Getters and Setters */
public Object[] getColumn1() {
return Column1;
}
public void setColumn1(Object[] column1) {
Column1 = column1;
}
}
Following is the method where I am creating the knowledgebase and utilizing it. I am reading a file record and splitting the columns. The columns[] array gets saved into the attribute of the class defined above.
public static void fnReadFromFile(String FilePath, String FileName){
/* Declarations and other code */
while ((str = brReadFromFile.readLine())!=null){
Columns = str.split(",");
ecgcPLC = new EightColumnGenericClass();
ecgcPLC.setColumn1(Columns);
ksession.insert(ecgcPLC);
}
ksession.fireAllRules();
}
I have to try and retrieve each cell of the Columns[] array in the entire collection and apply rules on individual cell. My drl file is given below.
rule "SourceSystemId = value"
when
c: EightColumnGenericClass()
Object[] columns: c.getColumn1();
for (Object o : columns)
{
System.out.println(o.toString());
# The condition I want here is - if (o.toString()=="1794")
}
then
#RHS Code
end
Is there a way to achieve this? Or is there something missing with my DRL file? Please assist.
Thanks in Advance,
Amal
**************** CAUTION - Disclaimer *****************
This e-mail contains PRIVILEGED AND CONFIDENTIAL INFORMATION intended solely
for the use of the addressee(s). If you are not the intended recipient, please
notify the sender by e-mail and delete the original message. Further, you are not
to copy, disclose, or distribute this e-mail or its contents to any other person and
any such actions are unlawful. This e-mail may contain viruses. Infosys has taken
every reasonable precaution to minimize this risk, but is not liable for any damage
you may sustain as a result of any virus in this e-mail. You should carry out your
own virus checks before opening the e-mail or attachment. Infosys reserves the
right to monitor and review the content of all messages sent to or from this e-mail
address. Messages sent to or from this e-mail address may be stored on the
Infosys e-mail system.
***INFOSYS******** End of Disclaimer ********INFOSYS***
13 years, 8 months
Drools & jBPM Workshops(Next Week) : June : WDC NYC
by Mark Proctor
http://blog.athico.com/2012/06/drools-jbpm-workshops-june-wdc-nyc.html
----pasted from url---
JBoss BRMS (Drools and jBPM) Workshops
Drools 5, the upstream for JBoss BRMS, is a Business Logic integration
Platform, and provides a unified and integrated platform for Rules,
Workflow and Event Processing. It's been designed from the ground up so
that each aspect is a first class citizen, with no compromises. Drools
may be easily used with jBPM, a flexible business process management suite.
Want to learn more?
Join us for one of two complimentary full day, hands-on workshop on
Drools and jBPM, where we will cover:
* The ecosystem that encompasses the Drools open source project and
the JBoss BRMS
* Benefits of rules systems, business workflows, and specific challenges
* The history of rules systems, where they are going, and the current
state of the art
* Various features of the BRMS via a hands on demo
* BPMN 2.0 and the future of Business Process Management
Be prepared to work hands-on with the tools, meet the team behind the
engine, and have your questions answered. This event will give you
unparalleled access to industry-recognized leaders in the rules community.
There are two dates to choose from:
* Tuesday, June 19 2012 in New York City
<http://app.engage.redhat.com/e/er?s=1795&lid=1384&elq=d3d6d783acbc4c7382b...>
* Thursday, June 21, 2012 (Government focus) in Washington DC
<http://app.engage.redhat.com/e/er?s=1795&lid=5482&elq=d3d6d783acbc4c7382b...>
Speakers:
Jim Tyrrell
<http://app.engage.redhat.com/e/er?s=1795&lid=5483&elq=d3d6d783acbc4c7382b...>,
Principle JBoss Solution Architect, Red Hat
Mark Proctor
<http://app.engage.redhat.com/e/er?s=1795&lid=5483&elq=d3d6d783acbc4c7382b...>,
Drools Project Lead and Founder, Red Hat
Edson Tirelli
<http://app.engage.redhat.com/e/er?s=1795&lid=5483&elq=d3d6d783acbc4c7382b...>,
Senior Software Engineer, Red Hat
Kris Verlaenen
<http://app.engage.redhat.com/e/er?s=1795&lid=5483&elq=d3d6d783acbc4c7382b...>,
jBPM Lead Engineer, Red Hat
Prakash Aradhya
<http://app.engage.redhat.com/e/er?s=1795&lid=5483&elq=d3d6d783acbc4c7382b...>,
Senior Product Manager, Red Hat
/*Attendees are responsible for bringing their own laptop to this event.
Please make sure your laptop has the ability to copy files from a USB,
which will provide the software for the hands-on sessions, and have JDK
1.6 already installed./
Register now as space is limited. We look forward to seeing you there!
13 years, 8 months
guvnor-distribution-5.4.0.Final problem
by domingo
Hi,
I have a question to the drools guvnor team....
In the guvnor-distribution binary folder contains three war files,
guvnor-5.4.0.Final-jboss-as-7.0, guvnor-5.4.0.Final-jboss-as-5.1 and
guvnor-5.4.0.Final-tomcat-6.0 respectively.
My question is
why these three specific war files?
Will it be work with other version of these app. servers?
Drools and Jboss are redhat products, than why guvnor is not supported by
all versions of jboss Apps server?
this raise lots of reliability related questions in the industry...I really
appreciate some one from the core team can answer these questions.
thanks,
-----
with kind regards,
--
View this message in context: http://drools.46999.n3.nabble.com/guvnor-distribution-5-4-0-Final-problem...
Sent from the Drools: User forum mailing list archive at Nabble.com.
13 years, 8 months
drools guvnor 5.4 final deployment error
by domingo
Hi,
I am trying to deploy drools guvnor 5.4 war into jboss5.1.0.GA apps server,
but i got the following error...
......
........
caused by: java.lang.ClassNotFoundException:
javax.validation.MessageInterpolato
$Context
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Unknown Source)
at
org.jboss.classloader.spi.base.BaseClassLoaderDomain.loadClass(BaseCl
help will be appreciated...
thanks,
-----
with kind regards,
--
View this message in context: http://drools.46999.n3.nabble.com/drools-guvnor-5-4-final-deployment-erro...
Sent from the Drools: User forum mailing list archive at Nabble.com.
13 years, 8 months
Guvnor: Dependent Enumeration loosing value
by Sandjaja, Dominik
Hi everybody,
I use the advanced, dependent enumeration concepts of the Guvnor DSL as
explained here (second part):
http://docs.jboss.org/drools/release/5.4.0.Final/drools-guvnor-docs/html
/ch04.html#d0e1887
In principle, this works fine: I get my values in the dropdown fields
just fine, e.g. when using the following DSL sentence:
[when]In the module {module:ENUM:Enums.BooleanModules} the checkbox for
the field {field:ENUM:Enums.BooleanField} is checked={module} (
{field}Visible && {field} )
When everything works, the {field} is filled, depending on the selected
value in {module}.
BUT: If I create such a rule, close it, open it again, the following DRL
is generated (given that {module} has the value MODULE:
MODULE ( Visible && )
As you can see, the value for {field} is missing at all! If I change
something somewhere else in the rule and save it, the rule is invalid
and everything breaks!
I have no idea where to look as there are no errors when saving or
loading the rules. Should I file a bug for this or am I missing
something?
Thanks
Dominik
13 years, 8 months
5.4.0.Final OSGi bundle with Apache Karaf 2.2.7
by Nicholas Hemley
Hello,
I am having troubles getting the 5.4.0.Final OSGi bundle to install/activate on Apache Karaf 2.2.7.
Note - I have already fixed the JAXB/XJC problem as discussed here:
https://issues.jboss.org/browse/JBRULES-3192
So following from this I have tried two different approaches:
a) Drop the OSGi bundle jars into Karaf deploy/ folder
b) Using Karaf Console
The latter method is discussed here:
http://drools.46999.n3.nabble.com/drools-osgi-issue-td4017799.html
The console session for (b) was as follows:
osgi:install -s wrap:mvn:com.google.protobuf/protobuf-java/2.4.1
osgi:install -s wrap:mvn:org.antlr/antlr-runtime/3.3
osgi:install -s wrap:mvn:javax.persistence/persistence-api/1.0.2
osgi:install -s mvn:org.mvel/mvel2/2.1.0.drools16
osgi:install -s wrap:mvn:com.thoughtworks.xstream/xstream/1.4.2
osgi:install -s wrap:mvn:org.drools/drools-spring/5.4.0.Final
osgi:install -s mvn:org.drools/knowledge-api/5.4.0.Final
osgi:install -s mvn:org.drools/knowledge-internal-api/5.4.0.Final
osgi:install -s mvn:org.drools/drools-core/5.4.0.Final
NullPointerException (no stack trace)
Clearly the 5.4.0.Final bundle, as is, does not work in Apache Karaf 2.2.7.
So my question is this:
Has the fix in the post above been applied to a patch that I can download, please? Or must I wait for 5.5.0.Beta1?
Otherwise, is there a previous version of Drools OSGi bundles that does work with Apache Karaf?
Many thanks for any pointers.
Cheerio,
Nic
13 years, 8 months
Check problems of conflicts in the rules
by paco
I want to detect the conflict between the rules with Drools Verifier. For
example the first condition of the second rule is present in the first rule
and the actions to perform are the same in both rules as they demonstrate in
the following case. It works very well when these rules belong to the same
drl file.
--------- fichier a.drl---------------------------
rule "a"
no-loop true
ruleflow-group "group1"
dialect "mvel"
when
A==0
then
Action1
end
rule "b"
no-loop true
ruleflow-group "group1"
dialect "mvel"
when
A==0 && B==1
then
Action1
end
The problem arises when I separated its rules and that I have to put each in
its own file
---------------- a.drl----------------
rule "a"
no-loop true
ruleflow-group "group1"
dialect "mvel"
when
A==0
then
Action1
end
------------------b.drl--------------------
rule "b"
no-loop true
ruleflow-group "group1"
dialect "mvel"
when
A==0 && B==1
then
Action1
end
I can no longer detect this problem with Drools Verifier.
Does anyone ever encountered this problem?
How can I do to write a small program to audit if this case?
--
View this message in context: http://drools.46999.n3.nabble.com/Check-problems-of-conflicts-in-the-rule...
Sent from the Drools: User forum mailing list archive at Nabble.com.
13 years, 8 months
Giving multiple range values in condition of Decision table
by pratibhapandey
Hello Team,
I have written a condition like this, see the highlighted one..
http://drools.46999.n3.nabble.com/file/n4017965/error.png
I am getting the prob when rule engine parses the range value. When I
generate a DRL out of this sheet what I get is:
rule "Rule 2"
salience 65520
when
lvgBslaData: LeverageBSLAData(((productTypeCode in ('REO' ||
(investmentGroupType == "'TRM')") && (dealLtvNbiExtDebt <= EQUITY)) &&
primaryCollateralType == "0.6")
then
lvgBslaData.setCorpLeverageName( "Hotel Equity ");
end
except of getting the below rule:
rule "Rule 2"
salience 65520
when
lvgBslaData: LeverageBSLAData(((productTypeCode in ('REO','TRM') ||
(investmentGroupType == "EQUITY") &&(dealLtvNbiExtDebt <= 0.6)) &&
primaryCollateralType == "Hotel")
then
lvgBslaData.setCorpLeverageName( "Hotel Equity ");
end
I cannot change the condition except the ordering.. Please tell me how can I
achieve this?
--
View this message in context: http://drools.46999.n3.nabble.com/Giving-multiple-range-values-in-conditi...
Sent from the Drools: User forum mailing list archive at Nabble.com.
13 years, 8 months