Executing BRMS Snap shot
by SB.Raghavendra
Hi All,
I have a snaphot URL as :
http://localhost:8080/drools-jbrms/org.drools.brms.JBRMS/package/org.acme...
.
I configured above URL in one propertied file and accessing in one class i
written flollowing code in the class that iam going to execute.
private static RuleBase loadRuleBaseFromRuleAgent() {
RuleAgent agent = RuleAgent.newRuleAgent(
"/brmsdeployedrules.properties" );
RuleBase rulebase = agent.getRuleBase();
return rulebase;
}
*But iam getting following error :*
RuleAgent(insuranceconfig) INFO (Mon Mar 03 18:52:13 PST 2008): Configuring
with newInstance=true, secondsToRefresh=30
RuleAgent(insuranceconfig) INFO (Mon Mar 03 18:52:13 PST 2008): Configuring
package provider : URLScanner monitoring URLs:
http://localhost:8080/drools-jbrms/org.drools.brms.JBRMS/package/org.acme...
RuleAgent(insuranceconfig) EXCEPTION (Mon Mar 03 18:52:18 PST 2008):
org.drools.rule.PackageCompilationData. Stack trace should follow.
java.lang.ClassNotFoundException: org.drools.rule.PackageCompilationData
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at org.apache.maven.surefire.booter.IsolatedClassLoader.loadClass(
IsolatedClassLoader.java:100)
at java.lang.ClassLoader.loadClassInternal(Unknown Source)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Unknown Source)
at java.io.ObjectInputStream.resolveClass(Unknown Source)
at org.drools.common.DroolsObjectInputStream.resolveClass(
DroolsObjectInputStream.java:83)
at java.io.ObjectInputStream.readNonProxyDesc(Unknown Source)
at java.io.ObjectInputStream.readClassDesc(Unknown Source)
at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
at java.io.ObjectInputStream.readObject0(Unknown Source)
at java.io.ObjectInputStream.readObject(Unknown Source)
at org.drools.rule.Package.readExternal(Package.java:177)
at java.io.ObjectInputStream.readExternalData(Unknown Source)
at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
at java.io.ObjectInputStream.readObject0(Unknown Source)
at java.io.ObjectInputStream.readObject(Unknown Source)
at org.drools.agent.HttpClientImpl.fetchPackage(HttpClientImpl.java:54)
at org.drools.agent.URLScanner.readPackage(URLScanner.java:137)
at org.drools.agent.URLScanner.getChangeSet(URLScanner.java:109)
at org.drools.agent.URLScanner.loadPackageChanges(URLScanner.java:88)
at org.drools.agent.RuleAgent.checkForChanges(RuleAgent.java:330)
at org.drools.agent.RuleAgent.refreshRuleBase(RuleAgent.java:298)
at org.drools.agent.RuleAgent.configure(RuleAgent.java:284)
at org.drools.agent.RuleAgent.init(RuleAgent.java:208)
at org.drools.agent.RuleAgent.newRuleAgent(RuleAgent.java:176)
at org.drools.agent.RuleAgent.newRuleAgent(RuleAgent.java:148)
at org.drools.agent.RuleAgent.newRuleAgent(RuleAgent.java:216)
at org.acme.insurance.web.InsuranceSessionHelper.loadRuleBaseFromRuleAgent(
InsuranceSessionHelper.java:26)
at org.acme.insurance.web.InsuranceSessionHelper.getSession(
InsuranceSessionHelper.java:17)
at org.acme.insurance.test.SupplementalInfoTest.setUp(
SupplementalInfoTest.java:23)
at junit.framework.TestCase.runBare(TestCase.java:125)
at junit.framework.TestResult$1.protect(TestResult.java:106)
at junit.framework.TestResult.runProtected(TestResult.java:124)
at junit.framework.TestResult.run(TestResult.java:109)
at junit.framework.TestCase.run(TestCase.java:118)
at junit.framework.TestSuite.runTest(TestSuite.java:208)
at junit.framework.TestSuite.run(TestSuite.java:203)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.apache.maven.surefire.junit.JUnitTestSet.execute(JUnitTestSet.java
:210)
at
org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(
AbstractDirectoryTestSuite.java:135)
at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(
AbstractDirectoryTestSuite.java:122)
at org.apache.maven.surefire.Surefire.run(Surefire.java:129)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(
SurefireBooter.java:225)
at org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java
:747)
RuleAgent(insuranceconfig) WARNING (Mon Mar 03 18:52:18 PST 2008): Was
unable to load a class when loading a package. Perhaps it is missing from
this application.
Please help me out to resolve the above issue...
--
Regards,
SB.Raghavendra.
16 years, 8 months
Errors building from sources.
by Pedro Costa
Hi All,
I'm trying to build from source the 4.0.x branche but some of the tests are
failing and connet build sucessfull.
This is the errror I'm getting:
Running org.drools.integrationtests.DynamicRulesTest
org.drools.RuntimeDroolsException: Unable to load dialect '
org.drools.rule.builder.dialect.java.JavaDialectConfiguration:java'
at org.drools.compiler.PackageBuilderConfiguration.addDialect(
PackageBuilderConfiguration.java:160)
at
org.drools.compiler.PackageBuilderConfiguration.buildDialectConfigurationMap
(PackageBuilderConfiguration.java:146)
at org.drools.compiler.PackageBuilderConfiguration.init(
PackageBuilderConfiguration.java:121)
at org.drools.compiler.PackageBuilderConfiguration.<init>(
PackageBuilderConfiguration.java:98)
at org.drools.compiler.PackageBuilder.<init>(PackageBuilder.java
:124)
at org.drools.compiler.PackageBuilder.<init>(PackageBuilder.java:86)
at
org.drools.integrationtests.DynamicRulesTest.testDynamicRulesAddRemove(
DynamicRulesTest.java:540)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(
NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(
DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at junit.framework.TestCase.runTest(TestCase.java:154)
at junit.framework.TestCase.runBare(TestCase.java:127)
at junit.framework.TestResult$1.protect(TestResult.java:106)
at junit.framework.TestResult.runProtected(TestResult.java:124)
at junit.framework.TestResult.run(TestResult.java:109)
at junit.framework.TestCase.run(TestCase.java:118)
at junit.framework.TestSuite.runTest(TestSuite.java:208)
at junit.framework.TestSuite.run(TestSuite.java:203)
at sun.reflect.GeneratedMethodAccessor10.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(
DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.apache.maven.surefire.junit.JUnitTestSet.execute(
JUnitTestSet.java:213)
at
org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(
AbstractDirectoryTestSuite.java:138)
at
org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(
AbstractDirectoryTestSuite.java:125)
at org.apache.maven.surefire.Surefire.run(Surefire.java:132)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(
NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(
DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at
org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(
SurefireBooter.java:290)
at org.apache.maven.surefire.booter.SurefireBooter.main(
SurefireBooter.java:818)
Caused by: java.lang.ClassCastException:
org.drools.rule.builder.dialect.java.JavaDialectConfiguration
at org.drools.compiler.PackageBuilderConfiguration.addDialect(
PackageBuilderConfiguration.java:155)
... 31 more
Any ideas of what could be wrong here?
Thanks!
Pedro.
16 years, 9 months
New version of Combis Rule Editor
by Marko Frankovic
Greetings
After months of inactivity we have finally released a new version of MSM
Combis Rule Editor.
Main features:
- Fully graphical rule representation
- Parser for drools, oracle and HQL/SQL
- Fast rule testing using HQL/SQL
- Replay of rule fireing (for drools only)
- save/load capabilities
- HTML representation
- Rule packaging
- One rule per graph
- Graphs are stored in a package for easier manipulation/overview
and more...
Java 1.5 required, java 1.6 recommended
Download it from http://www.sourceforge.net/projects/droolsruleedit and tell
us what you think of it
Any feedback is welcome.
MSM Team
16 years, 9 months
Is there any way to get the original eval expression through AfterActivationFiredEvent event?
by manrai.java
Hi,
I am using JBoss rules 3.0.6 to externalize all business rules. We have a
requirement were in we want to create a audit report after rules have been
executed. For each rule, we need to track Desired Condition Value(as
specified in when part), Actual Condition Value(value in asserted object)
and so on.
I looked into Event Model API's and was able to successfully fetch required
data from call back methods provided by DefaultAgendaEventListener for most
of the rules.
However, In my application there are some rules which use EvalCondition(I
know that using eval is not a good idea but it will remain like this for
quite some time). I am not able to fetch required data from EvalExpression.
On introspecting Eval Expression i am getting something like (proxy object):
TestIt.Rule_FirstRuleToTest_0Eval0Invoker@feefa5e0
What i am expecting is something like below:
**
*eval*( Income.getGrossIncome().doubleValue() == 10001)
Is there any way to get the original eval expression through
AfterActivationFiredEvent event?
Regards,
Mohit Manrai
16 years, 9 months
startProcess("String") on StatefulSession.
by SB.Raghavendra
I am getting one exception as : No SuchMethod Exception session.startProcess
(Ljava.lang.String) when i executing the following code in one of the class
:
public static StatefulSession getSession() {
if ( rulebase == null ) {
rulebase = loadRuleBaseFromRuleAgent();
}
session = rulebase.newStatefulSession();
System.out.println("strting process...");
session.startProcess("insuranceProcess");
System.out.println("Started Process..");
return session;
}
In above code if i commented out line :
session.startProcess("insuranceProcess");(In
above code..) the error was resolved and executing properly..
please let me know why we need to code :
session.startProcess("insuranceProcess");.if
i am not using startProcess("String") method,Does it create any session
problem anywhere.Please guide me on this.......
--
Regards,
SB.Raghavendra.
16 years, 9 months
checking for complex conditions
by Jai Vasanth
Hi,
Suppose I have a class Foo with integers a, b and c ( methods getA getB
and getC respectively ) and I Want to check if an object of Foo satisfies
a - (b + c) > 0
Is this the best way I go about doing this ?
rule "Foo check"
when
Foo( varA : a , varB:b, varC:c )
eval( varA - (varB + varC) > 0 )
then
<do actions>
end
Writing this as
rule "Foo check"
when
Foo( a - (b + c) > 0 )
then
<do actions>
end
doesnt seem to work. Its not able to find the variables (a, b and c ) from
the getA getB and get C methods.
Thanks
Jai
16 years, 9 months
Re: [rules-users] Strange exception
by Edson Tirelli
Are you using "contains" operator to check a hashmap for the existence of
a value? "contains" should only be used with collections, not maps...
[]s
Edson
2008/3/4, Brian Trezise <Brian.Trezise(a)intellidata.net>:
>
> I'm getting a strange exception upon inserting an object into working
> memory. Relevant information follows:
>
> I'm creating a "smartdescription" which contains a string and some
> information about that string that is later added by the rules. With the
> exception of one specific string, this seems to be working perfectly. I'm
> using regexes to match the strings.
>
>
>
> This is the regex where I'm having the problem:
>
> public static final String REGEX_APPLICATION_CURRENT_SENSE = ".*(" +
> "CURRENT[ .]?SENSE?" + ").*";
>
>
>
> and the smartdescription string I'm testing is "aaaaaaaaaaaaaaaaaaa
> current sense aaaaaaaaaaaaa".
>
>
>
> I have determined that any other string that matches any of the
> identically formulated rules works with no problems. If I put in something
> that doesn't match this regex, there is no exception. The RHS of the rule
> in question is not reached in this case.
>
>
>
> This is the exception:
>
> *java.lang.ClassCastException*: java.util.HashMap
>
> at
> org.drools.base.evaluators.ObjectFactory$ObjectContainsEvaluator.evaluate(
> *ObjectFactory.java:433*)
>
> at org.drools.rule.LiteralRestriction.isAllowed(*
> LiteralRestriction.java:61*)
>
> at org.drools.rule.LiteralConstraint.isAllowed(*
> LiteralConstraint.java:82*)
>
> at org.drools.reteoo.AlphaNode.assertObject(*AlphaNode.java
> :132*)
>
> at
> org.drools.reteoo.SingleObjectSinkAdapter.propagateAssertObject(*
> SingleObjectSinkAdapter.java:22*)
>
> at org.drools.reteoo.AlphaNode.assertObject(*AlphaNode.java
> :140*)
>
> at
> org.drools.reteoo.CompositeObjectSinkAdapter.propagateAssertObject(*
> CompositeObjectSinkAdapter.java:318*)
>
> at org.drools.reteoo.ObjectTypeNode.assertObject(*
> ObjectTypeNode.java:153*)
>
> at org.drools.reteoo.Rete.assertObject(*Rete.java:175*)
>
> at org.drools.reteoo.ReteooRuleBase.assertObject(*
> ReteooRuleBase.java:192*)
>
> at org.drools.reteoo.ReteooWorkingMemory.doInsert(*
> ReteooWorkingMemory.java:71*)
>
> at org.drools.common.AbstractWorkingMemory.insert(*
> AbstractWorkingMemory.java:909*)
>
> at org.drools.common.AbstractWorkingMemory.insert(*
> AbstractWorkingMemory.java:881*)
>
> at org.drools.common.AbstractWorkingMemory.insert(*
> AbstractWorkingMemory.java:682*)
>
> at
> net.intellidata.sleuth.description.DefinitionRuleTest.testApplicationRules
> (*DefinitionRuleTest.java:129*)
>
> at sun.reflect.NativeMethodAccessorImpl.invoke0(*Native Method
> *)
>
> at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
>
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown
> Source)
>
> at java.lang.reflect.Method.invoke(Unknown Source)
>
> at junit.framework.TestCase.runTest(*TestCase.java:154*)
>
> at junit.framework.TestCase.runBare(*TestCase.java:127*)
>
> at junit.framework.TestResult$1.protect(*TestResult.java:106*)
>
> at junit.framework.TestResult.runProtected(*TestResult.java
> :124*)
>
> at junit.framework.TestResult.run(*TestResult.java:109*)
>
> at junit.framework.TestCase.run(*TestCase.java:118*)
>
> at
> org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(*
> JUnit3TestReference.java:130*)
>
> at org.eclipse.jdt.internal.junit.runner.TestExecution.run(*
> TestExecution.java:38*)
>
> at
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(*
> RemoteTestRunner.java:460*)
>
> at
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(*
> RemoteTestRunner.java:673*)
>
> at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(
> *RemoteTestRunner.java:386*)
>
> at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main
> (*RemoteTestRunner.java:196*)
>
>
>
> Any idea what could be causing this???
>
>
>
> DefinitionRuleTest.java:129 is
>
> workingMemory.insert(sd);
>
>
>
> Thanks,
>
> *___________________________________________________
> Brian Trezise
> Staff Software Engineer
> IntelliData, Inc
> *3173 s. uravan way
> aurora, colorado 80013
> T: 720.524.4864
> brian.trezise(a)intellidata.net
>
>
>
> _______________________________________________
> rules-users mailing list
> rules-users(a)lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
>
--
Edson Tirelli
JBoss Drools Core Development
Office: +55 11 3529-6000
Mobile: +55 11 9287-5646
JBoss, a division of Red Hat @ www.jboss.com
16 years, 9 months
WorkingMemory deserializing problem.
by Pedro Costa
Hi All,
I'm having the following error while deserialing a workingmemory object:
java.lang.ClassNotFoundException:
com.oss.activation.rules.core.types.StepShadowProxy
at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:268)
at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:242)
at java.io.ObjectInputStream.resolveClass(ObjectInputStream.java:584)
at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java
:1543)
at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1465)
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java
:1698)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1304)
com.oss.activation.rules.core.types.Step is one of ower types that are in
the WorkingMemory as facts. I don't know about
com.oss.activation.rules.core.types.StepShadowProxy, I supose is a DROOLS
generated class.
Any ideas of what could be wrong here?
Thanks!
Pedro Costa.
16 years, 9 months
Strange exception
by Brian Trezise
I'm getting a strange exception upon inserting an object into working
memory. Relevant information follows:
I'm creating a "smartdescription" which contains a string and some
information about that string that is later added by the rules. With the
exception of one specific string, this seems to be working perfectly. I'm
using regexes to match the strings.
This is the regex where I'm having the problem:
public static final String REGEX_APPLICATION_CURRENT_SENSE = ".*(" +
"CURRENT[ .]?SENSE?" + ").*";
and the smartdescription string I'm testing is "aaaaaaaaaaaaaaaaaaa current
sense aaaaaaaaaaaaa".
I have determined that any other string that matches any of the identically
formulated rules works with no problems. If I put in something that doesn't
match this regex, there is no exception. The RHS of the rule in question is
not reached in this case.
This is the exception:
java.lang.ClassCastException: java.util.HashMap
at
org.drools.base.evaluators.ObjectFactory$ObjectContainsEvaluator.evaluate(Ob
jectFactory.java:433)
at
org.drools.rule.LiteralRestriction.isAllowed(LiteralRestriction.java:61)
at
org.drools.rule.LiteralConstraint.isAllowed(LiteralConstraint.java:82)
at org.drools.reteoo.AlphaNode.assertObject(AlphaNode.java:132)
at
org.drools.reteoo.SingleObjectSinkAdapter.propagateAssertObject(SingleObject
SinkAdapter.java:22)
at org.drools.reteoo.AlphaNode.assertObject(AlphaNode.java:140)
at
org.drools.reteoo.CompositeObjectSinkAdapter.propagateAssertObject(Composite
ObjectSinkAdapter.java:318)
at
org.drools.reteoo.ObjectTypeNode.assertObject(ObjectTypeNode.java:153)
at org.drools.reteoo.Rete.assertObject(Rete.java:175)
at
org.drools.reteoo.ReteooRuleBase.assertObject(ReteooRuleBase.java:192)
at
org.drools.reteoo.ReteooWorkingMemory.doInsert(ReteooWorkingMemory.java:71)
at
org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:90
9)
at
org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:88
1)
at
org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:68
2)
at
net.intellidata.sleuth.description.DefinitionRuleTest.testApplicationRules(D
efinitionRuleTest.java:129)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown
Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at junit.framework.TestCase.runTest(TestCase.java:154)
at junit.framework.TestCase.runBare(TestCase.java:127)
at junit.framework.TestResult$1.protect(TestResult.java:106)
at junit.framework.TestResult.runProtected(TestResult.java:124)
at junit.framework.TestResult.run(TestResult.java:109)
at junit.framework.TestCase.run(TestCase.java:118)
at
org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3T
estReference.java:130)
at
org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:3
8)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRu
nner.java:460)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRu
nner.java:673)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.
java:386)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner
.java:196)
Any idea what could be causing this???
DefinitionRuleTest.java:129 is
workingMemory.insert(sd);
Thanks,
___________________________________________________
Brian Trezise
Staff Software Engineer
IntelliData, Inc
3173 s. uravan way
aurora, colorado 80013
T: 720.524.4864
brian.trezise(a)intellidata.net
16 years, 9 months
Compare two variables in Web based BRMS
by Sergio Soria Olivares
Hi, I have a problem in the web interface drools-brms when I try to
compare two variables, one of them with null value. If I try to compare
with this situation, the system throws a nullPointerException, and I
can't do anything. If I assign a value to this variable, the system
works perfect.
Nevertheless, if I do the same in the eclipse drools tool, all do
perfect, and I can give a null value for a variable, because later the
variable will recover the value in the program, when the rule is call.
Pleased help me, because I think that it's a great bug.
Lot of thanks.
16 years, 9 months