[rules-users] compiled processes in PKG removed by knowledge agent after first change scan

2011-10-19 Thread Jiang Zhu
hi,

I'm having trouble with scanning changed knowledge from Guvnor. I found out
that compiled processes from Guvnor are missing after resource change
scanner scan for changes first time (event there is no changes).

I wrote a simple test to reproduce this.

public class KnowledgeAgentTest {

@Test
public void should_load_processes() throws Exception {
ResourceChangeScannerConfiguration sconf =
ResourceFactory.getResourceChangeScannerService().newResourceChangeScannerConfiguration();
// Scan change every 2 seconds
KnowledgeAgent kagent = 
KnowledgeAgentFactory.newKnowledgeAgent("agent");
// Changeset points to a PKG contains 12 processes on Guvnor

kagent.applyChangeSet(ResourceFactory.newClassPathResource("test/drools-changeset.xml"));
// Everything is still ok now
System.out.println("Processes before scan: " +
kagent.getKnowledgeBase().getProcesses().size());

Assert.assertFalse(kagent.getKnowledgeBase().getProcesses().isEmpty());
// Scan change every 2 seconds
sconf.setProperty("drools.resource.scanner.interval", "2");

ResourceFactory.getResourceChangeScannerService().configure(sconf);
ResourceFactory.getResourceChangeScannerService().start();
ResourceFactory.getResourceChangeNotifierService().start();
// Wait long enough
Thread.sleep(5000);
// Processes are gone somehow
System.out.println("Processes after scan: " +
kagent.getKnowledgeBase().getProcesses().size());

Assert.assertFalse(kagent.getKnowledgeBase().getProcesses().isEmpty());
}

}

Here is what I'm getting when run the test.
---
 T E S T S
---
Running test.KnowledgeAgentTest
Processes before scan: 12
Processes after scan: 0
Tests run: 1, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 5.802 sec
<<< FAILURE!

Results :

Failed tests:   should_load_processes(test.KnowledgeAgentTest)

Tests run: 1, Failures: 1, Errors: 0, Skipped: 0


Thanks,
Jiang

--
View this message in context: 
http://drools.46999.n3.nabble.com/compiled-processes-in-PKG-removed-by-knowledge-agent-after-first-change-scan-tp3436520p3436520.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] externalization of input constraints in a rule

2011-10-19 Thread bharath87
Hi Michael,
  Thanks for your reply... consider the situation where there
are lot of rules each of which might or might not have unique input
contraints.. 

for e.g.

rule "Rule1"
 
 when
Person ( ssn == "input1" )
 then
.

end

rule "Rule2"
 
when
   Person ( ssn == "input2" and citizenship == "inputCountry" )
then
  . 
end

In the above scenario the ssn input for Rule1 differs from the ssn input for
Rule2, if i use SSN() facts i will have the rules fire for each ssn facts
present in the working memory.

what do i do?

--
View this message in context: 
http://drools.46999.n3.nabble.com/externalization-of-input-constraints-in-a-rule-tp3435495p3435834.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] externalization of input constraints in a rule

2011-10-19 Thread Michael Anstis
Insert a SSN fact?

when
SSN( $ssn : ssn )
$person : Person( ssn == $ssn )
then
...

sent on the move

On 19 Oct 2011 20:56, "bharath87"  wrote:

> Hi Guys,
>   I am new to Jboss Drools. I am writing rules for an application
> and here is where I need some help.
>
> Suppose I have a rule
>
>  rule "sampleRule"
>
> when
>
>  $person : Person ( ssn == "given" )
>
> then
>
> display ($person)
>
> end
>
> I want to externalize the "given" and use a variable / user input instead.
>
> Thanks
>
> --
> View this message in context:
> http://drools.46999.n3.nabble.com/externalization-of-input-constraints-in-a-rule-tp3435495p3435495.html
> Sent from the Drools: User forum mailing list archive at Nabble.com.
> ___
> rules-users mailing list
> rules-users@lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


[rules-users] externalization of input constraints in a rule

2011-10-19 Thread bharath87
Hi Guys, 
   I am new to Jboss Drools. I am writing rules for an application
and here is where I need some help. 

Suppose I have a rule 

 rule "sampleRule" 

when 

  $person : Person ( ssn == "given" ) 

then 

 display ($person) 

end 

I want to externalize the "given" and use a variable / user input instead. 

Thanks

--
View this message in context: 
http://drools.46999.n3.nabble.com/externalization-of-input-constraints-in-a-rule-tp3435495p3435495.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] Help! Activations firing out of salience order

