documentation tools in use ?
by Darrin Mison
Are there any specific tools that are used by the Drools documenters
for authoring their docbook XML?
15 years, 6 months
Lasse Wallentin is out of the office.
by Lasse.Wallentin@APCC.com
I will be out of the office starting 05-05-2009 and will not return until
20-05-2009.
I will respond to your message when I return.
15 years, 6 months
Drools 5 Final location
by J. Michael Dean
Where can I locate the 5.00 FINAL artifacts? On Hudson the revisions
are way beyond this version; I found everything on SVN but not eager
to try to build it myself. Sorry for probable idiotic question.
15 years, 6 months
Guvnor Enumerations; values to be taken from db table
by Premkumar Stephen
Hello,
We would like to have an enumeration that grabs values from a db table. We
will have a list of clients, which change quite regularly.
Maybe not at real-time, but at the time guvnor is started or something to
that effect.
Currently it is hard-coded. Has someone implemented something similar to
this effect?
If it could pick up from a flat-file which is on the path and the file name
could be configured, it would be workable. We could query the db and load
the flat-file.
Please let me know if you have other work-arounds for this scenario.
Regards,
Prem
15 years, 6 months
Guvnor Package Builds & The EGT w/ver. 5.0.0 CR1
by Ingold, Jonathan
Hello,
I use Guvnor's repository to store, organize and deploy our rules.
However Eclipse Ganymede with the Eclipse Guvnor Toolkit is used for all
of our editing and testing.
My question is this: After making a change to a rule (we use drls only)
I save the local copy and commit it to Guvnor. However, when I run a
test class that checks to make sure these changes went into effect they
do not. In order for the changes to truly become effective, I must
rebuild the rule package in Guvnor. The .properties file has
newInstance=true which according to the comments "means the RuleBase
will be created fresh whenever there are changes".
I would really rather not have to switch over to guvnor and rebuild the
package anytime I make even a minor change in my rules for testing.
Does anyone know a way around this or am I doing something foolish
without realizing it?
Thanks,
Jon
15 years, 6 months
Re: [rules-users] Hibernate proxy objects equality tests failing in Drools 5
by Guto
I was following that subject on markmail, and them I've enterred the
user-group (so subject and body are coppied from them). I've got the
exactly same problem. When I use the rules with objects the came from the
database (thru JPA hibernate provider), thouse rules never match. When I
do the same from Pojos hand made for unit test, it work.
I don't know what really happen, but i'm sure that it is an equality test
falling 'cause of the hibernate proxys.
I don't get also any kind of error or exception, since it ALL WORK. Just
the rule isn't be acomplished.
I'm using EJB3 + JPA (hibernate provider) and Drools 4 GA;
thanks in advance for any help
--
Guto Maia
CSM - SCJP- SCWCD - SCBCD - ZCE
Chris,
When you use "==" in a DRL field constraint (not eval), drools always
translates it into an .equals() call.
Having said that, there might be other problems, since drools must rely on
object identity for some internal data structures... for instance, we use
IdentityMaps for mapping FactHandles and the actual fact objects, etc.
We would need to test this and see what can be done. Could you please open
a JIRA and attach a test case so that we can reproduce the problem?
Thanks, Edson
2009/4/26 CK <chri...(a)gmail.com>
Hi,
I'm testing out some simple codes using Hibernate and Drools 5 and I'm
hitting an issue with hibernate proxy objects.
With the newer version of hibernate, Javassist is used to proxy some
hibernate objects. By doing this, hibernate objects essentially cannot use
== comparisons, which is fine.
However, this is causing issue in equality checks within Drools 5 LHS
evaluations of hibernate persistent objects.
Let's say for example I have the following Hibernate objects:
class Parent { Child child; }
class Child { String name; }
normally, if you output Parent.child, it should be Child.class. But under
Hibernate, the child property in Parent may be proxied and enhanced with
Javassist, thus making Parent.child.class to be something like
"Child_$$_javassist_75".
Inside Drools, in the LHS:
when $child : Child() $parent : Parent(child == $child) then ... end
Assume that I have insert separate Child instances here that were
retrieved from an Hibernate query directly. Assume that I have also
inserted Parent instances that were retrieved from a separate query
without eager fetching. Given this particular case, the above rule would
not match even though it technically should. Under normal java code, using
equality, the parent's child is equal to the child.
According to MVEL language, which Drools LHS may not necessarily be using,
equality between two objects are compared using values. Not sure exactly
what that means.
Either way, this seems to be a rather unfortunate problem for using Drools
to work with Hibernate objects. Older hibernate versions didn't cause this
problem.
It seemed like jBPM had a similar problem according to the following doc:
http://www.jboss.org/community/docs/DOC-11169
Excerpt:
Object identity and object equality
MAKE SURE TO USE ALWAYS .equals AND NEVER == comparisons in the Java code.
Typically, in the PVM Java objects, we want to use the default object
identity as the object equality. But hibernate persistence breaks this
(even within the scope of one hibernate session) because of the proxies.
So we have to apply a trick in order to make the comparison between a
persistent object and its proxy return true. See jBPM 3 class EqualsUtil
for that trick.
So my question is whether Drools uses equality or identity when it comes
to comparing values in LHS constraints. Is there a way to get around this
issue?
-Chris
_______________________________________________ rules-users mailing list
rule...(a)lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users
-- Edson Tirelli JBoss Drools Core Development JBoss, a division of Red
Hat @ www.jboss.com
_______________________________________________ rules-users mailing list
rule...(a)lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users
15 years, 6 months
Drools 5, RuleFlow doubt
by Kevin Alonso
Hi,
Into a action element, how can I read or get the classes that were in
working memory ?
Thanks,
Kevin
15 years, 6 months
Guvnor - assigning roles to users
by Darrin Mison
The Drools 5 guvnor guide states that you can specify the admin role
for a user in your JAAS login configuration.
"It is also possible (thanks to JAAS) to define what users have the
"admin" role for Guvnor"
This is also stated here: http://magazine.redhat.com/2008/08/12/jboss-drools-how-to-tuning-guvnor-p...
I can't get this to work, the only way I can assign roles to users is
using the web UI.
Is this a bug or are the docs out of date ? Or am I missing something ?
server/default/deploy/jboss-brms.war/WEB-INF/components.xml
<security:identity authenticate-method="#{authenticator.authenticate}"
jaas-config-name="brms"/>
<security:role-based-permission-resolver enable-role-based-
authorization="true"/>
server/default/conf/login-config.xml:
<application-policy name="brms">
<authentication>
<login-module
code="org.jboss.security.auth.spi.UsersRolesLoginModule"
flag="required">
<module-option name="usersProperties">props/brms-
users.properties</module-option>
<module-option name="rolesProperties">props/brms-
roles.properties</module-option>
</login-module>
</authentication>
</application-policy>
server/default/conf/props/brms-users.properties
admin=admin123
server/default/conf/props/brms-roles.properties
admin=admin
15 years, 6 months
ascendant compatibility drools 4.0 <-> drools 2.0 ?
by Gab Aldien
Hi everybody
Short presentation since this is my first time posting there. I am a french
engineering student at the end of his studies, and I am currently working as
a trainee on a project where I have to make a lot of software working
together. I am currently studying a way to correlate alarms sent by a lot of
equipements from a network (type NMS), using openOSS' correlation module,
which was using drools 2.0 beta 2.1
But since it seems the current stable version is drools 4.0, I am thinkint
about using it instead. But if I do so, I will have to bother about
ascendant compability. The programm from openOSS is using drools through
JSR94 interface. Do you think there will be any problem? Where can I find a
good page relating major changes in drools since drools 2.0?
Other question: my project is really ambitious, and I plan to use rules
which will adapt to the topology of the network. Depending on what is
possible in drools, I am thinking about creating a program which will use a
file containing static rules and another one containing the topology of the
network to remotely generate new rules each time I change the network
topology. But maybe this dynamic rule generation is already available in
drools? What do you think?
Thank you very much
Aldian
15 years, 6 months
setGlobal issue in StatefulSession
by tellkb
Hi there,
I want to set setGlobal in working memory at run time based on derived
class, e.g. DerivedOne or DerivedTwo. But it throws following error:
Illegal class for global. Expected [org.comp.app.bean.Base], found
[org.comp.app.bean.DerivedOne].
It should automatically resolve the derived class. Please let me know if I'm
doing something wrong. I'd appreciate your help.
Thanks,
-KB
Here are the classed I'm using in my test project:
class abstract Base () {
public void init( StatefulSession workingMemory ) {
this.workingMemory = workingMemory;
workingMemory.setGlobal("app", this);
}
public void logMe() {
System.out.println("From Derived BASE...");
}
}
class DerivedOne() extends Base{
public void runRules( Object obj) {
ObjOne obj1 = (ObjOne)obj
workingMemory.insert(obj1);
workingMemory.fireAllRules();
workingMemory.dispose();
}
public void logMe() {
System.out.println("From Derived ONE...");
}
}
class DerivedTwo() extends Base{
public void runRules( Object obj) {
ObjTwo obj2 = (ObjTwo)obj
workingMemory.insert(obj2);
workingMemory.fireAllRules();
workingMemory.dispose();
}
public void logMe() {
System.out.println("From Derived ONE...");
}
}
class Caller() {
RuleBase ruleBase = ruleBaseFactory.open(docRules);
workingMemory = ruleBase.newStatefulSession();
if (sub==1) {
der1 = new DerivedOne();
der1.init(workingMemory);
der1.runRules();
}
else if (sub==1) {
der2 = new DerivedTwo();
der2.init(workingMemory);
der2.runRules();
}
}
//********DRL FILE*****
package com.sample
import com.sample.app.RuleCaller.Message;
global com.sample.app.Base app;
rule "using a static function"
when
eval( true )
then
System.out.println( "Message from Rule." );
app.logMe();
end
//********DRL FILE*****
--
View this message in context: http://www.nabble.com/setGlobal-issue-in-StatefulSession-tp23373008p23373...
Sent from the drools - user mailing list archive at Nabble.com.
15 years, 6 months