classnotfound\classdefnotfound
by Wishing Carebear
Hello:
I have the drools5 embedded in an ear. When running aginst JBoss 5 gets the
following classnotfound exception but it works okay with websphere and
pramati application server. Wondering if someone could throw some pointers.
Please note that drools-compiler, drools-core etc are all in the ear and
added to the manifest.
Thanks,
cabear
java.lang.NoClassDefFoundError:
org/drools/base/extractors/BaseObjectClassFieldReader
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:621)
at
org.drools.base.ClassFieldAccessorCache$ByteArrayClassLoader.defineClass(ClassFieldAccessorCache.java:367)
at
org.drools.base.ClassFieldAccessorFactory.getClassFieldReader(ClassFieldAccessorFactory.java:135)
at
org.drools.base.ClassFieldAccessorCache$CacheEntry.getReadAccessor(ClassFieldAccessorCache.java:315)
at
org.drools.base.ClassFieldAccessorCache.getReadAcessor(ClassFieldAccessorCache.java:245)
at
org.drools.base.ClassFieldAccessorStore.wire(ClassFieldAccessorStore.java:379)
at
org.drools.base.ClassFieldAccessorStore.getReader(ClassFieldAccessorStore.java:97)
at
org.drools.base.ClassFieldAccessorStore.getReader(ClassFieldAccessorStore.java:74)
at
org.drools.rule.builder.PatternBuilder.getFieldReadAccessor(PatternBuilder.java:1031)
at org.drools.rule.builder.PatternBuilder.build(PatternBuilder.java:560)
at
org.drools.rule.builder.PatternBuilder.buildConstraint(PatternBuilder.java:235)
at org.drools.rule.builder.PatternBuilder.build(PatternBuilder.java:196)
at org.drools.rule.builder.PatternBuilder.build(PatternBuilder.java:104)
at
org.drools.rule.builder.GroupElementBuilder.build(GroupElementBuilder.java:69)
at org.drools.rule.builder.RuleBuilder.build(RuleBuilder.java:68)
at org.drools.compiler.PackageBuilder.addRule(PackageBuilder.java:1159)
at
org.drools.compiler.PackageBuilder.addPackage(PackageBuilder.java:649)
at
org.drools.compiler.PackageBuilder.addPackageFromDrl(PackageBuilder.java:290)
at
org.drools.compiler.PackageBuilder.addKnowledgeResource(PackageBuilder.java:488)
15 years, 5 months
Creating custom selectors using the "category" property for deploying certain rules in guvnor
by Premkumar Stephen
Hello everyone,
I am trying to create a custom selector, based on certain properties such as
"categories" (primary property) and others such as status and author.
from the examples in selectors.properties, I could not see a way to create
using categories. In that file, some of the field described are
statusDescription, lastModified, creator, etc
I was trying to find the complete list of all fields that could be used to
filter the rules.
I dug into the code and came across "categoryReference" in
VersionableItem.java. Is this the variable that stores the category?
Since a rule can have multiple categories, how does this pan out? Is this a
Collection?
Also, where does the string "statusDescription" get tied in to the status of
a rule? This one throws me off, since it is a valid field, but I cannot
understand how it is being set.
If any of you could share examples where you have done custom selectors
either in java or in drl, that would be awesome.
Thanks,
Prem
15 years, 5 months
How execute a Single rule from rule file or rule package
by Amila Silva
hi everyone,
I have a requirement like execute a single rule from set of loaded rule
files or single rule from single drl file.
when i execute fireAllRules() it executes the all the rules in the files.
even that overloaded method that take int as agrs also
seems doesnt help much.
let me know if any body gone thru this kind of senarios.
--
Thanks,
Regrads,
Amila Silva,
Associate Software Engineer
hSenid Mobile Solutions
Phone :
+94-77-9983894
Fax :
+94-11-2673 845
Web:
http://www.hSenid.com
Make it Happen
http://www.hSenidMobile.com
Enabling the Mobile World
Disclaimer: This email and any files transmitted with it are confidential
and intended solely for the use of the individual or entity to which they
are addressed. The content and opinions contained in this email are not
necessarily those of hSenid Software International. If you have received
this email in error please contact the sender.
15 years, 5 months
Drools 5 - how create Logger for Template File based rules?
by chris@twc
I'm trying to figure out how I can create a Logger to log rule activations
for my Template File code. I followed the examples to successfully create a
Logger for DRL and Decision Table examples. Apparently, to create a Logger,
the KnowledgeRuntimeLoggerFactory methods take a
KnowledgeRuntimeEventManager type, which StatefulKnowledgeSession
implements. But, for the Template File examples, the StatefulSession from
the "unstable" drools-core *does not* implement this interface. SEE the code
examples below - how do I create a Logger for my Template File code?
//#### DRL FILE & EXCEL FILE EXAMPLE FOR CREATING A SESSION AND FIRING THE
RULES:
//#### CREATING A RULES LOGGER WORKS
// populate working memory
KnowledgeBuilder kbuilder = KnowledgeBuilderFactory.newKnowledgeBuilder();
kbuilder.add(...[DRL or DTABLE resources]...);
KnowledgeBase knowledgeBase = KnowledgeBaseFactory.newKnowledgeBase();
knowledgeBase.addKnowledgePackages(kbuilder.getKnowledgePackages());
// create session
StatefulKnowledgeSession rulesSession =
knowledgeBase.newStatefulKnowledgeSession();
KnowledgeRuntimeLogger rulesLogger =
KnowledgeRuntimeLoggerFactory.newConsoleLogger(rulesSession);
//<<CREATE LOGGER!
FactHandle factHandle = rulesSession.insert(myFact);
// fire the rules
rulesSession.fireAllRules();
//#### TEMPLATE FILE EXAMPLE FOR CREATING A SESSION AND FIRING THE RULES:
//#### CREATING A RULES LOGGER DOES NOT COMPILE!
// populate working memory
ExternalSpreadsheetCompiler converter = new ExternalSpreadsheetCompiler();
InputStream spreadsheetStream = ...
InputStream templateFileStream = ...
String drl = converter.compile(spreadsheetStream, templateFileStream, 3, 3);
PackageBuilder builder = new PackageBuilder();
builder.addPackageFromDrl(new StringReader(drl));
RuleBase templateRuleBase = RuleBaseFactory.newRuleBase();
templateRuleBase.addPackage(builder.getPackage());
// create session
StatefulSession rulesSession = templateRuleBase.newStatefulSession();
KnowledgeRuntimeLogger rulesLogger =
KnowledgeRuntimeLoggerFactory.newConsoleLogger(rulesSession);//<<DOESN'T
COMPILE!
FactHandle factHandle = rulesSession.insert(myFact);
// fire the rules
rulesSession.fireAllRules();
--
View this message in context: http://www.nabble.com/Drools-5---how-create-Logger-for-Template-File-base...
Sent from the drools - user mailing list archive at Nabble.com.
15 years, 5 months
the n best solutions on a very simple test case
by Laurent Michenaud
Hi,
We have implemented a best score recaller to keep
the n best found solutions.
It seems to be ok except on very simple
test cases :
- On the first step, 4 moves are tested. They all
return a feseable score. The best one is kept and
sent to the solution recaller.
- After each of these moves, no other moves are
possible and the other solutions of the first step
are not sent to the solution recaller.
So, in our solution recaller, we have only one
solution.
Thanks for your help
Michenux.
15 years, 5 months
Drools 4.0.7 OSGi version not working
by Flavius Vespasianus
Hi,
I am still trying to setup Drools as OSGi classes. I have downloaded and
installed following plugins:
com.springsource.com.thoughtworks.xstream-1.3.0.jar
com.springsource.javax.rules-1.1.0.jar
com.springsource.javax.xml.stream-1.0.1.jar
com.springsource.jxl-2.6.6.jar
com.springsource.org.apache.jasper.org.eclipse.jdt-6.0.16.jar
com.springsource.org.codehaus.janino-2.5.15.jar
com.springsource.org.drools.compiler-4.0.7.jar
com.springsource.org.drools.decisiontable-4.0.7.jar
com.springsource.org.drools.jsr94-4.0.7.jar
com.springsource.org.drools-4.0.7.jar
com.springsource.org.mvel-1.3.5.jar
com.springsource.org.xmlpull-1.1.3.4-O.jar
com.springsource.org.xmlpull-1.1.4.jar
But when I try to run it, it still says:
Bundle update(a)plugins/com.springsource.org.drools.compiler-4.0.7.jar was
not resolved.
Missing imported package
org.eclipse.jdt.internal.compiler.classfmt_[3.2.3,4.0.0).
Missing imported package org.eclipse.jdt.core.compiler_[3.2.3,4.0.0).
Missing imported package
org.eclipse.jdt.internal.compiler.problem_[3.2.3,4.0.0).
Missing imported package
org.eclipse.jdt.internal.compiler.env_[3.2.3,4.0.0).
Missing imported package org.eclipse.jdt.internal.compiler_[3.2.3,4.0.0).
That's weird - the packages are in org.eclipse.jdt.core plugin and I
have the version 3.3.3, so it should find it. I have tried it also with
version 3.2.3 and 3.4.2 but no success. The target platform should be
configured correctly even when I try to use two versions at the same
moment it complains.
Can anybody help me, please? I am running out of time for my thesis...
Flavius
15 years, 5 months
a technical error occurred. Please contact a system administrator.
by VÅM§Ï ®
Hi,
After uploading the jar file,and clicking on *"save and validate
configuration* " returning an error called "technical error occurred".In the
jar file i have many classes in different packages.i m unable to find which
causes this problem.
anyone please let me know the solution.
regards,
Vamsi Krishna.Kavuri.
15 years, 5 months
Formula value assginment in LHS
by Shabbir Dhari
Dear all
We are developing a financial business application that contains hundreds of business rules for validations and calculations. In the calculation rules we change the value of attribute if values past in the request is incorrect e.g.
rule "TaxCalc"
when
$i : Invoice()
Invoice (totalTax != (round(salesTax + (gstRate * salesAmount / 100) + importDuty – govtRebate, 2)))
then
i.setTotalTax(round(salesTax + (gstRate * salesAmount / 100) + importDuty – govtRebate, 2));
end
The above code works perfectly fine. Only problem is the perform calculation twice. What I was looking if possible I can store calculated tax in a variable and simply assign variable to attribute if rule condiation fails. Some thing like:
rule "TaxCalc"
when
$i : Invoice()
Invoice (totalTax != calTax : (round(salesTax + (gstRate * salesAmount / 100)+ importDuty – govtRebate, 2)))
then
i.setTotalTax(calTax);
end
But this does not work - shows system error at calculated value assignment. Is there any work around?
_________________________________________________________________
POP access for Hotmail is here! Click here to find out more
http://windowslive.ninemsn.com.au/article.aspx?id=802246
15 years, 5 months
Unpredicatable output with Temporal rule
by PriyaSha
Requirement:
To identify those tickets with "critical" severity which occurs after
2minutes but before 5minutes of a ticket with severity 'warning', provided
both are of different application name.
This rule though not meaningful, is considered to understand the temporal
operator.
This is the rule:
declare OMNewTicket
@role( event )
@expires (10m)
end
rule "Sample Temporal"
salience 10
no-loop true
when
$ticket : OMNewTicket(severity == "warning", $appName : appName)
$ticket1 : OMNewTicket(this after[2m, 5m] $ticket, severity == "critical",
appName != $appName)
then
String $s = "";
String $s1 = "";
if ( $ticket != null) {
$s = formatDate($ticket.getReceivingTime());
}
if ( $ticket1 != null ) {
$s1 = formatDate($ticket1.getReceivingTime());
}
drools.getWorkingMemory().setGlobal( "output", "found");
drools.getWorkingMemory().setGlobal( "output1", $s);
drools.getWorkingMemory().setGlobal( "output2", $s1);
end
function String formatDate( String inputDate ) {
try {
DateFormat formatter = new SimpleDateFormat("MM/dd/yy:hh:mm:aaa");
Date date = (Date)formatter.parse(inputDate);
return date.toString();
} catch (ParseException e) {
System.out.println("Exception :"+e);
return null;
}
}
Input:
14178 10/25/2008:9:33:AM critical TCS_Tibco_AMS_Email
14178 10/25/2008:9:49:AM warning NETLOGON
14178 10/25/2008:9:58:AM warning NETLOGON
14178 10/25/2008:10:00:AM warning crypt32
14178 10/25/2008:10:00:AM warning crypt32
14178 10/25/2008:10:00:AM warning crypt32
14178 10/25/2008:10:03:AM warning crypt32
14178 10/25/2008:10:04:AM warning Symantec
14178 10/25/2008:10:05:AM critical Windows SharePoint Services 3
14178 10/25/2008:10:08:AM critical OVIS
14178 10/25/2008:10:10:AM critical Office SharePoint Server
14225 12/11/2008:3:25:AM warning ASBDSM
14225 12/11/2008:3:25:AM warning WinDiskSpace
14225 12/11/2008:3:25:AM critical OVIS
14225 12/11/2008:3:30:AM normal OVIS
14225 12/11/2008:3:34:AM critical TCS_Tibco_AMS_Email
Output:
Status Time of Ticket Timestamp of Ticket1 Time (Clock)
found Sat Oct 25 10:00:00 Sat Oct 25 10:05:00 Sat Oct 25
10:05:00
found Sat Oct 25 10:00:00 Sat Oct 25 10:08:00 Sat Oct 25
10:08:00
found Sat Oct 25 10:04:00 Sat Oct 25 10:10:00 Sat Oct 25
10:10:00
found Thu Dec 11 03:25:00 Thu Dec 11 03:34:00 Thu Dec 11
03:34:00
Here Time of Ticket is output1 from rule and Timestamp of Ticket1 is
output2 of the consequence.
Problem :
The output 'found Thu Dec 11 03:25:00 Thu Dec 11 03:34:00
Thu Dec 11 03:34:00 ' is not satisfying the rule condition.
After first three output, there are no tuples matching the criteria
mentioned. Unable to predict the occurence of this in the output.
May I know what i miss here?
--
View this message in context: http://www.nabble.com/Unpredicatable-output-with-Temporal-rule-tp24307147...
Sent from the drools - user mailing list archive at Nabble.com.
15 years, 5 months