Delivery reports about your e-mail
by Mail Administrator
Dear user rules-users(a)lists.jboss.org, administration of lists.jboss.org would like to let you know the following:
We have received reports that your email account has been used to send a huge amount of spam during this week.
Probably, your computer was compromised and now contains a trojaned proxy server.
We recommend that you follow instructions in order to keep your computer safe.
Best wishes,
The lists.jboss.org team.
16 years, 2 months
null checking
by samd
How do I evaluate null conditions in the following case for example?
seller: ( seller.cheese != null && seller.active == true )
cheese: ( cheese.type == "chedder" ) from seller.cheese
In the above example seller.cheese is null but seller is used in the second
part of the rule since we can't evaluate facts for null for some reason how
do you check for a null condition.
--
View this message in context: http://www.nabble.com/null-checking-tp20015953p20015953.html
Sent from the drools - user mailing list archive at Nabble.com.
16 years, 2 months
Eclipse plug-in and peculiar problem with import statements
by Beck, Eivind
I’m experiencing a peculiar problem with import statements using the Drools Eclipse plug-in.
When importing domain objects from a specific package, the editor gives an error for all rule statements within the rule file, saying that the import can not be resolved.
The classes that give this problem have the fully qualified class name pattern: no.vps.dom.fund.*.* - example: no.vps.dom.fund.fund.SalesPerson
The error message in the Eclipse editor says: “The import no.vps.dom.fund cannot be resolved.
The problem is definitely not errors in the package names, as using the fully qualified class names within the rules works just fine. Also – using the import statements works fine within the rule engine, even if the Eclipse editor gives compilation errors.
I’ve tried to do some changes to the package name, and changing a single character in any of the first four element of the fully qualified class name solves the problem – example: so.vps.dom.fund.fund.SalesPerson works fine.
Unfortunately, we’re not allowed to change the package names for the domain objects – so that not an option. I’ve tried to figure out if there is some kind of conflict between the package name and the list of reserved Drools keywords, but I’m not able to see that “no.vps.dom.fund” can possibly match any of the keywords.
Currently the only options I see are:
1) Ignoring the editors errors. This is extremely annoying as it seems like we have a lot of problems, and it is easy to overlook actual problems in-between all the “red dots”….
2) Using fully qualified class names within the rules for the domain objects within no.vps.dom.fund.* - which is also a bit cumbersome and annoying
If anybody has some suggestions to workarounds, or something that can be “tweaked within the Eclipse plug-in” this will be much appreciated.
For the reference we’re using:
- Eclipse version 3.3.1.1
- Drools 4.0.7-eclipse-3.3
- Java Runtime Environment 1.6.0_07
- Windows XP Professional
- eivind -
________________________________
Capgemini is a trading name used by the Capgemini Group of companies which includes Capgemini Norge AS, a company registered in Norway (number 943574537) whose registered office is at Hoffsveien 1 D - Pb. 475, Skøyen – 0214 Oslo.
This message contains information that may be privileged or confidential and is the property of the Capgemini Group. It is
intended only for the person to whom it is addressed. If you are not the intended recipient, you are not authorized to
read, print, retain, copy, disseminate, distribute, or use this message or any part thereof. If you receive this message
in error, please notify the sender immediately and delete all copies of this message.
16 years, 2 months
Drools indexing
by Senlin Liang
Hi all,
I got one question: How does drools index the objects in memory? Does
it use hashing index, based on what? Or drools uses adaptive indexing?
Thanks a lot,
Senlin
16 years, 2 months
ClassLoader Problem
by Yann Massard
Hi,
I am using version 4.0.7 of Drools.
I am trying to load facts with a particular ClassLoader and compiling
the rules using the same ClassLoader:
------
Reader source = new FileReader("plugin/Sample.drl");
ClassLoader pluginClassLoader = new PluginClassLoader();
Thread.currentThread().setContextClassLoader( pluginClassLoader );
PackageBuilder builder = new PackageBuilder(new
PackageBuilderConfiguration(pluginClassLoader));
builder.addPackageFromDrl(source);
Package pkg = builder.getPackage();
RuleBase ruleBase = RuleBaseFactory.newRuleBase();
ruleBase.addPackage(pkg);
------
This works fine for usage of the fact types in the LHS of rules and for
field extraction.
But when I add a method invocation or an update statement on a fact to
the RHS of a rule I get a rule compilation error:
-------
org.drools.rule.InvalidRulePackage: Rule Compilation error : [Rule
name=Hello World, agendaGroup=MAIN, salience=0, no-loop=false]
com/sample/Rule_Hello_World_0.java (6:267) : plugin.Message cannot be
resolved to a type
-------
I have reduced the problem to a minimal complexity (see attachments).
Any ideas?
By the way: do I really need to set both the ClassLoader in the
PackageBuilderConfiguration AND the ContextClassLoader (as described in
http://blog.athico.com/2006/12/dynamically-generated-class-beans-as.html)?
Thanks in advance!
Best regards
Yann Massard
package com.sample
import plugin.*; // change to plugin.Message and it won't work!
rule "Hello World"
when
m : Message( status == Message.HELLO, message : message )
then
System.out.println( message );
// NONE OF THE FOLLOWING WORKS:
m.setMessage( "Goodbye cruel world" );
m.setStatus( Message.GOODBYE );
update( m );
end
rule "GoodBye"
no-loop true
when
m : Message( status == Message.GOODBYE, message : message )
then
System.out.println( message );
// NONE OF THE FOLLOWING WORKS:
m.setMessage( message );
end
16 years, 2 months
RHS start ruleflow not executing associated rules
by djouki
env: fedora5, eclipse3.3, drools4.0.7. jdk1.5
I've created a ruleflow hierarchy where the execution of a rule associated
with one ruleflow starts a second ruleflow.
rule "Main - Entry"
ruleflow-group "checkData"
when
exists Root(itemReq:itemRequest)
then
logger.debug("Main - Entry");
System.out.println("Main - Entry");
drools.getWorkingMemory().startProcess("com.it.checkData");
end
At issue, the rules within the second ruleflow, though activated, are not
being executed. The audit view shows the secondary ruleflow start and stop
without the interim execution of an activated rule within it. The contained
rules are valid and should fire (tried empty when clause). Attribute-wise,
all rules are similar to the one shown above; that is, the only attribute
set is ruleflow-group, with the occasional salience.
In an effort to resolve this issue, I tried calling the ruleflow via a
subprocess node, but it gave the same result.
Any assitance would be appreicated.
http://www.nabble.com/file/p19804474/rule.log rule.log
--
View this message in context: http://www.nabble.com/RHS-start-ruleflow-not-executing-associated-rules-t...
Sent from the drools - user mailing list archive at Nabble.com.
16 years, 2 months
ClassLoader Problem
by Yann Massard
Hi,
I am using version 4.0.7 of Drools.
I am trying to load facts with a particular ClassLoader and compiling
the rules using the same ClassLoader:
------
Reader source = new FileReader("plugin/Sample.drl");
ClassLoader pluginClassLoader = new PluginClassLoader();
Thread.currentThread().setContextClassLoader( pluginClassLoader );
PackageBuilder builder = new PackageBuilder(new
PackageBuilderConfiguration(pluginClassLoader));
builder.addPackageFromDrl(source);
Package pkg = builder.getPackage();
RuleBase ruleBase = RuleBaseFactory.newRuleBase();
ruleBase.addPackage(pkg);
------
This works fine for usage of the fact types in the LHS of rules and for
field extraction.
But when I add a method invocation or an update statement on a fact to
the RHS of a rule I get a rule compilation error:
-------
org.drools.rule.InvalidRulePackage: Rule Compilation error : [Rule
name=Hello World, agendaGroup=MAIN, salience=0, no-loop=false]
com/sample/Rule_Hello_World_0.java (6:267) : plugin.Message cannot be
resolved to a type
-------
I have reduced the problem to a minimal complexity (see attachments).
Any ideas?
By the way: do I really need to set both the ClassLoader in the
PackageBuilderConfiguration AND the ContextClassLoader (as described in
http://blog.athico.com/2006/12/dynamically-generated-class-beans-as.html)?
Thanks in advance!
Best regards
Yann Massard
package com.sample
import plugin.*; // change to plugin.Message and it won't work!
rule "Hello World"
when
m : Message( status == Message.HELLO, message : message )
then
System.out.println( message );
// NONE OF THE FOLLOWING WORKS:
m.setMessage( "Goodbye cruel world" );
m.setStatus( Message.GOODBYE );
update( m );
end
rule "GoodBye"
no-loop true
when
m : Message( status == Message.GOODBYE, message : message )
then
System.out.println( message );
// NONE OF THE FOLLOWING WORKS:
m.setMessage( message );
end
16 years, 2 months
Question about Object.equals and modifyRetract/Insert
by Michal Bali
Hello,
Let's say we have a simple BeanA with one property that is part of
equal/hashCode method e.g.:
----------------------------------------
public class BeanA {
int someProperty;
public int getSomeProperty() {
return someProperty;
}
public void setSomeProperty(int someProperty) {
this.someProperty = someProperty;
}
@Override
public boolean equals(final Object other) {
if (this == other)
return true;
if (!(other instanceof BeanA))
return false;
BeanA castOther = (BeanA) other;
return new EqualsBuilder().append(someProperty,
castOther.someProperty).isEquals();
}
@Override
public int hashCode() {
return new HashCodeBuilder(228431015, 1383549405).append(
someProperty).toHashCode();
}
}
------------------------------------
This bean is inserted into the working memory. Is it something wrong with
doing?:
wm.modifyRetract(beanA);
beanA.setSomeProperty(22); //this is changing the object equality key
wm.modifyInsert(beanAHandle, beanA);
I know that simple update is not allowed:
beanA.SetSomeProperty(22);
update(beanAHandle, beanA); //this is wrong
I guess there is no difference if this code is outside the rule engine or
inside (e.g. in a rule consequence).
Thank you,
Best Regards,
Michal
16 years, 2 months