Problem when deploying Guvnor to glassfish v2.1 cluster
by Zhang Jing-A52198
Hi All,
I have encountered a problem when deploying the latest Guvnor to
glassfish v2.1 cluster.
Below is the return:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html><head><title>S
un GlassFish Enterprise Server v2.1 - Error report</title><style
type="text/css"><!--H1
{font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D7
6;font-size:22px;} H2
{font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D7
6;font-size:16px;} H3
{font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D7
6;font-size:14px;} BODY
{font-family:Tahoma,Arial,sans-serif;color:black;background-color:white;
} B
{font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D7
6;} P
{font-family:Tahoma,Arial,sans-serif;background:white;color:black;font-s
ize:12px;}A {color : black;}HR {color : #525D76;}--></style>
</head><body><h1>HTTP Status 404 - Servlet securityService is not
available</h1><hr/><p><b>type</b> Status
report</p><p><b>message</b>Servlet securityService is not
available</p><p><b>description</b>The requested resource (Servlet
securityService is not available) is not available.</p><hr/><h3>Sun
GlassFish Enterprise Server v2.1</h3></body></html>
Any ideas?
Thanks,
Jing
15 years, 5 months
Using ArrayList as global in DRL file
by Divya Rajendranath
Hi,
I am setting an ArrayList as a Global on my drools session by saying ...
StatefulSession drlSession = getRuleManager().getSession();
drlSession.setGlobal("myMailingList", myMailingList);
then in my Drl file, I send the same arrayList as a parameter to the setter
of another object by saying...
package com.test.rules;
import java.util.ArrayList;
global java.util.ArrayList myMailingList;
rule "Test"
salience 100
no-loop true
when
$o:MyObject(some condition)
$d:Destination()
then
$d.setFieldMember(myMailingList)
end
So, based on some condition/field value in MyObject I want to set the
Destination with the arraylist - myMailingList.
Is the way I specify/refer the ArrayList in the then part fine. Because I am
always getting "unable to compile test.drl file - runtime exception".
Could some one please help me with this.
-thnx
15 years, 5 months
error
by MAILER-DAEMON
Dear user of lists.jboss.org,
Your email account was used to send a large amount of spam messages during the last week.
Probably, your computer was infected by a recent virus and now runs a trojan proxy server.
We recommend you to follow instruction in order to keep your computer safe.
Have a nice day,
The lists.jboss.org support team.
15 years, 5 months
matching multiple facts in a rule using a DSL template
by Erik Clairiot
Hello,
I recently started to use DSL template within my rules.
In the LHS, I oftenly match conditions against multiple facts, facts that I
want to modify in the RHS.
example :
when
$v1 : Variable(id == "A")
$v2 : Variable(id == "B")
then
$v1.setFoo();
end
If I write a dsl template like that :
[when] there is "{id}"=v:Variable(id == "{id}")
[then] foo me=v.setFoo();
and a dsl rule like that
when
there is "A"
there is "B"
then
foo me
end
the execution will produce the error "Duplicate declaration for variable
..."
I understand why it occurs.
how to specify a constraint upon the fact matched ? Dunno if it is
possible, my opinion will be to create another dsl rule, that is supposed
to match with the "foo me", but it does not seem to be very convenient.
Is there a way to use an array for variable assignement in the RHS ? like
[when] there is "{id}"=v[]:Variable(id == "{id}")
[then] foo me=v[].setFoo();
and use it in the RHS of the rule like
when
there is "A"
there is "B"
then
foo me [0] // will cause foo me on the first matched fact
end
There are a lot of chances this does not exist, and works like that, maybe
I am not using DSL well and it is bad idea to match multiple fact with the
same dsl template.
Can someone help me on that ? It is just a question, I am not stuck on
this, but interested on how to deal with that.
Thanks.
Erik
15 years, 5 months
Issue with operator || in Drools 5.0.1
by Chris Gibble
My apologies if this has already been answered elsewhere -- I searched and could not find it.
I have a java class that takes this form (simplified for purposes of this discussion):
public class MyClass()
{
public boolean isHappy();
public boolean isHealthy();
}
I have a rule that looks like this:
rule "Some rule"
salience 100
when
$obj : MyClass(happy == true || healthy == true)
then
// Do something with $obj
end rule
In Drools 4.x, this rule would perform the conclusion when either MyClass.isHappy() returned true or MyClass.isHealthy() returned true, but not if both were false.
In Drools 5.0.1, this rule would perform the conclusion always -- regardless of the values of isHappy() or isHealthy().
Any ideas what's going on? Is this a known problem, or is there something wrong with my syntax and/or class?
Thanks for any help you can give -- and I can give a more concrete example if need be.
------------------------------------------------------------
Bamboo Flooring
The strong, silent type. Click here for great looking bamboo flooring!
http://tagline.excite.com/fc/FgElN1gz4wwE6UWjuk9HgExVihsl6SoJRYkCYdqtuEKv...
15 years, 5 months
Problem when using multiple rule files (Drools 5)
by Olaf Raether
Hey,
i have a drl file with round about 100 rules. when i run this single file
everything fine !
When i splip the file into two files and add them seperate into the ruleBase
i get the following Exception
during the inserting of the facts:
java.lang.NullPointerException
at org.drools.base.ClassFieldReader.isNullValue(ClassFieldReader.java:183)
at
org.drools.base.evaluators.EqualityEvaluatorsDefinition$IntegerEqualEvaluator.evaluate(EqualityEvaluatorsDefinition.java:1482)
at org.drools.rule.LiteralRestriction.isAllowed(LiteralRestriction.java:92)
at
org.drools.rule.OrCompositeRestriction.isAllowed(OrCompositeRestriction.java:25)
The code looks like this:
RuleBase ruleBase = RuleBaseFactory.newRuleBase();
for (int i = 0; i < rules.length; i++) {
Package pkg = getPackage(i);
ruleBase.addPackage(pkg);
}
for (int i = 0; i < facts.length; i++) {
Object fact = facts[i];
workingMemory.insert(fact); // <<<<< Exception, when multiple rule files
}
Any ideas ?
--
View this message in context: http://www.nabble.com/Problem-when-using-multiple-rule-files-%28Drools-5%...
Sent from the drools - user mailing list archive at Nabble.com.
15 years, 5 months
Drools multithreading query
by jayadevan.m@gmail.com
Hi,
I was trying out some multithreading scenarios for improving the rule
execution time in Drools5. I found two methods for enabling and specifying
the number of threads in RuleBaseConfiguration - setMaxThreads() and
setMultiThreadEvaluation() respectively. But, didn't find multiple threads
being spawned during rule execution. I had set the latter to true and set
the max to 4 before firing the rules using stateless session.
Can someone verify if this is the proper way for implementing
multithreading in Drools? If not, please provide me with links/examples for
implementing this.
Thanks in advance.
Jayadevan
15 years, 5 months
Efficiency of using inline evals in Drools 5
by Nancy Dougherty
Hello!
I have a question about how an inline eval function is or isn’t
efficient in the algorithm- I have many User objects that I am
inserting into Working Memory (in a stateful session), and each User
object has as ArrayList of Messages
The message class has 2 String fields: text and logid
I have custom boolean function user.containsText(String keyword)
function that takes in a string, and searches to see if that keyword
contained in the text field of one of the message entries in the User
message arraylist. If I use an inline eval statement to implement
this:
$user: User( eval (containsText ( “sample text”) ) )
Will it re-evaluate each time? Or will Drools cache the result and
remember it/ create a node based on it so the node will have every
user this is true for, and it doesn’t re-evaluate when the users or
rules are modified? Will it create a "node" in the algorithm for all
the users that this function is true for?
On a similar note, if I use the “matches” comparator in a rule
creation, does it create a node and cache the result? Will it
automatically re-evaluate each time the field its matched against is
modified?
Thanks so much!
Nancy
15 years, 5 months
Re: [rules-users] Using eval in LHS
by Greg Barton
See the attached project. You can run it using maven with this command:
mvn package exec:java -Dexec.mainClass="com.sample.DroolsTest"
There are three basic rules:
MakeCollision: Detect that a collision has happened
MatchCollision: Match vehicles to collisions
IdentifyLargeCollision: Find collisions that are "large"
rule "MakeCollision"
salience 10
when
s : Sighting( collision == null )
not Collision( direction == s.direction, position == s.position, lane == s.lane )
then
Collision c = new Collision( s.direction, s.position, s.lane );
c.getSightings().add( s );
s.setCollision( c );
System.out.println("Creating " + c);
update( s );
insert( c );
end
rule "MatchCollision"
salience 10
when
s : Sighting( collision == null )
c : Collision( direction == s.direction, position == s.position, lane == s.lane )
then
c.getSightings().add( s );
s.setCollision( c );
System.out.println("Matching " + s);
update( s );
update( c );
end
rule "IdentifyLargeCollision"
salience 5
when
num : Number ( intValue > 1 )
from accumulate (
Collision( sightings.size > 2 ),
init( int count = 0; ),
action( count++; ),
reverse( count--; ),
result( count )
);
then
System.out.println("Found " + num);
end
--- On Fri, 7/24/09, nash.8103(a)gmail.com <nash.8103(a)gmail.com> wrote:
> From: nash.8103(a)gmail.com <nash.8103(a)gmail.com>
> Subject: Re: [rules-users] Using eval in LHS
> To: "Rules Users List" <rules-users(a)lists.jboss.org>
> Date: Friday, July 24, 2009, 2:16 PM
> Thanks Greg.....
>
> The reason I chose HashMap is that an accident is said to
> occur if and only if more than 1 vehicle contains four
> consecutive position report as same. So in my hashmap key is
> vehicle id and value is the no. Of times same position
> report received... Can you suggest me a way to
> 1. Collect all vehicles stopped at some point and the
> occurance of that event is reported more than thrice
> 2. Report accident if there are more than one vehicle found
> in step 1
>
> ---Priya
> -original message-
> Subject: Re: [rules-users] Using eval in LHS
> From: Greg Barton <greg_barton(a)yahoo.com>
> Date: 24/07/2009 10:36 pm
>
>
> Try this:
>
> rule "Create Collision Location"
> salience 90
> no-loop true
> when
> vehLoc : VehicleLocation()
> not CollisionLocation(xway == vehLoc.xway,
> pos ==
> vehLoc.pos, dir == vehLoc.dir, lane == vehLoc.lane)
> then
> CollisionLocation collisionLoc = new
> CollisionLocation(vehLoc.getXway(),
> vehLoc.getPos(), vehLoc.getDir(), vehLoc.getLane());
> insert(collisionLoc);
> end
>
> rule "Collect Collided Vehicles"
> salience 90
> no-loop true
> when
> vehLoc : VehicleLocation()
> $collisionLoc : CollisionLocation(xway ==
> vehLoc.xway, pos ==
> vehLoc.pos, dir == vehLoc.dir, lane == vehLoc.lane)
> then
>
> collisionLoc.getVehicleLocations().add(vehLoc);
> update(collisionLoc);
> end
>
> And now, the rule that detects more than three coinciding
> vehicle locations is simple:
>
> rule "Detect Too Many"
> when
> CollisionLocation(vehicleLocations.size >
> 2)
> then
> ...foo...
> end
>
> And, if you want to make the execution a bit more
> efficient, put a reference in VehicleLocation to it's
> associated CollisionLocation. That way you can have
> "vehLoc : VehicleLocation(collisionLocation == null)" to
> reduce partial matches.
>
> --- On Fri, 7/24/09, PriyaSha <nash.8103(a)gmail.com>
> wrote:
>
> > From: PriyaSha <nash.8103(a)gmail.com>
> > Subject: [rules-users] Using eval in LHS
> > To: rules-users(a)lists.jboss.org
> > Date: Friday, July 24, 2009, 10:45 AM
> >
> > Input:
> > 0,0,107,32,0,0,0,10,53320,-1,-1,-1,-1,-1,-1
> > 0,0,107,32,0,0,0,10,53320,-1,-1,-1,-1,-1,-1
> > 0,0,107,32,0,0,0,10,53320,-1,-1,-1,-1,-1,-1
> > 0,0,107,32,0,0,0,10,53320,-1,-1,-1,-1,-1,-1
> > 0,0,109,20,0,0,0,19,100644,-1,-1,-1,-1,-1,-1
> > 0,0,109,20,0,0,0,19,100644,-1,-1,-1,-1,-1,-1
> > 0,0,106,28,0,0,0,26,137745,-1,-1,-1,-1,-1,-1
> > 0,0,108,32,0,0,0,67,354281,-1,-1,-1,-1,-1,-1
> > 0,0,105,30,0,0,1,94,501089,-1,-1,-1,-1,-1,-1
> >
> > Problem:
> >
> > Should find vehicles with same data (if it occurs more
> than
> > thrice).
> >
> > Though eval in rule 'Detect Accident' results in
> true,
> > consequence is not
> > fired.
> >
> > Output:
> >
> > Added
> > Not Found -- 107---2
> > test---2----107
> > Not Found -- 107---3
> > test---3----107
> > Not Found -- 107---4
> > test---4----107
> > no of veh : 1
> > no of veh : 1
> > no of veh : 1
> > Not Found -- 109---5
> > test---1----109
> > Not Found -- 109---6
> > test---2----109
> > Not Found -- 106---7
> >
> > Please find the DRL below.
> >
> >
> > package com.hp.hpl.CHAOS.LR;
> >
> > # importing classes
> > import java.lang.Integer;
> >
> > import java.util.ArrayList;
> > import java.util.HashMap;
> > import java.util.Iterator;
> >
> > import com.hp.hpl.CHAOS.Rules.VehicleLocation;
> >
> > global java.lang.String output
> >
> > declare VehicleLocation
> > @role ( event )
> > @expires ( 1m )
> > end
> >
> > declare Statistics
> > smashedcars : ArrayList
> > stopped_cars : ArrayList
> > accidents :
> ArrayList
> > collided_at : HashMap
> > end
> >
> > rule "Setup statistics"
> > salience 110
> > no-loop true
> > when
> > not( Statistics( ) )
> > vehLoc : VehicleLocation()
> > then
> > Statistics s = new Statistics();
> > s.setSmashedcars (new ArrayList());
> > s.setStopped_cars (new ArrayList());
> > s.getStopped_cars().add(vehLoc);
> > s.setCollided_at(new HashMap());
> > insert( s );
> >
> > System.out.println("Added");
> > end
> >
> > rule "Add to stopped cars"
> > salience 100
> > no-loop true
> > when
> > vehLoc : VehicleLocation()
> > $stat : Statistics ()
> > ((not( VehicleLocation(vid ==
> > vehLoc.vid) from $stat.getSmashedcars())))
> > then
> > modify($stat) {
> >
> > getStopped_cars().add(vehLoc);
> > }
> > System.out.println("Not Found
> -- " +
> > vehLoc.getVid() + "---" +
> > $stat.getStopped_cars().size());
> > end
> >
> >
> > rule "Identify Collided Vehicles"
> > salience 90
> > no-loop true
> > when
> > vehLoc : VehicleLocation()
> > $stat : Statistics ()
> > $allStoppedcars : ArrayList(
> size > 0
> > )
> > from
> > collect ( VehicleLocation(xway == vehLoc.xway, pos ==
> > vehLoc.pos, dir == vehLoc.dir, lane == vehLoc.lane)
> from
> > $stat.stopped_cars)
> > then
> > System.out.println("test" +
> "---" +
> > $allStoppedcars.size() + "----" +
> > vehLoc.getVid());
> >
> > modify($stat) {
> >
> > setCollided_at(collided_at($allStoppedcars,
> > vehLoc.getXway(),
> > vehLoc.getPos(), vehLoc.getDir(), vehLoc.getLane()));
> > }
> > retract (vehLoc);
> > end
> >
> > rule "Detect Accident"
> > salience 80
> > no-loop true
> > when
> > vehLoc : VehicleLocation()
> > $stat : Statistics ()
> >
> > eval(collision_occured($stat.getCollided_at()))
> > then
> > System.out.println("Detect
> Accident");
> > end
> >
> > function HashMap collided_at(ArrayList stopped_cars,
> int x,
> > int pos, int
> > dir, int lane) {
> > HashMap collided_at = new
> HashMap();
> > for (Iterator iterator =
> > stopped_cars.iterator(); iterator.hasNext(); )
> > {
> > VehicleLocation
> vehLoc =
> > (VehicleLocation) iterator.next();
> > if
> (vehLoc.getXway() == x
> >
> &&
> > vehLoc.getPos() == pos
> >
> &&
> > vehLoc.getDir() == dir
> >
> &&
> > vehLoc.getLane() == lane) {
> >
> >
> int key =
> > vehLoc.getVid();
> >
> if
> > (!collided_at.containsKey(key)) {
> >
>
> > collided_at.put (key, new Integer(1));
> >
>
> > continue;
> > }
> >
> collided_at.put
> > (key,
> > ((Integer)collided_at.get(key)).intValue()+1);
> > }
> > }
> > return collided_at;
> > }
> >
> > function boolean collision_occured(HashMap
> > collided_vehicles) {
> > java.util.Set entries =
> > collided_vehicles.entrySet();
> > int noOfCollidedVehicles = 0;
> > java.util.Iterator iterator =
> > entries.iterator();
> >
> > while ( iterator.hasNext() )
> {
> >
> java.util.Map.Entry object =
> > (java.util.Map.Entry) iterator.next();
> > if
> ((Integer)object.getValue()
> > > 3) {
> >
> > noOfCollidedVehicles += 1;
> > }
> > }
> >
> > if (noOfCollidedVehicles >
> 0) {
> >
> System.out.println("no of veh :
> > " + noOfCollidedVehicles);
> > return true;
> > }
> > return false;
> > }
> >
> > Please let me know what should I correct here.
> > --
> > View this message in context: http://www.nabble.com/Using-eval-in-LHS-tp24646946p24646946.html
> > Sent from the drools - user mailing list archive at
> > Nabble.com.
> >
> > _______________________________________________
> > rules-users mailing list
> > rules-users(a)lists.jboss.org
> > https://lists.jboss.org/mailman/listinfo/rules-users
> >
>
>
>
>
> _______________________________________________
> rules-users mailing list
> rules-users(a)lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
>
> _______________________________________________
> rules-users mailing list
> rules-users(a)lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
15 years, 5 months