2011-10-19 Thread darktyco
I had to upgrade to 5.2 to get away from the same salience bug. So far 5.2
has been very good to us other than the outrageous amount of memory it takes
to load up a large rule base (which you can partially get around using the
latest mvel jar).

--
View this message in context: 
http://drools.46999.n3.nabble.com/rules-users-Help-Activations-firing-out-of-salience-order-tp3430611p3435291.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] Rules from Multiple DRLs use the same namespace

2011-10-19 Thread rajee.sakthi
Thanks Laune for the response.
I am sorry for not providing enough information. I didnt know if I am
explaining it enough in DROOLs context. I might still miss some information,
I am sorry for that and thanks for your time trying to help me.

This is my scenario.
My knowledgebase has bunch of rules from different name spaces and it works
fine.

but in one specific use case (which I am implementing now), I have to
dynamically add/remove rules to/from a single namespace.
for example, at onetime I get a DRL with a set of rules that compile to the
namespace com.mypkg.
and in another time I get another DRL with a different set of rules which
also compile to the namespace com.mypkg.

and there is no limit for the number of such DRLs with different sets of
rules that compile to the same namespace com.mypkg.

also at some point I have to remove such a DRL, which means I will be
removing the rules defined in the DRL from the knowledge package.

these addition/deletion scenarios never end.

So my questions are as below:

1. is there any side effect to using the same package name in mutliple DRLs,
which ultimately results in
dynamically adding/removing of part of rules from a knowledge package ?
2. Is there any reason why you would think using unique package name per DRL
is beneficial compared to the above  ?

I agree with you, I dont see a reason why I have to remove the knowledge
package after all the rules have gone. May be I dont have to do that. but
does it matter even if I remove it ?

yes the remaining knowledge base is still good for other sessions.
Thanks again Laune.

--
View this message in context: 
http://drools.46999.n3.nabble.com/Rules-from-Multiple-DRLs-use-the-same-namespace-tp3432304p3435198.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] [planner] Performance question

2011-10-19 Thread Geoffrey De Smet



Op 19-10-11 15:00, Guilherme Kunigami schreef:



In this use case, that is probably a bad idea in my experience.
Why? Well I hope this makes any sense:
/You need to allow the optimization algorithms to break it now and
then to tunnel through a bad search space into another good search
space./
If it doesn't, don't worry.


Hmm, I think I understood it. Allowing infeasible solutions may help 
to scape from local minima in the space of feasible solutions for example.

Yep :)



rule "Avoid conflicting activities"
when
Assignment($room1 : room, $act1: activity, $id : activity.id
)
Assignment(room== $room1, room != null, $act2 : activity,
activity.id  > $id)
Conflict(act1 == $act1, act2 == $act2)

I would put Conflict first. But try it this way too and let me
know which works better ;) I don't know.
Stated differently: Instead of checking every 2 simultaneous
assignments if they are a conflict,
I would check if every 2 conflict assignments are simultaneous
(like in examinationScoreRules.drl).


Ok! I will perform some stress tests to verify which one works better.
Nice, please report your results to this mailing list. It doesn't matter 
if they are worse, better or equal: it's interesting to know.


Look for "stepLimit" in the examples to see how I do very short stress 
tests when adding extra constraints.
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] [planner] Performance question

2011-10-19 Thread Guilherme Kunigami
2011/10/19 Geoffrey De Smet 

> **
>
>
> Op 19-10-11 14:16, Guilherme Kunigami schreef:
>
> Consider I have a set of N activities with a given start and end times and
> I want to assign them to a set of rooms.
>
>  One of the main rules is to avoid two activities that have time
> conflicts, to be assigned to the same room. I devised three modelling
> options:
>
>  [1] Do it entirely in Java code, checking whether there will be a
> conflict before allowing an "Assignment move". This way, all solutions that
> the algorithm works with are feasible.
>
> In the manual that's called a "build-in hard constraint". Look for it.
>
> In this use case, that is probably a bad idea in my experience. Why? Well I
> hope this makes any sense:
> *You need to allow the optimization algorithms to break it now and then to
> tunnel through a bad search space into another good search space.*
> If it doesn't, don't worry.
>

Hmm, I think I understood it. Allowing infeasible solutions may help to
scape from local minima in the space of feasible solutions for example.


