[rules-users] deadlock

2013-03-04 Thread Smita S. Deshpande
Hi,

We are currently using drools 5.0.1 for processing business rules. But we are 
currently facing an issue where if we invoke the rule using 10 concurrent 
requests , thread gets locked . The error is as below .

Deadlock/Blocked

Monitor

Owns Monitor Lock on 
org/drools/rule/JavaDialectRuntimeData$PackageClassLoader@0E99F9B8/0E99F9C4
Waiting for Monitor Lock on 
org/drools/rule/CompositeClassLoader@0DB50DC0/0DB50DCC

Java Stack

at java/lang/ClassLoader.loadClass(ClassLoader.java:606(Compiled Code))
at java/lang/Class.forNameImpl(Native Method)
at java/lang/Class.forName(Class.java:163(Compiled Code))
at 
org/drools/rule/JavaDialectRuntimeData$PackageClassLoader.loadClass(JavaDialectRuntimeData.java:458(Compiled
 Code))
at java/lang/ClassLoader.loadClass(ClassLoader.java:606(Compiled Code))
at 
/Rule_AutoUW_Rule_BR12Constants_153_0ConsequenceInvoker.evaluate(Rule_AutoUW_Rule_BR12Constants_153_0ConsequenceInvoker.java:16)
at 
org/drools/common/DefaultAgenda.fireActivation(DefaultAgenda.java:934(Compiled 
Code))
at org/drools/common/DefaultAgenda.fireNextItem(DefaultAgenda.java:885(Compiled 
Code))
at 
org/drools/common/DefaultAgenda.fireAllRules(DefaultAgenda.java:1086(Compiled 
Code))
at 
org/drools/common/AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:661(Compiled
 Code))
at 
org/drools/common/AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:637(Compiled
 Code))
at 
org/drools/reteoo/ReteooStatelessSession.execute(ReteooStatelessSession.java:203(Compiled
 Code))



Can you please advice .This has been occurring on Production systems and 
causing failures

Thanks & Regards,
Smita Deshpande
Technical Specialist - DU UK Insurance
Mastek Ltd | Cerebrum,2nd Floor, KalyaniNagar, Pune, Maharashtra, INDIA
(M)(0)9823041314 | (T) 91 20 66072000 Extn - 2256 | VOIP: 729 | 
www.mastek.com
Email:- smita.deshpa...@mastek.com

MASTEK LTD.
In the US, we're called MAJESCOMASTEK

~~
Opinions expressed in this e-mail are those of the individual and not that of 
Mastek Limited, unless specifically indicated to that effect. Mastek Limited 
does not accept any responsibility or liability for it. This e-mail and 
attachments (if any) transmitted with it are confidential and/or privileged and 
solely for the use of the intended person or entity to which it is addressed. 
Any review, re-transmission, dissemination or other use of or taking of any 
action in reliance upon this information by persons or entities other than the 
intended recipient is prohibited. This e-mail and its attachments have been 
scanned for the presence of computer viruses. It is the responsibility of the 
recipient to run the virus check on e-mails and attachments before opening 
them. If you have received this e-mail in error, kindly delete this e-mail from 
desktop and server.
~~
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users

[rules-users] Retrieving timestamps from default Drools Fusion event

2013-03-04 Thread Wan Jing Loh
Hi,

First time posting in the mailing list, so I apologise if I make any silly
mistakes.

I have two classes MachineOnline and MachineOffline, which denote when a
machine is online and offline respectively

public class MachineOnline {
int machineId

}


These are declared in the drl file as events, so Drools Fusion
automatically generates the timestamp for me (I am running in STREAM mode,
so i get real time updates on the machine status)

declare MachineOnline
@role(event)
end

I then have a rule to generate the duration when the machine is online, but
I cannot seem to extract the timestamp that drools automatically inserts. A
thread a few years ago suggested using .startTimestamp, but Drools does not
seem to recognise it as a field. I believe that needs an EventFactHandle,
but I'm not sure how to retrieve that inside the drl file.

rule "Find duration machine is online"
when $message1 : MachineOnline()
 $message2: MachineOffline(machineId == $message1.machineId &&
this after $message1) // + more rules to handle edge cases
then
 //processing
 duration = $message2.startTimestamp - $message1.startTimestamp ?
end

