Strengths of Drools
by FrankVhh
Hi all,
Suppose some kind of annoying manager asks you to list the strengths of
Drools, in stead of just letting you play with the tool.
What points would you definitely put on te list apart from:
- Open source
-> Low cost of purchase
-> Lot of flexibility to developer
- Performance
-> Outperforms even commercial tools according to some studies on the
internet
Why would you use drools in stead of a competitor's tool?
Thanks for your involvement.
Regards,
Frank
--
View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/Strengths-of-Drools-t...
Sent from the Drools - User mailing list archive at Nabble.com.
15 years, 1 month
Can't Deploy drools-server.war to JBoss 5.1.0.GA - ClassCastException
by rtmacphail
When attempting to deploy version 5.1 of the drools execution server
(drools-server.war) to JBoss AS 5.1.0.GA I receive the following
ClassCastException:
Caused by: java.lang.ClassCastException:
org.apache.xerces.jaxp.DocumentBuilderFactoryImpl cannot be cast to
javax.xml.parsers.DocumentBuilderFactory
I tried removing the xml-apis-2.0.2.jar from the lib directory of the
drools-server.war, but that resulted in xml parsing exceptions for the
spring and camel configuration files.
I tried adding a JBOSS-WEB.xml with the following class loader
configuration:
<class-loading java2ClassLoadingCompliance="false">
<loader-repository>
xml-apis:archive=drools-server.war
<loader-repository-config>java2ParentDelegation=false</loader-repository-config>
</loader-repository>
</class-loading>
but that had no effect.
The Drools Integration documentation says the following in regards to
deploying the execution server:
"Deploy on JBoss AS 4.x / Tomcat 6.x works out-of-the-box, instead some
external dependencies must be added and the configuration must be changed to
be deployed in JBoss AS 5"
Does anyone know what these external dependencies and configuration changes
are for JBoss AS 5?
By the way, I have been able to successfully deploy and test the server on
Tomcat 6.0.29.
Thanks in advance for any help; I've been spinning my wheels on this one.
--
View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/Can-t-Deploy-drools-s...
Sent from the Drools - User mailing list archive at Nabble.com.
15 years, 1 month
'From' Compilation Error with Interface Inheritance
by Sam Romano
Hey Everyone,
I am wondering if anyone is seeing this error I am. We are finally in
the process of upgrading from 5.0.1 to 5.1 final and some of our
existing rules are generating some cryptic error messages during the
KnowledgeBuilder stage.
I was finally able to recreate the error without using our code in a
blank Drools project using Drools 5.1 final, Java 6, so I'll present
the error using that example.
Here is the error message we get on compilation:
Unable to determine the used declarations.
[Error: not a statement, or badly formed structure]
[Near : {... Unknown ....}]
^
[Line: 1, Column: 0] : [Rule name='A stand alone rule']
Unable to build expression for 'from' : [Error: Failed to compile: 1
compilation error(s):
- (1,11) unqualified type in strict mode for: $someObject]
[Near : {... Unknown ....}]
^
[Line: 1, Column: 0] 'SomeUtilClass.getSomeObject($someObject)' :
[Rule name='A stand alone rule']
This error only seems to happen within the LHS using the from
conditional element. Here is the rule it is talking about:
rule "A stand alone rule"
when
$someObject : SomeClass();
$returnVal : Object() from SomeUtilClass.getSomeObject($someObject);
then
System.out.println("Fired");
end
Here are the definitions of the interfaces and utilities I'm using:
public interface SomeClass extends ClassB {
}
public interface ClassB extends ClassA {
}
public interface ClassA {
}
public class SomeUtilClass
{
public static Object getSomeObject(ClassA object)
{
return null;
}
}
Some interesting points to make: I can only get this error to occur
with interfaces. If you change SomeClass, ClassB and ClassA to public
class, this error does not occur. Also, interestingly, if you change
the definition of SomeClass to:
public interface SomeClass extends ClassA, ClassB {
}
The compilation errors goes away. However, if you switch the order of
ClassA and ClassB in this declaration, the error comes right back.
Another way I've found to get around this is to cast to ClassA in the
from expression as well, like so:
SomeClass.getSomeObject((ClassA)$someObject);
If you change the method signature for getSomeObject to
getSomeObject(ClassB object), then this also compiles fine.... It
seems that Drools is not picking up interface inheritance for
grandfather interfaces or higher level ancestors.
It almost seems like this is a possible MVEL error, but this error
only happens within the "from" conditional elements. If I put a
similar construct for my method call using an eval such as eval(
SomeUtilClass.getSomeObject($someObject) != null); then it compiles
fine. I tried digging into the MVELDialect, but got lost pretty
quickly.
By the way, this error does not come up in the 5.0.1 or prior
baselines. It does, however, comes up in every version after (5.1,
5.2M1). I've tried switching MVEL to non-strict mode explicitly and
that still did not change the outcome of this. What I don't
understand, obviously, is that the code I'm writing is not invalid
java code, so why is it suddenly failing in the newer versions? Also,
without having to change our code, is there another possible
workaround for this within the Drools or MVEL configurations?
Thanks for any support you can provide on this,
--
Sam Romano
(samrom3(a)gmail.com)
15 years, 2 months
Drools integration with JBOSS ESB
by Sathya Prakash
Hi ,
Did any one using Jboss esb for integrating drools? If yes then how to
handle exception suppose while executing my rules by calling custom class
an exception thrown at custom class should be sent to next actions.
--
Regards,
Sathya Prakash.
**
15 years, 2 months
JUnit Test failure when Eclipse library present on classpath
by StormeHawke
I'm not really sure what to make of this, but when the Drools Runtime library
is present on my project classpath, any of my junit tests that reference
Drools fail, but if I remove the runtime library from that same classpath,
everything runs as expected. The output in the console:
Build groovy files option has not been set one way or the other: use
'options.put(CompilerOptions.OPTIONG_BuildGroovyFiles,
CompilerOptions.ENABLED);'
(I'm not using groovy files of any kind)
But then I also get a really long stack trace in the JUnit output pane
(truncated once it reaches my code):
java.lang.NoClassDefFoundError: org/eclipse/core/runtime/Plugin
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:621)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:260)
at java.net.URLClassLoader.access$100(URLClassLoader.java:56)
at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:268)
at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
at
org.eclipse.jdt.internal.compiler.Compiler.initializeParser(Compiler.java:737)
at org.eclipse.jdt.internal.compiler.Compiler.<init>(Compiler.java:294)
at org.eclipse.jdt.internal.compiler.Compiler.<init>(Compiler.java:159)
at
org.drools.commons.jci.compilers.EclipseJavaCompiler.compile(EclipseJavaCompiler.java:349)
at
org.drools.commons.jci.compilers.AbstractJavaCompiler.compile(AbstractJavaCompiler.java:51)
at
org.drools.rule.builder.dialect.java.JavaDialect.compileAll(JavaDialect.java:389)
at
org.drools.compiler.DialectCompiletimeRegistry.compileAll(DialectCompiletimeRegistry.java:56)
at org.drools.compiler.PackageRegistry.compileAll(PackageRegistry.java:74)
at org.drools.compiler.PackageBuilder.compileAll(PackageBuilder.java:677)
at org.drools.compiler.PackageBuilder.addPackage(PackageBuilder.java:640)
at
org.drools.compiler.PackageBuilder.addPackageFromDrl(PackageBuilder.java:266)
at
org.drools.compiler.PackageBuilder.addKnowledgeResource(PackageBuilder.java:458)
at
org.drools.builder.impl.KnowledgeBuilderImpl.add(KnowledgeBuilderImpl.java:28)
at
net.intellidata.pricing.PricingEngine.cacheKnowledgeBase(PricingEngine.java:136)
To top it off, the same test runs fine on my boss's computer, but not on
mine. Neither of us is sure why. What am I missing?
--
View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/JUnit-Test-failure-wh...
Sent from the Drools - User mailing list archive at Nabble.com.
15 years, 2 months
getting details of facts triggering rules
by Archie Russell
Hi,
I've tried to figure this out but haven't been able to.
How can I, from the RHS, figure out the details of what triggered a rule.
I can access the facts individually by name, but how do I do it in a
generic fashion that would work in the RHS of any rule?
I am using decisiontables and want to be able to have a function that is
something like printTriggeringDetails()
I came across drools.getTuple but am not sure if that's the correct path
to go on. From there I get InternalFactHandles but don't know how to turn
those into human-readable facts.
Thanks for any help,
Archie
15 years, 2 months
dynamic class loading in drools 5.1
by saurabh maheshwari
hi ,
I am using drools 5.1 and i am creating one dynamic class .
Now How drools will aware of this dynamic class. It gives exception
that class not found .
So how i can say drools classloader that new class exist
Thanks & Regards
Saurabh
15 years, 2 months
Rules dont execute when republishing EAR on JBoss
by Ran Mochary
Hi,
I use Eclipse Galileo to deploy my EAR application and run a JBoss server
(version 5.1.0GA).
In order to work with Drools, I added the following jars under my JBoss
configuration lib/ folder: drools-api.jar, drools-compiler.jar,
drools-core.jar
My EAR include 2 .drl files - one is loaded and executed in a Servlet that
is loading on startup when JBoss is booting, and the other is loading and
running from the EJB layer.
When JBoss is launched from scratch, the rules get executed normally.
The rules get executed normally also when JBoss is stopped and started
again.
When I republish my EAR while JBoss is running, Eclipse will undeploy the
old EAR and redeploy the new EAR, as it would normally do.
However, in this case (republish/redeploy), no rules get executed except
rules with empty "when" clause.
I found a solution for this problem by replacing the 3 drools jar files from
version 5.1.1 to version 5.0.1.
In addition to my EAR, the JBoss server also runs Guvnor war. Guvnor 5.1.1
includes new features that I would like to use.
As I understand, reverting the 3 jars to 5.0.1 means I cannot use Guvnor
v5.1.1.
I would appreciate help with solving this problem.
Best regards,
Ran
Ran Mochary
Delegate Communications
15 years, 2 months
How to get correct version of rules based on effective date
by Faisal Shafique
Hi,
We are evaluating Drools to replace a big legacy eligibility system in government sector. One of the critical requirement is to have the system pull correct rule based on a date e.g interest rate was 5% till 12/31/2010 but changed to 6% from 1/1/2011. If we are running rules in 2010 or before, calculation should use 5% else it should use 6%. Rules will run with a user clicking a button and results will be shown to user so probably a StatelessSession will be used. Something like AgendaFilters to filter rules based on a date probably will not be very scalable since over time we'll have lot of different temporal version of rules and all of them will have to be in KnowledgeBase for AgendaFilter to work which will be memory intensive and un-needed.IMHO, we should build KnowledgeBase with correct version of rules in the first place. Any ideas or pointers?
Thanks
15 years, 2 months