>
>
>  [2] Do it using drools rules, like the following:
>
>  rule "Avoid conflicting activities"
> when
>  Assignment($room1: room, $act1: activity, $id : activity.id)
>  Assignment(room == $room1, room!= null, $act2 : activity, activity.id >
> $id)
>  eval(Activity.conflict($act1, $act2))
>
> Why calculate it every time if you can cache it? [3]
>
>  then
>  insertLogical(new IntConstraintOccurrence("conflictingActivities",
> ConstraintType.NEGATIVE_HARD,
> 10, null));
> end
>
>  Here I'm using Assignment as the only planning entity. There's an
> assignment for each activity and it may point to a room or to null in the
> case the activity is not assigned. In the case above, I have a static
> function that checks whether two activities conflicts. This way, solutions
> may be infeasible but with high penalties the best solution found will
> eventually be feasible.
>
>  [3]
>
>  I also thought of a third option, which is to insert a fact "Conflict"
> for each pair of conflicting activities in a preprocessing phase. This way
> we would end up with:
>
> This is the recommended way. It's called "cached problem facts" in the
> manual.
> See the TopicConflict use in the examinationScoreRules.drl and
> Examination.getProblemFacts() in the examples.
>
>
>  rule "Avoid conflicting activities"
> when
>  Assignment($room1 : room, $act1: activity, $id : activity.id)
>  Assignment(room== $room1, room != null, $act2 : activity, activity.id >
> $id)
>  Conflict(act1 == $act1, act2 == $act2)
>
> I would put Conflict first. But try it this way too and let me know which
> works better ;) I don't know.
> Stated differently: Instead of checking every 2 simultaneous assignments if
> they are a conflict,
> I would check if every 2 conflict assignments are simultaneous (like in
> examinationScoreRules.drl).
>
>
Ok! I will perform some stress tests to verify which one works better.

Thanks again,


>  then
>  insertLogical(new IntConstraintOccurrence("conflictingActivities",
> ConstraintType.NEGATIVE_HARD,
> 10, null));
> end
>
>  The problem is that there may be up to O(N^2) such objects.
>
>  I do not know the rules engine algorithm in depth, so I'd like to know:
> Is any of these approaches more efficient than the others?
>
> [3] is definitely faster than [2].
>
>
>  Thanks!
>
>
> ___
> rules-users mailing 
> listrules-users@lists.jboss.orghttps://lists.jboss.org/mailman/listinfo/rules-users
>
>
> --
> With kind regards,
> Geoffrey De Smet
>
>
> ___
> rules-users mailing list
> rules-users@lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
>
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] Does Quartz-calendar work with Drools 5.1.1 ?

2011-10-19 Thread eskomk
Hi Mark,

Thanks for response,

now I must figure out how to configure Q-calendar with xml files ...

We are using drools-expert/fusion as a web service and we configure it
through xml files
(knowledge-services.xml, camel-server.xml, camel-client.xml ...)

br, Esko
---
Esko Hujanen
www.ebsolut.fi

--
View this message in context: 
http://drools.46999.n3.nabble.com/Does-Quartz-calendar-work-with-Drools-5-1-1-tp3428578p3434241.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] [planner] Performance question

2011-10-19 Thread Geoffrey De Smet



Op 19-10-11 14:16, Guilherme Kunigami schreef:
Consider I have a set of N activities with a given start and end times 
and I want to assign them to a set of rooms.


One of the main rules is to avoid two activities that have time 
conflicts, to be assigned to the same room. I devised three modelling 
options:


[1] Do it entirely in Java code, checking whether there will be a 
conflict before allowing an "Assignment move". This way, all solutions 
that the algorithm works with are feasible.

In the manual that's called a "build-in hard constraint". Look for it.

In this use case, that is probably a bad idea in my experience. Why? 
Well I hope this makes any sense:
/You need to allow the optimization algorithms to break it now and then 
to tunnel through a bad search space into another good search space./

If it doesn't, don't worry.


[2] Do it using drools rules, like the following:

rule "Avoid conflicting activities"
when
Assignment($room1: room, $act1: activity, $id : activity.id 
)
Assignment(room == $room1, room!= null, $act2 : activity, activity.id 
 > $id)

eval(Activity.conflict($act1, $act2))

Why calculate it every time if you can cache it? [3]

then
insertLogical(new IntConstraintOccurrence("conflictingActivities", 
ConstraintType.NEGATIVE_HARD,

10, null));
end

Here I'm using Assignment as the only planning entity. There's an 
assignment for each activity and it may point to a room or to null in 
the case the activity is not assigned. In the case above, I have a 
static function that checks whether two activities conflicts. This 
way, solutions may be infeasible but with high penalties the best 
solution found will eventually be feasible.



[3]
I also thought of a third option, which is to insert a fact "Conflict" 
for each pair of conflicting activities in a preprocessing phase. This 
way we would end up with:
This is the recommended way. It's called "cached problem facts" in the 
manual.
See the TopicConflict use in the examinationScoreRules.drl and 
Examination.getProblemFacts() in the examples.