The eventual aim is to allow for a query that allows me to find how long
the machine is online for during a specified time interval, so if there is
a way to do this without needing to retrieve the actual timestamp of each
event, that will be great too. Or would it be better to manually define a
timeStamp field for each event? I've been using the default one as that
together with the pseudo allows for easy unit testing.

Thanks a lot!

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

[rules-users] 'from' returns previous instance in stateful session

2013-03-04 Thread ismaximum
Hi

In our rule we have a code like this:

when
$r : ReferenceCode(value == "N") from
referenceCodeService.getReferenceCode("SPLIT_YN")
then
System.out.println("> " + $r.getValue() + " - " +
referenceCodeService.getReferenceCode("IDD_YN").getValue());


Now the problem is when we fire all rules to activate this one, the print
out is like this:

N - N
N - Y

As you see the first time it's N which is correct but second time I expect
to be Y

The ReferenceCodeService is a mock service in which we defined a Map that
contains all ref codes. Now before first firing rules I set the value of
SPLIT_YN to N and then for second I set it to Y but it seems it's still
returning the previous value.

Any idea?

Thanks

Drools 5.5



--
View this message in context: 
http://drools.46999.n3.nabble.com/from-returns-previous-instance-in-stateful-session-tp4022681.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] Package Snapshot question

2013-03-04 Thread Stephen Masters
Similar to '2', I have done by creating a new dated/versioned snapshot and then 
copy that to the 'Live' snapshot.

That way, I have a history of live snapshots. And I just need to copy the 
previous version to 'Live' if I wish to roll back.

I'd stay away from LATEST personally, as that means it's not possible to test 
that the rules are working as expected before promoting them. I'd hate to have 
a situation where new rule sets are being deployed automatically every time a 
package was built.

Steve



On 4 Mar 2013, at 16:14, IPatel  wrote:

> Hi,
> 
> I have read several posts regarding package snapshot and still have few
> questions.
> 
> The is the goal of our exercise:
> 
> Find out a solution for a  in such a way that we can
> deploy any changes made  with no or minimal code changes required. We are
> investigating drool as POC for this process.
> 
> This is what i know about package snapshots:
> 
> it allows one to lockdown any changes made to the assests. These changes
> will not affect the application. This will help us because when our business
> partners are making changes to the rules or updating the exisiting one, prod
> application will not be impacted. 
> 
> ChangeSet.xml file will have to point  this snapshot url
> 
> 
> 
> These are the questions i have:
> 
> I see there are 3 options when dealing with snapshot:
> 
> 1)create new one: When creating a new one, i believe i will have to make
> changes to the changeset.xml file everytime its creation. Can i configure
> this file in way that it automatically reads the package(s) created so i
> dont have keep on updating it? Under what scenarion this is a good option to
> use?
> 
> 
> 2)modify/replace existing one
> 
> If i select this option , the benifit will be that i dont have to change the
> xml file. However what happens if there are problems and we have to revert
> back to the old package. Does the system save old version of the package
> before updating it with a new one? 
> 
> 3) My current POC's xml file points to the LATEST. Is there a benifit in
> just using this and not using  snapshot? How risky this is? will i be able
> to access previous version of the package/rule in case of a disaster.
> 
> You input is greatly appreciated.
> 
> 
> 
> 
> --
> View this message in context: 
> http://drools.46999.n3.nabble.com/Package-Snapshot-question-tp4022679.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] Package Snapshot question

2013-03-04 Thread IPatel
Hi,

I have read several posts regarding package snapshot and still have few
questions.

The is the goal of our exercise:

Find out a solution for a  in such a way that we can
deploy any changes made  with no or minimal code changes required. We are
investigating drool as POC for this process.

This is what i know about package snapshots:

it allows one to lockdown any changes made to the assests. These changes
will not affect the application. This will help us because when our business
partners are making changes to the rules or updating the exisiting one, prod
application will not be impacted. 

ChangeSet.xml file will have to point  this snapshot url



These are the questions i have:

I see there are 3 options when dealing with snapshot:

1)create new one: When creating a new one, i believe i will have to make
changes to the changeset.xml file everytime its creation. Can i configure
this file in way that it automatically reads the package(s) created so i
dont have keep on updating it? Under what scenarion this is a good option to
use?


2)modify/replace existing one

