RE: [rules-users] To insert facts or use the find clause?
Don't ask me to explain why but the Drools team always recommend flattening hierarchies before inserting into WM ;-) I *think* this allows for individual facts' properties to be indexed in the RETE network thus affording a performance increase. I guess there's also implications to do with truth maintenance whereby objects accessed using from should be time-constant. My 2c's worth; I'm sure Edson, Mark, Michael et al will elaborate. Cheers, Mike -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Raffi Khatchadourian Sent: 18 April 2008 02:34 To: rules-users@lists.jboss.org Subject: [rules-users] To insert facts or use the find clause? I would like to use Drools to reason about a graph structure using queries. The graph consists of a collection of nodes, which in turn each have a collection of edges to nodes. Currently, I have a single fact in the Drools working memory, the graph. My queries then use the from clause to obtain information about the nodes and edges within the graph. I was wondering if it would be better to instead traverse the entire structure adding each node and edge as facts into the working memory. Any ideas? Thanks! ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users smime.p7s Description: S/MIME cryptographic signature ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
[rules-users] could not discover transaction status with JBossAS 4.2.1-GA and Drools 4.0.4 BRMS
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#a16113554 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-JBossAS-4.2.1-GA-and-Drools-4.0.4-BRMS-tp16763360p16763360.html Sent from the drools - user mailing list archive at Nabble.com. ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
RE: [rules-users] Why double rule activation?
OK, I feel REALLY stupid. I was adding my compiled rules package to the RuleBase TWICE. Doh! Sorry if I took up anyone's valuable time. I wasted almost two days before I figured this out. :) -A -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Anstis, Michael (M.) Sent: Thursday, April 17, 2008 9:28 AM To: Rules Users List Subject: RE: [rules-users] Why double rule activation? My test was ran with 4.0.5, but Eclipse plug-in 4.0.3 - part of my lazy upgrade process ;-) I will re-run with the latest Eclipse plug-in and see if the Audit View is correct (in 4.0.3 it shows 3 inserts, 3 activations and 3 executions). Can you run my test and confirm you get what's expected? -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Bagwell, Allen F Sent: 17 April 2008 16:00 To: Rules Users List Subject: RE: [rules-users] Why double rule activation? I appreciate the effort. The problem isn't in the logger. It's just standing in for System.out so that I can reference a file for output (it's an extension of log4j). The actual Drools audit view is reporting double activation and execution on insert and update of the objects. I'm using a loop to insert my objects into Drools, and I thought at first perhaps I was inserting them more than once. But I don't see that happening. In any event wouldn't the audit log tell me if I was doing that? -A -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Anstis, Michael (M.) Sent: Thursday, April 17, 2008 2:11 AM To: Rules Users List Subject: RE: [rules-users] Why double rule activation? I have tried to re-produce using System.out.println instead of IELogger and I don't get any double activations :-( Could the problem be elsewhere (e.g. IELogger?). package com.sample import com.sample.MyVariable; rule Light is off when $brightness : MyVariable(uniqueName == [EMAIL PROTECTED], currentValue == 0.0) then System.out.println(DimmerSwitch1 has no brightness value); end rule Light Below 50% when $brightness : MyVariable(uniqueName == [EMAIL PROTECTED], currentValue 0.50, currentValue 0.0) then System.out.println(DimmerSwitch1 is below 50% brightness); end rule Light 50% or Above when $brightness : MyVariable(uniqueName == [EMAIL PROTECTED], currentValue = 0.5) then System.out.println(DimmerSwitch1 is at or above 50% brightness); End public static final void main(String[] args) { WorkingMemoryFileLogger logger = null; try { RuleBase ruleBase = readRule(); WorkingMemory workingMemory = ruleBase.newStatefulSession(); logger = new WorkingMemoryFileLogger(workingMemory); logger.setFileName(events.log); MyVariable v1 = new MyVariable([EMAIL PROTECTED], 0.0d); MyVariable v2 = new MyVariable([EMAIL PROTECTED], 0.4d); MyVariable v3 = new MyVariable([EMAIL PROTECTED], 0.6d); workingMemory.insert(v1); workingMemory.insert(v2); workingMemory.insert(v3); workingMemory.fireAllRules(); } catch (Throwable t) { t.printStackTrace(); } finally { if (logger != null) { logger.writeToDisk(); } } } -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Bagwell, Allen F Sent: 16 April 2008 20:50 To: Rules Users List Subject: [rules-users] Why double rule activation? I've encountered rule engine behavior I'm knocking my head against the wall trying to figure out. I'm a Drools newbie, so please forgive if this I am doing something bone-headed wrong. Basically I'm inserting an object into my working memory. The object itself has a default setting of 0.0 for a brightness value, and this setting matches the LHS condition for my first rule. The problem is the rule activates twice for a single object insertion as described in the audit log. It consequently executes twice when I fire all rules. Then whenever I change the value in question, any single update to the same object also causes double rule activation and execution. The rules I've written are not complex. Here's my drl file: package dimmerie; #list any import classes here. import knowledgebase.*; import NipcLogger; #declare any global variables here global NipcLogger IELogger; rule Light is off when $brightness : MyVariable(uniqueName == [EMAIL PROTECTED], currentValue == 0.0) then IELogger.info(DimmerSwitch1 has no brightness value); end rule Light Below 50% when $brightness : MyVariable(uniqueName == [EMAIL PROTECTED], currentValue 0.50, currentValue 0.0) then
Re: [rules-users] Software Licensing Question Related to Bundled Eclipse Jarfile, core-3.2.3.v_686_R32x.jar?
WILLIAMS Kerry wrote: Hello! My apologies in advance if this isn't the correct list for this question! I'm evaluating the possibility integrating Drools into an project that I'm working on. I see from the packaging that Drools itself uses the Apache License v2.0 which is fine for my purposes. The question I have though is with Drools 4.0.4/4.0.5 Java-like rules language plugin. To use the Java lang for the .drl file I'm required to include an eclipse jar (core-3.2.3.v_686_R32x.jar) in my distribution. Which license applies to that eclipse .jar? Is it the Eclipse license or the Drools adoption of Apache 2.0? The eclipse jar is covered by the eclipse public license. Thanks for your time! -Kerry ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users