rule "Avoid conflicting activities"
when
Assignment($room1 : room, $act1: activity, $id : activity.id 
)
Assignment(room== $room1, room != null, $act2 : activity, activity.id 
 > $id)

Conflict(act1 == $act1, act2 == $act2)
I would put Conflict first. But try it this way too and let me know 
which works better ;) I don't know.
Stated differently: Instead of checking every 2 simultaneous assignments 
if they are a conflict,
I would check if every 2 conflict assignments are simultaneous (like in 
examinationScoreRules.drl).

then
insertLogical(new IntConstraintOccurrence("conflictingActivities", 
ConstraintType.NEGATIVE_HARD,

10, null));
end

The problem is that there may be up to O(N^2) such objects.

I do not know the rules engine algorithm in depth, so I'd like to 
know: Is any of these approaches more efficient than the others?

[3] is definitely faster than [2].


Thanks!


___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


--
With kind regards,
Geoffrey De Smet

___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


[rules-users] [planner] Performance question

2011-10-19 Thread Guilherme Kunigami
Consider I have a set of N activities with a given start and end times and I
want to assign them to a set of rooms.

One of the main rules is to avoid two activities that have time conflicts,
to be assigned to the same room. I devised three modelling options:

[1] Do it entirely in Java code, checking whether there will be a conflict
before allowing an "Assignment move". This way, all solutions that the
algorithm works with are feasible.

[2] Do it using drools rules, like the following:

rule "Avoid conflicting activities"
when
Assignment($room1: room, $act1: activity, $id : activity.id)
 Assignment(room == $room1, room!= null, $act2 : activity, activity.id >
$id)
eval(Activity.conflict($act1, $act2))
then
insertLogical(new IntConstraintOccurrence("conflictingActivities",
ConstraintType.NEGATIVE_HARD,
10, null));
end

Here I'm using Assignment as the only planning entity. There's an assignment
for each activity and it may point to a room or to null in the case the
activity is not assigned. In the case above, I have a static function that
checks whether two activities conflicts. This way, solutions may be
infeasible but with high penalties the best solution found will eventually
be feasible.

I also thought of a third option, which is to insert a fact "Conflict" for
each pair of conflicting activities in a preprocessing phase. This way we
would end up with:

rule "Avoid conflicting activities"
when
Assignment($room1 : room, $act1: activity, $id : activity.id)
Assignment(room== $room1, room != null, $act2 : activity, activity.id > $id)
Conflict(act1 == $act1, act2 == $act2)
then
insertLogical(new IntConstraintOccurrence("conflictingActivities",
ConstraintType.NEGATIVE_HARD,
10, null));
end

The problem is that there may be up to O(N^2) such objects.

I do not know the rules engine algorithm in depth, so I'd like to know: Is
any of these approaches more efficient than the others?

Thanks!
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] Why this rule fires immediately ?

2011-10-19 Thread Wolfgang Laun
You'd have to insert the new ZZZTracker in the first rule.

But this does not compute the average over three values in a *sliding *window;
you'd compute the average for every *adjacent *window of three events.

Stay with the original rule, but use a "Tracker" for counting valid
ZZZSensorBeans, and add another pattern to the original rule: the suitable
Tracker must have a count >= 3.

-W

On 19 October 2011 12:28, eskomk  wrote:

> Hi all,
>
> Sorry, the first rule should read:
>
> when
>$mds : ZZZSensorBean(temperature > 30)
>not ZZZTracker(profileID == $mds.profileID)
> then
>ZZZTracker $tracker = new ZZZTracker();
>$tracker.profileID = $mds.profileID;
> end
>
> br Esko
>
> --
> View this message in context:
> http://drools.46999.n3.nabble.com/Why-this-rule-fires-immediately-tp3430427p3433905.html
> Sent from the Drools: User forum mailing list archive at Nabble.com.
> ___
> rules-users mailing list
> rules-users@lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] Why this rule fires immediately ?

2011-10-19 Thread eskomk
Hi all,

Sorry, the first rule should read:

when
$mds : ZZZSensorBean(temperature > 30)
not ZZZTracker(profileID == $mds.profileID)
then
ZZZTracker $tracker = new ZZZTracker();
$tracker.profileID = $mds.profileID;
end

br Esko

--
View this message in context: 
http://drools.46999.n3.nabble.com/Why-this-rule-fires-immediately-tp3430427p3433905.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] Why this rule fires immediately ?

2011-10-19 Thread eskomk
Hi all,