If i select this option , the benifit will be that i dont have to change the
xml file. However what happens if there are problems and we have to revert
back to the old package. Does the system save old version of the package
before updating it with a new one? 

3) My current POC's xml file points to the LATEST. Is there a benifit in
just using this and not using  snapshot? How risky this is? will i be able
to access previous version of the package/rule in case of a disaster.

You input is greatly appreciated.




--
View this message in context: 
http://drools.46999.n3.nabble.com/Package-Snapshot-question-tp4022679.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] [Drools Planner] Multi depot CVRP / CVRPTW

2013-03-04 Thread Mats Norén
Thanks Geoffrey,

On Mon, Mar 4, 2013 at 4:33 PM, Geoffrey De Smet wrote:

>
> The example only does the capacitated vehicle routing problem (VRP +
> capacity limits), not the windowed vehicle routing problem.
>
>
By "your example" I meant the pseudo rule you sent me in a previous mail
and not the  cvrp example in drools-planner-examples.

>
>  Should I add each CustomerTimeWindow as a fact in the
> VrpSchedule.getProblemFacts?
>
> Yes, so your score rules can exploit it.
> Also, you 'll want to make sure that your score rule penalize "the number
> of minutes that a time window isn't met".
>
>
Ok, by this you mean the difference in minutes from the arrivaltime and the
customer timewindow? i.e., the largest of (arrivalTime - endTime) and
(startTime-arrivalTime) given that  (arrivalTime < startTime or arrivalTime
> endTime) ?

Regards,
Mats

>
> ___
> rules-users mailing 
> listrules-users@lists.jboss.orghttps://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 mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users

Re: [rules-users] [Drools Planner] Multi depot CVRP / CVRPTW

2013-03-04 Thread Geoffrey De Smet

  
  

Op 04-03-13 13:39, Mats Norén schreef:


  

  

  

  
Hi Geoffrey,

After a long period away from this problem I've come
back to it and I'm feeling a bit lost :-)

  
  Could you elaborate on how to best model the rules and
  domain objects. I've looked at the nurse rostering
  example but didn't find any clues on how to proceed.
  

My first stab on this uses the following rules:

rule "arrivalTime"
    when
    $vehicle : VrpVehicle()
    $customer : VrpCustomer(
    vehicle == $vehicle,
    $arrivalTime : arrivalTime)
    then
    insertLogical(new
VrpCustomerVisitArrivalTime($customer, $arrivalTime));
end

rule "arrivalWithinTimeWindow"
    when
    VrpCustomerVisitArrivalTime($c : customer, $a :
arrival)
    not CustomerTimeWindow(customer == $c, $a >
startTime, $a < endTime)
    then
    insertLogical(new
IntConstraintOccurrence("arrivalWithinTimeWindow",
ConstraintType.HARD, -$a, $c))
end

  
  I've added a method arrivalTime to VrpCustomer that walks
  the VrpAppearances to the Depot and accumulates the travel
  time between each appearance.  (I'm using GraphHopper and
  the OpenStreetMap roadnetwork). This works similar to the
  getDistance(VrpLocation location). 
  

What I didn't grasp is how the rule in your example is using
the CustomerTimeWindow? I'm assuming the CustomerTimeWindow
is a property on VrpCustomer?
  

  

The example only does the capacitated vehicle routing problem (VRP +
capacity limits), not the windowed vehicle routing problem.

  

  
  
  Should I add each CustomerTimeWindow as a fact in the
  VrpSchedule.getProblemFacts?

  

Yes, so your score rules can exploit it.
Also, you 'll want to make sure that your score rule penalize "the
number of minutes that a time window isn't met".

  

  

Btw, I'm using drools-planner 6.0.0-SNAPSHOT.



Regards,
Mats

  

  

  
  
  ps.
  
  I like the new name OptaPlanner.
  
  ds.

  
  

  

  

  

  
  

On Tue, Nov 20, 2012 at 1:54 PM, Mats
  Norén 
  wrote:
  
Ok, so on the first rule should fire for all
  occurrences of a Customer since each Customer should have
  at least one visit? 



  

  
It's not another planning variable,
instead,
do something like

when
  ...
then
   insertLogical(new CustomerVisitArrivalTime(...));
end

when
    CustomerVisitArrivalTime($c : customer, $a :
arrival)
    not CustomerTimeWindow(customer == $c, $a >
start, $a < end)
then
    insertLogical(new IntConstraintOccurrence(...))
