error while creating a pkg using brms
by Prem Kumar L
//
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-558
// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
// Any modifications to this file will be lost upon recompilation of the source schema.
// Generated on: 2008.06.23 at 11:49:08 AM IST
//
package org.domain;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlType;
/**
* <p>Java class for CreditCard complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* <complexType name="CreditCard">
* <complexContent>
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* <sequence>
* <element name="name" type="{http://www.w3.org/2001/XMLSchema}string"/>
* <element name="age" type="{http://www.w3.org/2001/XMLSchema}int"/>
* <element name="annualIncome" type="{http://www.w3.org/2001/XMLSchema}double"/>
* <element name="asset" type="{http://www.w3.org/2001/XMLSchema}double"/>
* <element name="eligibilityStatus" type="{http://www.w3.org/2001/XMLSchema}string"/>
* </sequence>
* </restriction>
* </complexContent>
* </complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "CreditCard", propOrder = {
"name",
"age",
"annualIncome",
"asset",
"eligibilityStatus"
})
public class CreditCard {
@XmlElement(required = true)
protected String name;
protected int age;
protected double annualIncome;
protected double asset;
@XmlElement(required = true)
protected String eligibilityStatus;
/**
* Gets the value of the name property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getName() {
return name;
}
/**
* Sets the value of the name property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setName(String value) {
this.name = value;
}
/**
* Gets the value of the age property.
*
*/
public int getAge() {
return age;
}
/**
* Sets the value of the age property.
*
*/
public void setAge(int value) {
this.age = value;
}
/**
* Gets the value of the annualIncome property.
*
*/
public double getAnnualIncome() {
return annualIncome;
}
/**
* Sets the value of the annualIncome property.
*
*/
public void setAnnualIncome(double value) {
this.annualIncome = value;
}
/**
* Gets the value of the asset property.
*
*/
public double getAsset() {
return asset;
}
/**
* Sets the value of the asset property.
*
*/
public void setAsset(double value) {
this.asset = value;
}
/**
* Gets the value of the eligibilityStatus property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getEligibilityStatus() {
return eligibilityStatus;
}
/**
* Sets the value of the eligibilityStatus property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setEligibilityStatus(String value) {
this.eligibilityStatus = value;
}
}
16 years, 5 months
query on "modify"
by Prem Kumar L
Hi,
I tried creating/compiling/executing the following rule using the drools
eclipse workbench:
package com.sample
import org.domain.CreditCard;
rule "Credit Eligibility"
no-loop true
when
cc : CreditCard( age > 18, annualIncome > 50000, asset> 500000 )
then
cc.setEligibilityStatus( "Eligible for credit card" );
System.out.println("Valid Credit Score ");
modify( cc );
end
I was successfully able to run the rule against my CreditCard object.
However, when I tried running it from withing my applicaiton by
embedding drools(latest, the following error occurs:
org.drools.rule.InvalidRulePackage: Rule Compilation error : [Rule
name=Credit Eligibility, agendaGroup=MAIN, salience=0, no-loop=true]
com/sample/Rule_Credit_Eligibility_0.java (13:652) : The method
modify(CreditCard) is undefined for the type Rule_Credit_Eligibility_0
at org.drools.rule.Package.checkValidity(Package.java:424)
at
org.drools.common.AbstractRuleBase.addPackage(AbstractRuleBase.java:384)
at
org.drools.jsr94.rules.admin.RuleExecutionSetImpl.<init>(RuleExecutionSetImpl.java:130)
at
org.drools.jsr94.rules.admin.LocalRuleExecutionSetProviderImpl.createRuleExecutionSet(LocalRuleExecutionSetProviderImpl.java:233)
at
org.drools.jsr94.rules.admin.LocalRuleExecutionSetProviderImpl.createRuleExecutionSet(LocalRuleExecutionSetProviderImpl.java:176)
at
org.drools.jsr94.rules.admin.LocalRuleExecutionSetProviderImpl.createRuleExecutionSet(LocalRuleExecutionSetProviderImpl.java:96)
Any pointers would be much appreciated!
Prem
16 years, 5 months
Unable to load dialect 'org.drools.rule.builder.dialect.mvel.MVELDialectConfiguration:mvel'
by Ojwang Wilson O
Hi,
I am currently having an error "RuleBaseTask failed: Unable to load
dialect
'org.drools.rule.builder.dialect.mvel.MVELDialectConfiguration:mvel'"
while trying to build drl to pkg using Ant from a DroolsTest that was
created by default in eclipse when one select new->other->Drools->Rules
Project.
Here is my build.xml
===================
<project name="Ant Drools DRL build" default="rules" basedir=".">
<property file="build.properties"/>
<property name="src.java.dir"
value="${basedir}/src/main/java"/>
<property name="rules.dir"
value="${basedir}/src/main/rules"/>
<property name="lib.dir" value="${drools.eclipse.jar}"/>
<property name="drools.main.jar" value="${drools.main.dir}"/>
<property name="drools.lib.jar" value="${drools.lib.dir}"/>
<property name="build.dir" value="${basedir}/build"/>
<!-- Classpath declaration -->
<path id="drools.classpath">
<fileset dir="${lib.dir}">
<include name="**/*.jar"/>
<include name="**/*.zip"/>
</fileset>
<fileset dir="${drools.main.jar}">
<include name="**/*.jar"/>
<include name="**/*.zip"/>
</fileset>
<fileset dir="${drools.lib.jar}">
<include name="**/*.jar"/>
<include name="**/*.zip"/>
</fileset>
</path>
<!-- Useful shortcuts -->
<patternset id="meta.files">
<include name="**/*.xml"/>
<include name="**/*.properties"/>
<include name="**/*.drl"/>
</patternset>
<!-- Clean up -->
<target name="clean" description="Clean the build directory">
<delete dir="${build.dir}"/>
<mkdir dir="${build.dir}"/>
</target>
<!-- Copy metadata to build classpath -->
<target name="copymetafiles">
<mkdir dir="${build.dir}"/>
<copy todir="${build.dir}">
<fileset dir="${src.java.dir}">
<patternset refid="meta.files"/>
</fileset>
</copy>
<copy todir="${build.dir}">
<fileset dir="${rules.dir}">
<patternset refid="meta.files"/>
</fileset>
</copy>
</target>
<!-- Compile Java source -->
<target name="compile">
<mkdir dir="${build.dir}"/>
<javac srcdir="${src.java.dir}"
destdir="${build.dir}"
classpathref="drools.classpath">
</javac>
</target>
<target name="drools.run" depends="compile, copymetafiles">
<java classname="com.sample.DroolsTest"
fork="true">
<classpath>
<pathelement path="${build.dir}" />
<fileset dir="${lib.dir}">
<include name="*.jar"/>
</fileset>
</classpath>
</java>
</target>
<taskdef name="compiler"
classname="org.drools.contrib.DroolsCompilerAntTask"
classpathref="drools.classpath" />
<!-- Compile Java source -->
<target name="rules">
<compiler
srcdir="${rules.dir}/"
tofile="${build.dir}/Samplerules.pkg"
classpathref="drools.classpath">
<include name="*.drl" />
</compiler>
</target>
</project>
===================
Thanks in advance for your professional help.
Regards
Wilson
16 years, 5 months
Eclipse plugin error: DRL-files in multiple folders?
by Tobias Abstreiter
Hi!
I have a problem using the drools Eclipse plugin.
In our project rules are located in different folders. One of it is called "global" (containing many functions, imports, ...) whereon most of the rules in the other folders depend. The package name is identical.
Running the application works fine but the Eclipse plugin reports many "... cannot be resolved"-errors when I convert the Eclipse Java project into a Drools project. I believe that the plugin has problems to find all rule files. Is that possible?
Is there a way to tell the plugin to look in multiple rule-folders?
Thanks in advance,
Tobias
__________________________________________________________________
MicroNova electronic GmbH
Tobias Abstreiter
Telekommunikation & Netzmanagment
Unterfeldring 17
D-85256 Vierkirchen
Tel.: +49 (08139) 93 00-42
Fax.: +49 (08139) 93 00-80
eMail: Tobias.Abstreiter(a)micronova.de
Web: http://www.micronova.de
Geschäftsführer: Josef W. Karl - Sitz der Gesellschaft: Jetzendorf
Registergericht: Ingolstadt - HRB-Nr.: 181 373
__________________________________________________________________
16 years, 5 months
Drools memory use issues
by Ron Kneusel
Greetings!
I'm using Drools 4 and have a simple test setup with 4 rules. If I run with a few facts (simple objects that hold a type and a floating point value only) everything works as advertised. If I bump the number of facts up to 100 it runs most of the time without changing the defaults on the virtual machine. However, if I change the number of facts to 500 and change the virtual machine memory limits to 1024 MB the engine grinds to a halt and eventually dies with an out of memory error.
What are the reasonable limits for Drools in terms of facts in the working memory and number of rules?
I will try a test with hundreds of rules today but I was very surprised, and disappointed, to see that so few facts eat so much memory. The project my company needs Drools for will likely have to run the engine on a working memory with about 100..150 facts and do so every 1 to 2 seconds. Can Drools keep up? How can performance be improved?
Thanks!
Ron
_________________________________________________________________
Introducing Live Search cashback . It's search that pays you back!
http://search.live.com/cashback/?&pkw=form=MIJAAF/publ=HMTGL/crea=introsr...
16 years, 5 months
Rule Agent Performance : BRMS or pkg file ?
by Cabou, Carl
Hi all,
I'm using Drools 4.0.7.
I use the Drools api in my application with the rule Agent as describe
in the section 9.4.4.1 of the documentation and it works fine.
Since our application is running under weblogic 8.1, we must use JBoss
for BRMS because weblogic 8.1 is not java5 compliant, but I don't want
to use multiple app servers.
So the question is : what is best for performance ? use the BRMS at
runtime (< url > property) on JBoss or use only packages files on disk
(< file > property).
Anyway I will do perf benchmarks, I'm assuming it is better with package
files but I'd like to have some feedback before...
Regards,
Carl.
16 years, 5 months
RE: Rules with Lookup Tables...
by Rahul Phadnis
Have you looked at
http://labs.jboss.com/portal/jbossrules/subversion.html
I think that page is not uptodate since at the bottom
it says "Trunk is unstable and may often not build. If
you wish to build form Subversion source the latest
tag is:
http://anonsvn.labs.jboss.com/labs/jbossrules/tags/3.0.3-GA/
"
Are n't we at 3.0.5 already?
-Rahul
--- jjdepaul(a)us.ibm.com wrote:
> Rahul -
>
> Where can I find Maven2 repository that has the
> nightly builds for Drools project?! I've looked
> around on a couple of well-known ones abut no luck
> finding anything above D3.0.5
>
> thanks,
> james
> >
> > The "from" CE (conditional expression) is not
> > available in the current released jboss rules
> version
> > (3.0.5) and you probably have to use the nightly
> build
> > to use it.
> >
> > -Rahul
> >
> >
>
>
16 years, 5 months
Re: Rule is firing on those objects for which that hasalready fired
by Alexander Claus
> I need to write some rule which will *only* fire on newly inserted data
> points in Working Memory. Does Drools support any
> such feature which will help me to achieve this ? Any suggestion, how can
> I
> achieve this efficiently?
>
> I am inserting 6 matching DataObjects into Working Memory. Rule is
> getting fired once
>
> But in subsequent rule executions after I insert 6 more matching
> DataObjects
> into Working Memory, Rule is getting fired couple of times
> How can I avoid this ?
Hi,
here:
http://downloads.jboss.com/drools/docs/4.0.7.19894.GA/html/ch06s05.html#d...
the "exists" statement is described which has almost the functionality which
you want.
Unfortunately (but intuitively) you cannot access variable bindings from
inside the "exists" body. This is intuitive, because "exists" models the
logical existential quantifier which gives true, if there exist some facts
supporting the truth of the formula !no matter, which facts that are!.
So for your purpose you have to think about, if you are really interested in
which objects trigger the rule. If so, I can imagine, that you don't want to
know only one portion of information but information about each activation.
Then the behaviour of your rule is correct.
But, I know about the problem. I faced it sometimes too. One way to a
solution would be to retract objects from the working memory, if you can
safely assume that they "have done their work". I.e. if you know, that these
objects should not cause activations of this rule again AND you know that no
other rule needs these objects, retract them in the rhs of your rule.
If other rules need the objects and you can't retract them therefore, the
only solution which I know is to mark the objects by yourself as "processed"
by the rule, e.g with your ruleID, and to test everytime in the lhs if the
object of interest is not processed... This is ugly, but it works.
Hope I could help you, but, let me know, if you have found a better
solution.
Alexander Claus
16 years, 5 months