So to achieve the desired behaviour I concocted something like this:

1. If got a reading > 30, create tracker-object (of type ZZZTracker) for
this specific profileID and insert it in working memory.
Tracker is just a POJO with some bean fields, e.g. profileID. There is a
check in when-part that a tracker does not exist for this profileID, to
prevent creating many trackers for the same purpose.

when
$mds : ZZZSensorBean(temperature > 30)
then
ZZZTracker $tracker = new ZZZTracker();
$tracker.profileID = $mds.profileID;
end

2. If tracker exists and got three more readings > 30 for this profile
(after tracker insertion), do something intelligent (from the app domain
point of view) and retract tracker from memory.

when
$tracker : ZZZTracker()
$mds01 : ZZZSensorBean( profileID == $tracker.profileID, temperature >
30, this after $tracker)
$mds02 : ZZZBean( profileID == $tracker.profileID, temperature > 30,
this after $mds01)
$mds03 : ZZZBean( profileID == $tracker.profileID, temperature > 30,
this after $mds02)
then
retract($tracker);
...

3. If got a reading < 30 for this profileID and tracker exists, retract
tracker from working memory and so prevent the system from doing something
intelligent.

What do you think, is this solution viable ?

If there are better solutions out there, I would gladly hear of them.

And about using window, in what kind of situations it is intended to be used
?
Because it clearly seems that it isn't an answer to what I need to do.

br Esko

--
View this message in context: 
http://drools.46999.n3.nabble.com/Why-this-rule-fires-immediately-tp3430427p3433896.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] How to install Drools in Eclipse 3.2?

2011-10-19 Thread Nicolas Héron
Hi,
I think it is not possible for the latest drools versions 5.2 and 5.3.
Use eclipse 3.6 or 3.7 I guess
Regards
Nicolas

2011/10/19 bshailesh3 [via Drools] 

> I am new to drools, i need a help in installation Drools with Eclipse 3.2.
>
> Please suggest if you have any doc.
>
> Thanks
>
>
>
> --
>  If you reply to this email, your message will be added to the discussion
> below:
>
> http://drools.46999.n3.nabble.com/How-to-install-Drools-in-Eclipse-3-2-tp3433860p3433860.html
>  To unsubscribe from Drools, click 
> here.
>
>


-
Nicolas Héron
--
View this message in context: 
http://drools.46999.n3.nabble.com/How-to-install-Drools-in-Eclipse-3-2-tp3433860p3433884.html
Sent from the Drools: User forum mailing list archive at Nabble.com.___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


[rules-users] How to install Drools in Eclipse 3.2?

2011-10-19 Thread bshailesh3
I am new to drools, i need a help in installation Drools with Eclipse 3.2. 

Please suggest if you have any doc. 

Thanks  



--
View this message in context: 
http://drools.46999.n3.nabble.com/How-to-install-Drools-in-Eclipse-3-2-tp3433860p3433860.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] Help! Activations firing out of salience order

2011-10-19 Thread Swindells, Thomas
That's a relief.
Any news as to when final will be released?

Thanks,

Thomas

From: rules-users-boun...@lists.jboss.org 
[mailto:rules-users-boun...@lists.jboss.org] On Behalf Of Edson Tirelli
Sent: 19 October 2011 01:23
To: Rules Users List
Subject: Re: [rules-users] Help! Activations firing out of salience order


   This was a duplicate of https://issues.jboss.org/browse/JBRULES-3111 that 
was fixed last week. It will be released in 5.3.0.final.

   Edson
2011/10/18 Swindells, Thomas mailto:tswinde...@nds.com>>
Ouch looks like we and anybody on 5.1.1 needs to desperately update then.
Though I am rather concerned by this issue 
https://issues.jboss.org/browse/JBRULES-3211  "Rules fires on incorrect 
condition" - has this been looked at/is the issue correct as a rules engine 
which fires random rules when it shouldn't would be problematic!

Thomas

From: 
rules-users-boun...@lists.jboss.org 
[mailto:rules-users-boun...@lists.jboss.org]
 On Behalf Of Wolfgang Laun
Sent: 18 October 2011 11:05
To: Rules Users List
Subject: Re: [rules-users] Help! Activations firing out of salience order

There used to be a subtle bug in the PriorityHeapQueue containing the 
activations.

See https://issues.jboss.org/browse/JBRULES-3044

-W
2011/10/18 Swindells, Thomas mailto:tswinde...@nds.com>>
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 
postmas...@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
**

___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users



--
  Edson Tirelli
  JBoss Drools Core Development
  JBoss by Red Hat @ www.jboss.com
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users