end

See nurseRosteringScoreRules.drl for an example of
use of
insertLogical's like that
  
  

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

  

  
  

Btw, tha

Re: [rules-users] [Drools Planner] Multi depot CVRP / CVRPTW

2013-03-04 Thread Mats Norén
Hi Geoffrey,
After a long period away from this problem I've come back to it and I'm
feeling a bit lost :-)

Could you elaborate on how to best model the rules and domain objects. I've
looked at the nurse rostering example but didn't find any clues on how to
proceed.

My first stab on this uses the following rules:

rule "arrivalTime"
when
$vehicle : VrpVehicle()
$customer : VrpCustomer(
vehicle == $vehicle,
$arrivalTime : arrivalTime)
then
insertLogical(new VrpCustomerVisitArrivalTime($customer,
$arrivalTime));
end

rule "arrivalWithinTimeWindow"
when
VrpCustomerVisitArrivalTime($c : customer, $a : arrival)
not CustomerTimeWindow(customer == $c, $a > startTime, $a < endTime)
then
insertLogical(new
IntConstraintOccurrence("arrivalWithinTimeWindow", ConstraintType.HARD,
-$a, $c))
end

I've added a method arrivalTime to VrpCustomer that walks the
VrpAppearances to the Depot and accumulates the travel time between each
appearance.  (I'm using GraphHopper and the OpenStreetMap roadnetwork).
This works similar to the getDistance(VrpLocation location).

What I didn't grasp is how the rule in your example is using the
CustomerTimeWindow? I'm assuming the CustomerTimeWindow is a property on
VrpCustomer?

Should I add each CustomerTimeWindow as a fact in the
VrpSchedule.getProblemFacts?

Btw, I'm using drools-planner 6.0.0-SNAPSHOT.

Regards,
Mats

ps.
I like the new name OptaPlanner.
ds.





On Tue, Nov 20, 2012 at 1:54 PM, Mats Norén  wrote:

> Ok, so on the first rule should fire for all occurrences of a Customer
> since each Customer should have at least one visit?
>
> It's not another planning variable,
>> instead,
>> do something like
>>
>> when
>>   ...
>> then
>>insertLogical(new CustomerVisitArrivalTime(...));
>> end
>>
>> when
>> CustomerVisitArrivalTime($c : customer, $a : arrival)
>> not CustomerTimeWindow(customer == $c, $a > start, $a < end)
>> then
>> insertLogical(new IntConstraintOccurrence(...))
>> end
>>
>> See nurseRosteringScoreRules.drl for an example of use of
>> insertLogical's like that
>>
>> ___
>> rules-users mailing list
>> rules-users@lists.jboss.org
>> https://lists.jboss.org/mailman/listinfo/rules-users
>>
>
> Btw, thanks for your help and thanks for a great product!
>
> Regards,
> Mats
>
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users

[rules-users] Guvnor Authentication

2013-03-04 Thread rjr201
Hi,

I'm still struggling to get authentication to work with Guvnor 5.5 on JBoss
7. Can anyone confirm that the fix described here is still necessary/correct
with Guvnor 5.5? 

http://drools.46999.n3.nabble.com/How-configure-Guvnor-5-4-JAAS-with-jboss-7-0-2-td4020424.html

It feels strange that I have to change the source code for something so
common as authentication. Any insight anyone can give me on doing this would
be really helpful. 

Thanks in advance,
Rich. 



--
View this message in context: 
http://drools.46999.n3.nabble.com/Guvnor-Authentication-tp4022675.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 5.5.1 Immovable Planning entities

2013-03-04 Thread Geoffrey De Smet

Op 04-03-13 08:19, duggal schreef:
> Thank you - that does help.
> Where can I find the release plan for drools 6.0?
I don't think the ever-changing release plan is publicized (except in 
IRC discussions :)

6.0.0.Alpha9 was deployed to the public jboss repo recently.
We're probably releasing Beta1 this month.
There probably won't be a Beta2 (so CR1 will follow relatively soon).

But this will all change as needed: we avoid promising release dates 
towards the community: it's ready when it's ready.
>
>
> --
> View this message in context: 
> http://drools.46999.n3.nabble.com/Planner-5-5-1-Immovable-Planning-entities-tp4022657p4022673.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