Drools 4.0 problem: insert (drl) not reflected StatefulSession.
by Michael Waluk
I just upgraded to Drools 4.0 and changed my assertObject calls to insert.
I also switched from WorkingMemory to StatefulSession. The rules seem to be
fine, but I am not able to retrieve any inserted objects from the working
memory for some reason. Here is what I'm doing. I'd appreciate any
suggestions...
StatefulSession *workingMemory* = getActiveWorkingMemories(id);
*workingMemory*.fireAllRules();
// Here is the rule that fires:
*
rule* "RecognizeBenefitsProgramEvent" *
** when* $edit: BenefitsProgramModelEdit()
* then*
* insert* (*new* *BenefitsProgramEvent*("BenefitsProgramEvent",
$edit.getValidFrom(), "AnnualEnrollmentEvent")); *
** System*.out.println("Rule RecognizeBenefitsProgramEvent fired "); *
**end*
I see the print statement in the console but the inserted object is not
actually in the working memory. I look using this:
Iterator events = *workingMemory*.iterateObjects(new ClassObjectFilter(
BenefitsProgramEvent.class));
This iterator is empty. I also debug and look at the assetMap inside
workingMemory and it never changes.
Thanks,
Michael
18 years, 5 months
Help
by grupo cft ing sostware
hello to all,
I need help when running a rule of example I come up against the following
error:
*
org.drools.RuntimeDroolsException*: Unable to load dialect '
org.drools.rule.builder.dialect.java.JavaDialectConfiguration:*java'*
*at* org.drools.compiler.PackageBuilderConfiguration.*buildDialectRegistry*(
*PackageBuilderConfiguration.java:138*)
at org.drools.compiler.PackageBuilderConfiguration.init(*
PackageBuilderConfiguration.java:114*)
at org.drools.compiler.PackageBuilderConfiguration.<init>(*
PackageBuilderConfiguration.java:87*)
at org.drools.compiler.PackageBuilder.<init>(*PackageBuilder.java:122*)
at org.drools.compiler.PackageBuilder.<init>(*PackageBuilder.java:88*)
at com.sample.DroolsTest.readRule(*DroolsTest.java:50*)
at com.sample.DroolsTest.main(*DroolsTest.java:21*)
Caused by: *java.lang.RuntimeException*: The Eclipse JDT Core jar is not in
the classpath
at org.drools.rule.builder.dialect.java.JavaDialectConfiguration.setCompiler
(*JavaDialectConfiguration.java:98*)
at org.drools.rule.builder.dialect.java.JavaDialectConfiguration.init(*
JavaDialectConfiguration.java:56*)
at org.drools.compiler.PackageBuilderConfiguration.buildDialectRegistry(*
PackageBuilderConfiguration.java:134*)
... 6 more
*I will be very grateful if they help me*
18 years, 5 months
Cryptic error message: org.drools.compiler.FunctionError@191394e
by Scott Reed
I have converted my 3.1 DRL to 4.0, think I have the dependencies worked out (removed
antlr-30ea8.jar) and now I am getting a cryptic error message from the DRL compiler:
Rules.getRuleBase. org.drools.compiler.FunctionError@191394e
org.drools.rule.InvalidRulePackage: org.drools.compiler.FunctionError@191394e
at org.drools.rule.Package.checkValidity(Package.java:412)
at org.drools.common.AbstractRuleBase.addPackage(AbstractRuleBase.java:292)
...
Am I missing something with the plugin, is my DRL so badly munged the compiler can't explain what's
wrong, or what?
Thanks,
Scott
18 years, 5 months
4.0 Dependencies
by Scott Reed
1) Please tell me where I can find the definitive list of dependencies for the 4.0 release.
The manual lists them but also says to look for README_DEPENDENCIES.txt in the lib dir but I do not
see it.
I am getting the following error:
Exception in thread "main" java.lang.NoSuchMethodError:
org.antlr.runtime.DFA.unpackEncodedString(Ljava/lang/String;)[S
at org.drools.lang.DRLParser.<clinit>(DRLParser.java:7223)
at org.drools.compiler.DrlParser.getParser(DrlParser.java:204)
at org.drools.compiler.DrlParser.parse(DrlParser.java:60)
at org.drools.compiler.PackageBuilder.addPackageFromDrl(PackageBuilder.java:158)
My classpath has antlr-3.0ea8.jar.
2) What am I missing?
18 years, 5 months
Tutorial
by Saleem Lakhani
Hi,
I am wondering how someone gets start with writing DRLs & DSLs without
any tutorials or guidelines. If there is one then please share it with
me.
It is urgent. I am using Drools 4.0.
Saleem Lakhani
18 years, 5 months
Eclispe Auto-Complete Problem
by dpark
Is it only me, but when I use the Eclipse plugin and when I auto-complete I
get every permutation of what I've specified in my dsl.
For example:
In dsl I've registered the following:
[condition]There is no calculated fact called "{name}"=not
CalculatedFact(name == "{name}")
In drl when I auto-complete in a condition, I get the following
possibilities:
* There
* There is
* There is no
* There is no calculated
* There is no calculated fact
* There is no calculated fact called
* There is no calculated fact called "{name}"
Ideally, all i want to show up is the last statement. Is there any way to
filter out all of the ones above it?
Dave
--
View this message in context: http://www.nabble.com/Eclispe-Auto-Complete-Problem-tf4285666.html#a12199559
Sent from the drools - user mailing list archive at Nabble.com.
18 years, 5 months
Function Call in LHS
by Rafael Alcemar
Hello guys! This is my first question for the list. I've defined a function
in my DRL file to evaluate if a user can do a specific operation in my
system. This function returns a boolean result. My question is if I can use
this function in the test of LHS.
For example:
rule "Cliente pode alugar"
when
eval(teste)
then
System.out.println("XXXXXX");
end
function boolean teste( ) {
return true;
}
Please, if anybody has some help, send me.
Thanks!
Rafael Alcemar
18 years, 5 months