Fundamental Question
by Raffi Khatchadourian
What is the difference in using a rules engine like drools as opposed to
using either an object database or ORDBMS mapping to a database with
triggers?
16 years, 7 months
"could not discover transaction status" with JBossAS 4.2.1-GA and Drools 4.0.4 BRMS
by jimpo
Using the latest stable releases of JBoss AS and Drools BRMS seems to bring
problems.
1. Install JBoss 4.2.1-GA
2. Drop in drools-jbrms.war
I get this in the logs:
13:33:06,093 INFO [Server] JBoss (MX MicroKernel) [4.2.1.GA (build:
SVNTag=JBoss_4_2_1_GA date=200707131605)] Started i
n 29s:468ms
13:33:44,000 INFO [TomcatDeployer] deploy, ctxPath=/drools-jbrms,
warUrl=.../tmp/deploy/tmp58253drools-jbrms-exp.war/
13:34:15,406 INFO [STDOUT] Setting up the repository, registering node
types etc.
13:34:15,468 INFO [STDOUT] DEBUG 18-04 13:34:15,453
(JackrabbitRepositoryConfigurator.java:registerNodeTypesFromCndFile
:127) Attempting to regsiter node type named:
{http://www.jboss.org/drools-repository/1.0}categoryNodeType
13:34:15,531 INFO [STDOUT] DEBUG 18-04 13:34:15,531
(JackrabbitRepositoryConfigurator.java:registerNodeTypesFromCndFile
:127) Attempting to regsiter node type named:
{http://www.jboss.org/drools-repository/1.0}stateNodeType
13:34:15,546 INFO [STDOUT] DEBUG 18-04 13:34:15,546
(JackrabbitRepositoryConfigurator.java:registerNodeTypesFromCndFile
:127) Attempting to regsiter node type named:
{http://www.jboss.org/drools-repository/1.0}versionableNodeType
13:34:16,468 INFO [STDOUT] DEBUG 18-04 13:34:16,468
(JackrabbitRepositoryConfigurator.java:registerNodeTypesFromCndFile
:127) Attempting to regsiter node type named:
{http://www.jboss.org/drools-repository/1.0}versionableAssetFolder
13:34:16,515 INFO [STDOUT] DEBUG 18-04 13:34:16,515
(JackrabbitRepositoryConfigurator.java:registerNodeTypesFromCndFile
:127) Attempting to regsiter node type named:
{http://www.jboss.org/drools-repository/1.0}assetNodeType
13:34:16,937 INFO [STDOUT] DEBUG 18-04 13:34:16,828
(JackrabbitRepositoryConfigurator.java:registerNodeTypesFromCndFile
:127) Attempting to regsiter node type named:
{http://www.jboss.org/drools-repository/1.0}packageNodeType
13:34:17,078 INFO [STDOUT] DEBUG 18-04 13:34:17,078
(RulesRepository.java:addNodeIfNew:131) Adding new node of type
: nt:folder named: drools:repository to parent node named
13:34:17,078 INFO [STDOUT] DEBUG 18-04 13:34:17,078
(RulesRepository.java:addNodeIfNew:131) Adding new node of type
: nt:folder named: drools:package_area to parent node named
drools:repository
13:34:17,078 INFO [STDOUT] DEBUG 18-04 13:34:17,078
(RulesRepository.java:addNodeIfNew:131) Adding new node of type
: nt:folder named: drools:packagesnapshot_area to parent node named
drools:repository
13:34:17,078 INFO [STDOUT] DEBUG 18-04 13:34:17,078
(RulesRepository.java:addNodeIfNew:131) Adding new node of type
: nt:folder named: drools:tag_area to parent node named drools:repository
13:34:17,093 INFO [STDOUT] DEBUG 18-04 13:34:17,078
(RulesRepository.java:addNodeIfNew:131) Adding new node of type
: nt:folder named: drools:state_area to parent node named drools:repository
13:34:17,093 INFO [STDOUT] DEBUG 18-04 13:34:17,093
(RulesRepository.java:addNodeIfNew:131) Adding new node of type
: drools:stateNodeType named: Draft to parent node named drools:state_area
13:34:23,890 INFO [STDOUT] ERROR 18-04 13:34:23,890
(Contexts.java:flushAndDestroyContexts:335) could not discover
transaction status
13:34:23,921 INFO [STDOUT] ERROR 18-04 13:34:23,921
(Contexts.java:flushAndDestroyContexts:335) could not discover
transaction status
The could not discover transaction status -error keeps repeating.
Is this a serious problem? From a quick look the webapp seems to work. One
thread
http://www.nabble.com/Drools-4.0.4-and-Jboss-4.2.2-GA-td16113554.html#a16...
suggested commenting out parts of web.xml, this just broke my webapp
completely.
--
View this message in context: http://www.nabble.com/%22could-not-discover-transaction-status%22-with-JB...
Sent from the drools - user mailing list archive at Nabble.com.
16 years, 7 months
jdk 1.6 support
by Jeffrey Delong
Are there plans to support jdk 1.6 with Drools 5.0?
Thanks,
Jeff
16 years, 7 months
Collection & Emptyness
by vdelbart
Hi,
I have an object 'VenueGlobal' with a property 'sousVenues' who is a List of
SousVenue. I try to test the emptyness of this list in on sentence but i
don't know why it doesn't work :
I try this :
VenueGlobal( sousVenues == null || sousVenues.empty )
but I have this error :
org.drools.rule.InvalidRulePackage: [11,53]: unknown:11:53 Unexpected token
')'
at org.drools.rule.Package.checkValidity(Package.java:424)
I try this :
VenueGlobal( sousVenues == null || sousVenues.size == 0 )
but I have this error :
Caused by: org.mvel.PropertyAccessException: unable to resolve property:
size
at
org.mvel.optimizers.impl.refl.ReflectiveAccessorOptimizer.getBeanProperty(ReflectiveAccessorOptimizer.java:382)
I don't know what the solution ?
regards,
V.
--
View this message in context: http://www.nabble.com/Collection---Emptyness-tp16833060p16833060.html
Sent from the drools - user mailing list archive at Nabble.com.
16 years, 7 months
Handle not found for object if using treeset
by rjlist@nextmind.net
Hi All,
i've a simple rules that retract objects form the WM
rule "Retract From ArrayList"
when
$total: ArrayList() from collect ( PrestationFacturable() )
then
retract($total.get(0));
end
at the end of fireAll all the fact are well retracted but if I
replace ArrayList by TreeSet
rule "Retract From TreeSet"
when
$tree: TreeSet() from collect ( PrestationFacturable() )
then
retract($tree.first());
end
I got the following exception
org.drools.spi.ConsequenceException: org.drools.FactException:
Retract error: handle not found for object: [6, val=1]. Is it in the
working memory?
because the $tree (at second run) still contains the object that as
been removed
can somebody can explain this behavior ?
Thanks in advance
-P.
16 years, 7 months
Re: Is this scenario suitable for using Drools?
by Cheng Wei Lee
I've 2 algorithms to calculate the cost of a product. At any one time, there
is only 1 algorithm in use. Initially algorithm 1 will be the default.
Subsequently, the decision to use which algorithm will depend on customers
feedback. The algorithms are:
Algorithm 1:
Cost = MAX(P1, T1, P2, T2, P3, T3, ...)
Algorithm 2:
Cost = MIN(P1, P2, P3, ...) + MIN(T1, T2, T3, ...)
The values of P1, P2, ... are stored within a database. The number of Ps &
Ts are unknown but can be determined by querying the database, Would drools
be a good option to use to store the algorithms? If so, how could I be able
to retrieve the values of P1, P2, etc from the database from within drools?
Thanks!
16 years, 7 months
What-if analysis
by Ravi Shankar (Singtel)
Dear all,
Does Drools support "what-if" analysis?
For example, I have the data for the sales done by a salesman for the past one year. There is a commission available to the salesman for the same he is doing. I use the data to plot a graph showing the efficiency of all salesmen in my company.
Assume that the comany wants a profit of , say, 10% more than what currently is, I mean "what if the comany wants more revenue", what should be the values for sales. It is a trivial example, but just enough for understanding my query - can we use Drools for this? Is it being used in financial inductry where derivatives etc are used widely?
Thanks and regards,
Ravion
16 years, 7 months
Newbie help for rule that won't fire. What am I missing?
by Bagwell, Allen F
Drools newbie here in need of help. I'm missing something fundamental here, and I just can't see it. The following doesn't work for me:
In my rule file:
---------------------------------
rule "timer goes off"
when
$rt : RuleTimer(timedOut == true)
then
System.out.println( $rt.getUniqueName() + " went off.");
end
--------------------------------
Here's what I'm doing in the code after all the usual setup of compiling the rule file (which drools reports having no errors).
Additionally I can report that yes I HAVE loaded the compiled rule file into the session, because I have several other simple rules in it, and they
do activate and fire when the conditions are met. I've just isolated the above rule which is part of the problem.
----------------------------------------------------------
// make a timer lasting two seconds.
RuleTimer timer1 = new RuleTimer("Timer1",0,0,2);
// make a timer lasting five seconds.
RuleTimer timer2 = new RuleTimer("Timer2",0,0,5);
// insert my RuleTimers to be dynamically updated.
session.insert( timer1, true );
session.insert( timer2, true );
// sleep 2.5 seconds, timer 1 should time out
Thread.sleep(2500);
timer1.calculateTimeLeft();
timer2.calculateTimeLeft();
session.fireAllRules();
//sleep another 2.750 seconds, timer 2 should time out.
Thread.sleep(2750);
timer2.calculateTimeLeft();
session.fireAllRules();
logger.writeToDisk();
session.dispose();
------------------------------------------------
For reference, here's some of the methods being called in the RuleTimer class...
-------------------------------------------------
public void calculateTimeLeft()
{
if (expireInterval >= 0)
timeLeft = expireInterval - (Tut.getWallTime() - timeBegin);
if (timeLeft <= 0)
{
setTimedOut(true);
}
}
public void setTimedOut(boolean b)
{
boolean oldTimedOut = timedOut;
timedOut = b;
changes.firePropertyChange("timedOut", oldTimedOut, timedOut);
}
public final boolean isTimedOut()
{
return timedOut;
}
---------------------------------------------------
And finally here's the audit log output for the drools session. The objects were inserted. They
were dynamically updated. But their was no rule activation (see the rule at top of post):
---------------------------------------------------
Object inserted (1):
uniqueName: Timer1
timedOut: false
Object inserted (2):
uniqueName: Timer2
timedOut: false
Object updated (1):
uniqueName: Timer1
timedOut: true
Object updated (2):
uniqueName: Timer2
timedOut: true
------------------------------------------------
So can any sharp eye tell me what I'm doing wrong here? It seems pretty simple and straightforward, but I'm confounded as to why I get no rule activation.
thanks!
Allen
16 years, 7 months
Using global variables in functions
by José Arrarte
Hello all,
Is there a way I can use a global variable inside a function definition
without having to pass it as a parameter?
I'd like to be able to use a log4j Logger instance (declared as a global
variable) inside functions.
Best regards,
José Arrarte
16 years, 7 months