Help! Activations firing out of salience order
by Swindells, Thomas
In our project we have been experiencing a large number of intermittent unit test failures when we are testing our rules (on drools 5.1.1).
After a lot of debugging, examining our rules for logic errors, experimenting and generally scratching our head trying to work out what is wrong, we have noticed that sometimes (but very intermittently) activations are firing in the wrong order.
In our rulebase we have two rules, Rule A salience 80 and Rule B salience 70. Whilst debugging we made Rule A and B are identical other than rule B having some additional constraints on the end.
Dumping out the agenda events we have observed the following actions occurring:
BEFORE_FIRED rule X
CREATED_ACTIVATION Rule A
CREATED_ACTIVATION Rule B
AFTER_FIRED rule X
... (no references to either rule/activation)
BEFORE_FIRED Rule B
CANCELLED Rule A
AFTER_FIRED Rule B
How can Rule B be firing before Rule A when both activations exist?
Does anybody know of any bugs in 5.1.1 that may be causing this?
We have a branch of code on 5.3 and that also has had intermittent unit test failures, we've not had chance to examine whether this is the same pattern or just a different logic issue.
Please help,
Thomas
________________________________
**************************************************************************************
This message is confidential and intended only for the addressee. If you have received this message in error, please immediately notify the postmaster(a)nds.com and delete it from your system as well as any copies. The content of e-mails as well as traffic data may be monitored by NDS for employment and security purposes. To protect the environment please do not print this e-mail unless necessary.
NDS Limited. Registered Office: One London Road, Staines, Middlesex, TW18 4EX, United Kingdom. A company registered in England and Wales. Registered no. 3080780. VAT no. GB 603 8808 40-00
**************************************************************************************
13 years, 2 months
Drools Guvnor -- Not seeing Model Correctly
by johnz
I'm new to Drools. Want to play with Guvnor to see if it will be applicable
for my application.
I have Guvnor running thru Eclipse/Jboss. I can get into Guvnor and create
categories and packages.
I create a real simple domain model (see below). I then upload the jar file
to create a model in Guvnor.
After uploading i don't see anything appear on the model tab. i was
expecting to see the classes and attributes. when i try creating a new rule
using the model i only see the class, but don't see any of the attributes.
what am i doing wrong?
here is the code for the domain model
public class Driver {
private String name;
private int age;
private Vehicle car;
public Driver() {}
public Driver(String name, int age, Vehicle car) {
this.name = name;
this.age = age;
this.car = car;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public int getAge() {
return age;
}
public void setAge(int age) {
this.age = age;
}
public Vehicle getCar() {
return car;
}
public void setCar(Vehicle car) {
this.car = car;
}
}
public class Vehicle {
private Long id;
private String make;
private String model;
private String VIN;
private String damageType;
public Vehicle()
{
}
public Vehicle(Long id, String make, String model, String VIN, String
damageType)
{
this.id = id;
this.make = make;
this.model = model;
this.VIN = VIN;
this.damageType = damageType;
}
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getMake() {
return make;
}
public void setMake(String make) {
this.make = make;
}
public String getModel() {
return model;
}
public void setModel(String model) {
this.model = model;
}
public String getVIN() {
return VIN;
}
public void setVIN(String vIN) {
VIN = vIN;
}
public String getDamageType() {
return damageType;
}
public void setDamageType(String damageType) {
this.damageType = damageType;
}
}
--
View this message in context: http://drools.46999.n3.nabble.com/Drools-Guvnor-Not-seeing-Model-Correctl...
Sent from the Drools: User forum mailing list archive at Nabble.com.
13 years, 2 months
[planner] The presumed score is corrupted
by Guilherme Kunigami
Hi,
I've implemented a very simple application using drools planner consisting
of a bunch of activities. My rule file is very simple too and just counts
the number of activities not assigned. When I run Solver.solve(), I get the
following error message:
Exception in thread "AWT-EventQueue-0" java.lang.IllegalStateException: The
presumedScore (-10hard/0soft) is corrupted because it is not the realScore
(0hard/0soft).
Presumed workingMemory:
Score rule (remainingActivitiesCount) has count (1) and weight total (11).
Real workingMemory:
Score rule (remainingActivitiesCount) has count (1) and weight total (0).
I've tracked down this message and found this piece of code
@DefaultLocalSearchSolver.solveImplementation():
// there is no need to recalculate the score, but we still need to set it
localSearchSolverScope.getWorkingSolution().setScore(localSearchStepScope.getScore());
if (assertStepScoreIsUncorrupted) {
localSearchSolverScope.assertWorkingScore(localSearchStepScope.getScore());
}
It seems that the working score is never updated along the algorithm, but
the score in the working memory changes. Thus, when we use the DEBUG
environment, assertStepScoreIsUncorrupted is turned on and the assertion
fails.
Should the score be updated or am I using the library incorrectly?
Thanks,
13 years, 2 months
[planner] Problem setting configuration file
by Guilherme Kunigami
Hi,
I'm trying to load a configuration file (namely SolverConf.xml) into
XmlSolver with the code below:
XmlSolverConfigurer configurer = new XmlSolverConfigurer();
configurer.configure(SOLVER_CONFIG);
Solver solver = configurer.buildSolver();
If I bundle SolverConf.xml file with the application .jar file, then using
SOLVER_CONFIG as /path/to/xml/file/SolverConf.xml works fine.
But I want to use SolverConf.xml outside the .jar, so I can easiliy edit it,
but I don't know what path should I pass to it.
I know it's a Java related question, but I was wondering if anyone had a
similar problem when configuring drools planner. (I've asked on
stackoverflow, but none of the answers worked for me:
http://stackoverflow.com/questions/7718807/can-getresourceasstream-find-f...
)
(Supposing my .jar is in /some/path and the SolverConf.xml will be on
/some/path/conf for example)
Thanks,
13 years, 2 months
Fusion appears to be working properly, but...
by slyfox
It seems like I have fusion working correctly, yet the rules are not firing.
I have a quote object
class Quote {
private String symbol;
private double bid;
private double ask;
//eclipse generated getters and setter
}
in my drl I have the following:
import path.to.quote;
declare entry-point "Incoming Quotes"
@doc ("incoming quotes")
end
declare Quote
@role (event)
//@expires(2s)
end
rule "show something"
when
FXQuote(symbol == "EUR/USD", s:symbol) from entry-point "Incoming Quotes"
then
System.out.println("euro quote");
end
in my code I am inserting manually:
quoteStream = ksession.getWorkingMemoryEntryPoint("Incoming Quotes");
...
quoteStream.insert(quote);
I have verified I am getting quote objects with symbol == "EUR/USD" yet the
rule is not firing
I only say that it *appears* that I have the stream set up properly because
everything compiles and runs and in my log file I see the incoming quotes:
<org.drools.audit.event.ObjectLogEvent>
<type>1</type>
<factId>6</factId>
<objectToString>com.trendfx.fxlib.FXQuote@103ec0d</objectToString>
</org.drools.audit.event.ObjectLogEvent>
<org.drools.audit.event.ObjectLogEvent>
<type>3</type>
<factId>2</factId>
<objectToString>com.trendfx.fxlib.FXQuote@145f918</objectToString>
</org.drools.audit.event.ObjectLogEvent>
<org.drools.audit.event.ObjectLogEvent>
<type>3</type>
<factId>3</factId>
<objectToString>com.trendfx.fxlib.FXQuote@184843c</objectToString>
</org.drools.audit.event.ObjectLogEvent>
<org.drools.audit.event.ObjectLogEvent>
<type>3</type>
<factId>5</factId>
<objectToString>com.trendfx.fxlib.FXQuote@1912b66</objectToString>
</org.drools.audit.event.ObjectLogEvent>
etc..
simple rule but no output, tried debugging but since I can only add
breakpoints to RHS this doesnt really help me
Thanks,
Bobby
--
View this message in context: http://drools.46999.n3.nabble.com/Fusion-appears-to-be-working-properly-b...
Sent from the Drools: User forum mailing list archive at Nabble.com.
13 years, 2 months
Fwd: Ocassional Refresh of Knowledgeagent (Only If There is any Change)
by Michael Anstis
Open for comment.
---------- Forwarded message ----------
From: <ayon.chakraborty(a)genworth.com>
Date: 14 October 2011 12:43
Subject: Ocassional Refresh of Knowledgeagent (Only If There is any Change)
Hi Michael,
I am using ResourceChangeScannerService to scan the resources in our
application. But it seems that after every specified interval we get a new
KnowledgeAgent(whether it is changed or not). Is there any way where I can
check using some Listener only if there is any change or the package is
built in guvnor only then we can get a new Knowledgeagent.
Thanks,
Ayon
13 years, 2 months
Regession in 5.3.0-CR1: .drl file ending in a single line comment w/o EOL not accepted
by Swindells, Thomas
While in the process of upgrading to the latest version of drools I've just been hit by a regression where .drl file ending in a single line comment w/o EOL not accepted (https://issues.jboss.org/browse/JBRULES-2041)
This was fixed and works in 5.1.1 but appears to be broken again :( The original Jira appears to be an exactly the same as what I'm experiencing now.
Thomas
________________________________
**************************************************************************************
This message is confidential and intended only for the addressee. If you have received this message in error, please immediately notify the postmaster(a)nds.com and delete it from your system as well as any copies. The content of e-mails as well as traffic data may be monitored by NDS for employment and security purposes. To protect the environment please do not print this e-mail unless necessary.
NDS Limited. Registered Office: One London Road, Staines, Middlesex, TW18 4EX, United Kingdom. A company registered in England and Wales. Registered no. 3080780. VAT no. GB 603 8808 40-00
**************************************************************************************
13 years, 2 months