Regarding Nested Rules in Drools 4.0.7
by M.DILIP KUMAR
Hi All,
I got many idea by using this group. Now i want one clarification regarding Nested rule.
If any one having sample code for nested Rule means Pls send reply along this mail.
Acutally i want rule like
Rule : "nested Rule"
When
#Condition is true
Then
CALL another RULE ...!!!!
Here i want pass some argument to that nested rule
is it possible ?
End
Help me regarding this and send sample code if possible please
Defeat yourself today!
____________________________
DILIP KUMAR.M
Add more friends to your messenger and enjoy! Go to http://messenger.yahoo.com/invite/
16 years, 1 month
Get node's rule
by Waleed Zedan
Hi,
in AlphaNode.java (similarly beta nodes descendants)
public void assertObject(final InternalFactHandle handle,
final PropagationContext context,
final InternalWorkingMemory workingMemory)
throws FactException {
if ( this.constraint.isAllowed( handle.getObject(),
workingMemory,
...
}
// I need to put code here to get the rule and previous statisfied
conditions
}
I need to get rule that owns the alpha or beta node as well as all the
previous conditions that have been satisfied.
For example:
Rule 1 :
Condition1 -> Node1
Condition2 -> Node2
Condition3 -> Node3
so if fact1 satisfies condition 1 & 2 only, but condition 3 doesn't satisfy
it, I need to store the information that rule 1 with condition 1 & condition
2 have been satisfied.
So , how can I get the rule that owns the condition?
Can I get this information from workingMemoryEventSupport.fireObjectInserted
event?
Thanks,
--
Waleed Zedan
SCJP 1.4 , CCNA
16 years, 1 month
Re: [rules-dev] M2 Guvnor Tomcat Deployment Issues and Resolutions
by mellster
FYI, here are a few more hacks I had to make (after checking out the latest
from trunk) to get guvnor started on tomcat6 and j2se1.5 on WinXP
1) java.lang.NoClassDefFoundError: org/drools/ObjectFilter
It looks like this one moved to the org.drools.runtime package - duplicated
the source file into org/drools and rebuilt.
2) javax.jcr.NamespaceException: http://www.jboss.org/drools-repository/1.0
is not a registered namespace uri
Added the line
drools=http\://www.jboss.org/drools-repository/1.0
to bin/repository/repository/namespaces/ns_reg
3) jsf not found (if you're running with J2SE instead of J2EE)
Added jsf-api and jsf-impl to the pom (runtime scope should do it)
'<dependency>
<groupId>javax.faces</groupId>
<artifactId>jsf-api</artifactId>
<version>1.2_02</version>
</dependency>
<dependency>
<groupId>javax.faces</groupId>
<artifactId>jsf-impl</artifactId
<version>1.2-b19</version>
</dependency>
cheers
Marco
dave sinclair wrote:
>
> Just a heads up for everyone out there. I needed to make the following
> changes to guvnor's POM in order to get the webapp to work properly on
> Tomcat. I would imagine some of these issues would appear on JBoss also
> but
> have not tried.
>
> 1. Changed seam from 2.1.0.BETA1 to 2.1.0-SNAPSHOT to prevent classloader
> problem
>
> POM Changes
> <dependency>
> <groupId>org.jboss.seam</groupId>
> <artifactId>jboss-seam-remoting</artifactId>
> <version>2.1.0-SNAPSHOT</version>
> </dependency>
> <dependency>
> <groupId>org.jboss.seam</groupId>
> <artifactId>jboss-seam</artifactId>
> <version>2.1.0-SNAPSHOT</version>
> </dependency>
>
> EXCEPTION without change
>
> SEVERE: Exception sending context initialized event to listener instance
> of
> class org.jboss.seam.servlet.SeamListener
> java.lang.IllegalStateException: Cannot load
> WEB-INF/classes/net/sf/webdav/exceptions/AccessDeniedException.class from
> WebappClassLoader
> delegate: false
> repositories:
> /WEB-INF/classes/
> ----------> Parent Classloader:
> org.apache.catalina.loader.StandardClassLoader@c4fe76
> (using getResourceAsStream() returned null)
> at
> org.jboss.seam.deployment.AbstractDeploymentHandler.getClassFile(AbstractDeploymentHandler.java:41)
> at
> org.jboss.seam.deployment.ComponentDeploymentHandler.handle(ComponentDeploymentHandler.java:57)
> at
> org.jboss.seam.deployment.DeploymentStrategy.handle(DeploymentStrategy.java:177)
> at
> org.jboss.seam.deployment.AbstractScanner.handleItem(AbstractScanner.java:30)
> at
> org.jboss.seam.deployment.URLScanner.handleDirectory(URLScanner.java:141)
> at
> org.jboss.seam.deployment.URLScanner.handleDirectory(URLScanner.java:137)
> at
> org.jboss.seam.deployment.URLScanner.handleDirectory(URLScanner.java:137)
> at
> org.jboss.seam.deployment.URLScanner.handleDirectory(URLScanner.java:137)
> at
> org.jboss.seam.deployment.URLScanner.handleDirectory(URLScanner.java:137)
> at
> org.jboss.seam.deployment.URLScanner.handleDirectory(URLScanner.java:137)
> at
> org.jboss.seam.deployment.URLScanner.handleDirectory(URLScanner.java:137)
> at
> org.jboss.seam.deployment.URLScanner.scanDirectories(URLScanner.java:40)
> at
> org.jboss.seam.deployment.StandardDeploymentStrategy.scan(StandardDeploymentStrategy.java:107)
> at
> org.jboss.seam.init.Initialization.create(Initialization.java:113)
> at
> org.jboss.seam.servlet.SeamListener.contextInitialized(SeamListener.java:34)
> at
> org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3843)
> at
> org.apache.catalina.core.StandardContext.start(StandardContext.java:4350)
> at
> org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791)
> at
> org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771)
> at
> org.apache.catalina.core.StandardHost.addChild(StandardHost.java:525)
> at
> org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:829)
> at
> org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:718)
> at
> org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:490)
> at
> org.apache.catalina.startup.HostConfig.start(HostConfig.java:1147)
> at
> org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:311)
> at
> org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)
> at
> org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)
> at
> org.apache.catalina.core.StandardHost.start(StandardHost.java:719)
> at
> org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
> at
> org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
> at
> org.apache.catalina.core.StandardService.start(StandardService.java:516)
> at
> org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
> at org.apache.catalina.startup.Catalina.start(Catalina.java:578)
> 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:597)
> at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)
> at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
>
> 2. Added javax.persistence to prevent ClassNotFoundException
>
> POM Changes
>
> <dependency>
> <groupId>javax.persistence</groupId>
> <artifactId>persistence-api</artifactId>
> <version>1.0</version>
> </dependency>
>
> EXCEPTION without change
>
> SEVERE: Exception sending context initialized event to listener instance
> of
> class org.jboss.seam.servlet.SeamListener
> java.lang.RuntimeException: Could not create Component:
> org.jboss.seam.core.init
> at
> org.jboss.seam.init.Initialization.addComponent(Initialization.java:1068)
> at
> org.jboss.seam.init.Initialization.init(Initialization.java:614)
> at
> org.jboss.seam.servlet.SeamListener.contextInitialized(SeamListener.java:34)
> at
> org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3843)
> at
> org.apache.catalina.core.StandardContext.start(StandardContext.java:4350)
> at
> org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791)
> at
> org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771)
> at
> org.apache.catalina.core.StandardHost.addChild(StandardHost.java:525)
> at
> org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:829)
> at
> org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:718)
> at
> org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:490)
> at
> org.apache.catalina.startup.HostConfig.start(HostConfig.java:1147)
> at
> org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:311)
> at
> org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)
> at
> org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)
> at
> org.apache.catalina.core.StandardHost.start(StandardHost.java:719)
> at
> org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
> at
> org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
> at
> org.apache.catalina.core.StandardService.start(StandardService.java:516)
> at
> org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
> at org.apache.catalina.startup.Catalina.start(Catalina.java:578)
> 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:597)
> at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)
> at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
> Caused by: java.lang.NoClassDefFoundError: javax/persistence/Entity
> at org.jboss.seam.Seam.getComponentType(Seam.java:109)
> at org.jboss.seam.Component.<init>(Component.java:210)
> at org.jboss.seam.Component.<init>(Component.java:199)
> at
> org.jboss.seam.init.Initialization.addComponent(Initialization.java:1052)
> ... 26 more
> Caused by: java.lang.ClassNotFoundException: javax.persistence.Entity
> at
> org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1360)
> at
> org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1206)
> at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
> ... 30 more
>
> 3. Added hibernate-validator to prevent ClassNotFoundException
>
> POM Changes
>
> <dependency>
> <groupId>org.hibernate</groupId>
> <artifactId>hibernate-validator</artifactId>
> <version>3.0.0.GA</version>
> </dependency>
>
> EXCEPTION without change
>
> SEVERE: Exception sending context initialized event to listener instance
> of
> class org.jboss.seam.servlet.SeamListener
> java.lang.RuntimeException: Could not create Component:
> org.jboss.seam.international.statusMessages
> at
> org.jboss.seam.init.Initialization.addComponent(Initialization.java:1068)
> at
> org.jboss.seam.init.Initialization.installComponents(Initialization.java:984)
> at
> org.jboss.seam.init.Initialization.init(Initialization.java:646)
> at
> org.jboss.seam.servlet.SeamListener.contextInitialized(SeamListener.java:34)
> at
> org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3843)
> at
> org.apache.catalina.core.StandardContext.start(StandardContext.java:4350)
> at
> org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791)
> at
> org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771)
> at
> org.apache.catalina.core.StandardHost.addChild(StandardHost.java:525)
> at
> org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:829)
> at
> org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:718)
> at
> org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:490)
> at
> org.apache.catalina.startup.HostConfig.start(HostConfig.java:1147)
> at
> org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:311)
> at
> org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)
> at
> org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)
> at
> org.apache.catalina.core.StandardHost.start(StandardHost.java:719)
> at
> org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
> at
> org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
> at
> org.apache.catalina.core.StandardService.start(StandardService.java:516)
> at
> org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
> at org.apache.catalina.startup.Catalina.start(Catalina.java:578)
> 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:597)
> at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)
> at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
> Caused by: java.lang.NoClassDefFoundError:
> [Lorg/hibernate/validator/InvalidValue;
> at java.lang.Class.getDeclaredMethods0(Native Method)
> at java.lang.Class.privateGetDeclaredMethods(Class.java:2427)
> at java.lang.Class.privateGetPublicMethods(Class.java:2547)
> at java.lang.Class.privateGetPublicMethods(Class.java:2563)
> at java.lang.Class.getMethods(Class.java:1410)
> at org.jboss.seam.Component.hasAnnotation(Component.java:1078)
> at org.jboss.seam.Component.<init>(Component.java:212)
> at org.jboss.seam.Component.<init>(Component.java:199)
> at
> org.jboss.seam.init.Initialization.addComponent(Initialization.java:1052)
> ... 27 more
> Caused by: java.lang.ClassNotFoundException:
> org.hibernate.validator.InvalidValue
> at
> org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1360)
> at
> org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1206)
> at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
> ... 36 more
>
> 4. Seam's version of the Java Expression Language was clashing with
> Tomcat's
>
> POM Changes
>
> - exclude from seam
> <dependency>
> <groupId>org.jboss.seam</groupId>
> <artifactId>jboss-seam</artifactId>
> <version>2.1.0-SNAPSHOT</version>
> <exclusions>
> <exclusion>
> <groupId>javax.el</groupId>
> <artifactId>el-api</artifactId>
> </exclusion>
> </exclusions>
> </dependency>
> - comment out from POM
> <!--<dependency>-->
> <!--<groupId>javax.el</groupId>-->
> <!--<artifactId>el-api</artifactId>-->
> <!--<version>1.2</version>-->
> <!--<scope>runtime</scope>-->
> <!--</dependency>-->
>
>
> Exception without change
>
> java.lang.LinkageError: loader constraint violation: when resolving
> interface method
> "javax.servlet.jsp.JspApplicationContext.getExpressionFactory()Lj
> avax/el/ExpressionFactory;" the class loader (instance of
> org/apache/jasper/servlet/JasperLoader) of the current class,
> org/apache/jsp/index_jsp, and
> the class loader (instance of
> org/apache/catalina/loader/StandardClassLoader) for resolved class,
> javax/servlet/jsp/JspApplicationContext, have differ
> ent Class objects for the type javax/el/ExpressionFactory used in the
> signature
> at org.apache.jsp.index_jsp._jspInit(index_jsp.java:22)
> at org.apache.jasper.runtime.HttpJspBase.init(HttpJspBase.java:52)
> at
> org.apache.jasper.servlet.JspServletWrapper.getServlet(JspServletWrapper.java:159)
> at
> org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:329)
> at
> org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:337)
> at
> org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
> at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
> at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
> at
> org.jboss.seam.web.ContextFilter$1.process(ContextFilter.java:42)
> at
> org.jboss.seam.servlet.ContextualHttpServletRequest.run(ContextualHttpServletRequest.java:53)
> at
> org.jboss.seam.web.ContextFilter.doFilter(ContextFilter.java:37)
> at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
> at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
> at
> org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
> at
> org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
> at
> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
> at
> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
> at
> org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
> at
> org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)
> at
> org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
> at
> org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
> at
> org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
> at java.lang.Thread.run(Thread.java:619)
>
> let me know if we should use different versions then the ones I have
> listed.
>
> thanks
>
> dave sinclair
>
> _______________________________________________
> rules-dev mailing list
> rules-dev(a)lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-dev
>
>
--
View this message in context: http://www.nabble.com/M2-Guvnor-Tomcat-Deployment-Issues-and-Resolutions-...
Sent from the drools - dev mailing list archive at Nabble.com.
16 years, 1 month
Compile error in build
by Greg Barton
FYI, getting this error in trunk, rev 23768:
[INFO] ------------------------------------------------------------------------
[INFO] Building Drools :: Process :: Task
[INFO] task-segment: [clean, install]
[INFO] ------------------------------------------------------------------------
[INFO] [clean:clean]
[INFO] Deleting directory /home/greg/tmp/java/drools/subversion/trunk/drools-process/drools-process-task/target
[INFO] [resources:resources]
[INFO] Using default encoding to copy filtered resources.
[INFO] [compiler:compile]
[INFO] Compiling 82 source files to /home/greg/tmp/java/drools/subversion/trunk/drools-process/drools-process-task/target/classes
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Compilation failure
/home/greg/tmp/java/drools/subversion/trunk/drools-process/drools-process-task/src/main/java/org/drools/process/workitem/wsht/WSHumanTaskHandler.java:[32,7] org.drools.process.workitem.wsht.WSHumanTaskHandler is not abstract and does not override abstract method abortWorkItem(org.drools.runtime.process.WorkItem,org.drools.runtime.process.WorkItemManager) in org.drools.runtime.process.WorkItemHandler
/home/greg/tmp/java/drools/subversion/trunk/drools-process/drools-process-task/src/main/java/org/drools/process/workitem/wsht/WSHumanTaskHandler.java:[32,7] org.drools.process.workitem.wsht.WSHumanTaskHandler is not abstract and does not override abstract method abortWorkItem(org.drools.runtime.process.WorkItem,org.drools.runtime.process.WorkItemManager) in org.drools.runtime.process.WorkItemHandler
[INFO] ------------------------------------------------------------------------
[INFO] Trace
org.apache.maven.BuildFailureException: Compilation failure
/home/greg/tmp/java/drools/subversion/trunk/drools-process/drools-process-task/src/main/java/org/drools/process/workitem/wsht/WSHumanTaskHandler.java:[32,7] org.drools.process.workitem.wsht.WSHumanTaskHandler is not abstract and does not override abstract method abortWorkItem(org.drools.runtime.process.WorkItem,org.drools.runtime.process.WorkItemManager) in org.drools.runtime.process.WorkItemHandler
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:560)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:480)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:459)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:311)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:278)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:143)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:333)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:126)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:282)
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:597)
at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
Caused by: org.apache.maven.plugin.CompilationFailureException: Compilation failure
/home/greg/tmp/java/drools/subversion/trunk/drools-process/drools-process-task/src/main/java/org/drools/process/workitem/wsht/WSHumanTaskHandler.java:[32,7] org.drools.process.workitem.wsht.WSHumanTaskHandler is not abstract and does not override abstract method abortWorkItem(org.drools.runtime.process.WorkItem,org.drools.runtime.process.WorkItemManager) in org.drools.runtime.process.WorkItemHandler
at org.apache.maven.plugin.AbstractCompilerMojo.execute(AbstractCompilerMojo.java:516)
at org.apache.maven.plugin.CompilerMojo.execute(CompilerMojo.java:114)
at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:447)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:539)
... 16 more
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 34 seconds
[INFO] Finished at: Thu Nov 06 20:20:31 CST 2008
[INFO] Final Memory: 88M/404M
[INFO] ------------------------------------------------------------------------
16 years, 1 month
[Fwd: Unsolicited "Improvements" to the sudoku example]
by Mark Proctor
Anyone want to take this on?
Mark
-------- Original Message --------
Subject: Unsolicited "Improvements" to the sudoku example
Date: Thu, 6 Nov 2008 04:17:31 +0000 (UTC)
From: ted.keenan(a)comcast.net
To: mark.proctor(a)jboss.com
To Whom It May Concern:
Here is an unsolicited patch that addresses some to do items in the
Sudoku example:
1. The patch combines the two drl files into a single file,
sudokuSolverValidatorWithGuess.drl, and separates them by using
agenda groups.
2. It simplifies the checking of whether all possible cells have a
solution by creating an object, basecell, for each cell that needs
a resolved cell and introduces it into the memory space. A rule
then checks baseCells against resolvedCellValues for the memory set.
3. Changes the way issues are raised by removing the issues array and
adding various types of SudokuStatusMessages so that the status of
the solution can be tracked by a separate status listener. This
allows the model to track the status of solution.
4. Provides a solution to the rule 11 guessing rule. This is a little
complex as the process is to identify a cell with multiple
possible values and pick one of them and then run a copy of the
solver to its logical conclusion and identify the result which is
one of the following: solved, in error or indeterminate. The
process is repeated until a solved solution is identified.
Each pass keeps tracks the removal and insertion of memory facts
so that they can be reversed at the end of the logical test. At
the end of each test the effects of the test are reversed and one
of the following is done depending on the result. If the test is
indeterminate; keep testing. If the solution is solved; set the
guessed cell value pair as the only possible value for the cell
and run the base testing routines. If the solution is logically
inconsistent; remove the cell value as a possibleCellValue, if
this leaves only one possibleCellValue then run the base testing
routines.
Note, the error cases don’t necessarily solve the puzzle the end
so sometimes you need to guess multiple times.
5. Changed the constants and samples into a strategy pattern that can
support 4x4 and 6x6 grids as well as the 9x9 grid. This was done
to simplify testing as it is easier to test an indeterminate 4x4
grid then a hard 9x9 grid when guessing.
Note: the samples for 4x4 and 6x6 have indeterminate examples which can
end up in multiple solutions. The 4x4 grid can reverse the values 1 and
3 depending order of resolution. The 6x6 can display various behavior,
including solving a subset of the puzzle in one step and eliminating
only one possible cell for several guesses before hitting on a solution.
I hope this helps.
Ted Keenan
16 years, 1 month
Build Failure : mvn install
by Siddharth Angrish
I was building the full code and encountered the following error at the end.
Throughout the whole install/build process
everything looked fine. I am not sure though if it has built
drools-verifier/compiler/core correctly. I have attached
the build process logs.
Siddharth
-------------------------------------------------------
T E S T S
-------------------------------------------------------
Running org.drools.dataloaders.jaxb.DroolsJaxbTest
Tests run: 3, Failures: 0, Errors: 2, Skipped: 0, Time elapsed: 2.734 sec
<<< FAILURE!
Results :
Tests in error:
testDirectRoot(org.drools.dataloaders.jaxb.DroolsJaxbTest)
testNestedIterable(org.drools.dataloaders.jaxb.DroolsJaxbTest)
Tests run: 3, Failures: 0, Errors: 2, Skipped: 0
[INFO]
------------------------------------------------------------------------
[ERROR] BUILD FAILURE
[INFO]
------------------------------------------------------------------------
[INFO] There are test failures.
Please refer to
C:\Users\sangrish\workspace\drools-full-code\drools-dataloaders\drools-dataloaders-jaxb\target\surefire-
reports for the individual test results.
[INFO]
------------------------------------------------------------------------
[INFO] For more information, run Maven with the -e switch
[INFO]
------------------------------------------------------------------------
[INFO] Total time: 6 minutes 29 seconds
[INFO] Finished at: Wed Oct 08 21:51:35 EDT 2008
[INFO] Final Memory: 26M/63M
[INFO]
------------------------------------------------------------------------
16 years, 1 month
Re: [rules-users] Chart notation, update, and infinite loops
by Greg Barton
Heck, yeah, I'm up for it. Rulesfest is over, so I'm bored. :P
--- On Tue, 11/4/08, Edson Tirelli <tirelli(a)post.com> wrote:
> From: Edson Tirelli <tirelli(a)post.com>
> Subject: Re: [rules-users] Chart notation, update, and infinite loops
> To: greg_barton(a)yahoo.com, "Rules Users List" <rules-users(a)lists.jboss.org>
> Date: Tuesday, November 4, 2008, 7:54 PM
> That is an excellent project, but it is deep in the core
> engine. Great
> opportunity to learn all about ReteOO and drools internals,
> but will require
> some research from your side... we know the general
> solution, but you may
> still find some obstacles that need to be removed as you
> go.
>
> If you are willing to take the challenge, lets move the
> discussion to
> drools-dev and we can guide you.
>
> []s
> Edson
>
> 2008/11/4 Greg Barton <greg_barton(a)yahoo.com>
>
> > I thought drools had this. If you point me in the
> right direction (and you
> > have the time) I'd be happy to work on that.
> >
> > --- On Tue, 11/4/08, Edson Tirelli
> <tirelli(a)post.com> wrote:
> >
> > > From: Edson Tirelli <tirelli(a)post.com>
> > > Subject: Re: [rules-users] Chart notation,
> update, and infinite loops
> > > To: "Rules Users List"
> <rules-users(a)lists.jboss.org>
> > > Date: Tuesday, November 4, 2008, 7:06 PM
> > > Dan,
> > >
> > > This is a feature that is in our to-do list.
> Jess calls
> > > it "slot specific
> > > updates". We did not had the time yet to
> implement it
> > > though. :(
> > >
> > > []s
> > > Edson
> > >
> > > 2008/11/4 Dan Seaver <dan.seaver(a)ge.com>
> > >
> > > >
> > > > Your understanding is very close to what
> I'm
> > > looking for. I don't mind
> > > > having
> > > > multiple rule activations in other areas of
> the
> > > ruleset when the Fact is
> > > > updated, I just don't want the current
> rule, the
> > > one with the update
> > > > statement, to be reactivated.
> > > >
> > > > Accumulate plus no-loop works fine for the
> specific
> > > case of updating
> > > > amounts, but I'd like to have something
> generic
> > > for more sophisticated
> > > > logic
> > > > that would be implemented in the
> "then"
> > > clause.
> > > >
> > > > Maybe if there was something that looked
> specifically
> > > at each property of
> > > > the update? In this case, the
> "when" clause
> > > is looking at the "name"
> > > > property and the "then" clause is
> updating
> > > the "amount" property. As the
> > > > "name" is not being changed, then
> the update
> > > wouldn't reactivate the rule.
> > > >
> > > >
> > > >
> > > > Greg Barton wrote:
> > > > >
> > > > > If you have the control fact that
> handles the
> > > "applied == false"
> > > > condition
> > > > > you wouldn't need to prevent
> reactivation of
> > > the rule. It would be
> > > > > handled by the condition.
> > > > >
> > > > > I'm thinking Edson's accumulate
> > > suggestion would be best, at this point.
> > > > >
> > > > > If I understand correctly, what you
> want is this:
> > > > >
> > > > > 1) One rule Fact/Charge activation per
> Charge
> > > instance, with no
> > > > > reactivation when the Fact is updated.
> > > > > 2) Other Fact dependent rule
> activations when the
> > > Fact is updated.
> > > > >
> > > > > The problem with making (1) happen is
> that
> > > you'd still have the matched
> > > > > Fact being updated once per Charge,
> which could
> > > lead to reactivation of
> > > > > the rules in (2) multiple times, which
> you may
> > > not want. If you use
> > > > > accumulate in the Fact/Charge rule,
> plus no-loop
> > > to prevent reactivation,
> > > > > you get the best of both worlds: single
> > > activation of the Fact/Charge
> > > > > rule, with a single update to notify
> other rules
> > > that the Fact has
> > > > > changed.
> > > > >
> > > > > I think what you're after is some
> kind of
> > > "modify group," where multiple
> > > > > calls to modify are counted as just
> one, and
> > > rules are notified when the
> > > > > group is closed out. I'm not sure
> how that
> > > would be implemented, because
> > > > > how do you know when the modifications
> are
> > > finished? A low priority
> > > > rule,
> > > > > possibly? Anyway, it doesn't exist
> in
> > > drools, afaik.
> > > > >
> > > > > You could do that kind of thing with an
> > > additional rule that tests for
> > > > the
> > > > > nonexistence of an unprocessed Charge,
> then does
> > > the update. Adding in
> > > > > the control fact for tracking Charges:
> > > > >
> > > > > rule "Update Amount"
> > > > > when
> > > > > amountFact : Fact(name ==
> > > "Amount")
> > > > > $charge : Charge()
> > > > > chargeTracker :
> ChargeTracker(charge ==
> > > $charge, applied == false)
> > > > > then
> > > > > Double amount =
> amountFact.getAmount();
> > > > > Double chargeAmount =
> charge.getAmount();
> > > > > amountFact.setAmount(amount +
> > > chargeAmount);
> > > > > chargeTracker.setApplied(true);
> > > > > update(charge);
> > > > > end
> > > > >
> > > > > rule "Close Facts After Charges
> > > Applied"
> > > > > no-loop false
> > > > > when
> > > > > amountFact : Fact(name ==
> > > "Amount")
> > > > > not ChargeTracker(applied ==
> false)
> > > > > then
> > > > > update(amountFact);
> > > > > end
> > > > >
> > > > > You'd probablt also have to prevent
> the
> > > "Close Facts" rule from firing
> > > > > when there's just no ChargeTrackers
> in
> > > working memory, too.
> > > > >
> > > > > Give that a try.
> > > > >
> > > > > --- On Tue, 11/4/08, Dan Seaver
> > > <dan.seaver(a)ge.com> wrote:
> > > > >
> > > > >> From: Dan Seaver
> <dan.seaver(a)ge.com>
> > > > >> Subject: Re: [rules-users] Chart
> notation,
> > > update, and infinite loops
> > > > >> To: rules-users(a)lists.jboss.org
> > > > >> Date: Tuesday, November 4, 2008,
> 1:55 PM
> > > > >> Greg,
> > > > >> 1) Yes, in this case I'm
> looking for the
> > > cartesian
> > > > >> join.
> > > > >> 2) No, I can't add a property
> to Charge
> > > as it's
> > > > >> part of our corp Object
> > > > >> Model.
> > > > >>
> > > > >> However, I could create a third
> object that
> > > manages whether
> > > > >> the Charge has
> > > > >> been processed which works just
> fine. Unless
> > > there is a
> > > > >> simpler strategy /
> > > > >> technique, I'll go with that.
> > > > >>
> > > > >> Do you know of any way to keep the
> rule from
> > > being put back
> > > > >> on the agenda
> > > > >> when amountFact is updated? I want
> other
> > > rules to know that
> > > > >> it's been
> > > > >> updated, just not the rule that
> made the
> > > change.
> > > > >>
> > > > >> Dan
> > > > >>
> > > > >>
> > > > >> Greg Barton wrote:
> > > > >> >
> > > > >> > 1) Do you want to apply all
> Charges in
> > > working memory
> > > > >> to all "Amount"
> > > > >> > Facts? I ask because the rule
> is a
> > > cartesian join
> > > > >> (i.e. no relation
> > > > >> > between matched objects) and
> that
> > > sometimes performs
> > > > >> in ways users don't
> > > > >> > expect. (i.e. all combinations
> of
> > > objects that match
> > > > >> the conditions are
> > > > >> > affected by the rule)
> > > > >> > 2) Can you add a property to
> the Charge
> > > object? Then
> > > > >> you could use a
> > > > >> > boolean named
> "applied" to
> > > prevent future
> > > > >> matches.
> > > > >> >
> > > > >> > Rule "Update Amount"
> > > > >> > when
> > > > >> > amountFact : Fact(name
> ==
> > > "Amount")
> > > > >> > charge : Charge(applied
> == false)
> > > > >> > then
> > > > >> > Double amount =
> > > amountFact.getAmount();
> > > > >> > Double chargeAmount =
> > > charge.getAmount();
> > > > >> >
> amountFact.setAmount(amount +
> > > chargeAmount);
> > > > >> > update(amountFact);
> > > > >> > charge.setApplied(true);
> > > > >> > update(charge);
> > > > >> > end
> > > > >> >
> > > > >> > If a charge could be applied
> to multiple
> > > Facts you
> > > > >> could maintain an
> > > > >> > "appliedTo" list of
> Facts in
> > > the Charge, and
> > > > >> check that instead of a
> > > > >> > simple boolean.
> > > > >> >
> > > > >> > --- On Tue, 11/4/08, Dan
> Seaver
> > > > >> <dan.seaver(a)ge.com> wrote:
> > > > >> >
> > > > >> >> From: Dan Seaver
> > > <dan.seaver(a)ge.com>
> > > > >> >> Subject: [rules-users]
> Chart
> > > notation, update, and
> > > > >> infinite loops
> > > > >> >> To:
> rules-users(a)lists.jboss.org
> > > > >> >> Date: Tuesday, November 4,
> 2008,
> > > 11:50 AM
> > > > >> >> I'm trying to find a
> good
> > > technique for
> > > > >> updating
> > > > >> >> specific facts in working
> > > > >> >> memory. What I'm
> currently doing
> > > is something
> > > > >> like
> > > > >> >> this:
> > > > >> >>
> > > > >> >> Rule "Update
> Amount"
> > > > >> >> when
> > > > >> >> amountFact :
> Fact(name ==
> > > > >> "Amount")
> > > > >> >> charge : Charge()
> > > > >> >> then
> > > > >> >> Double amount =
> > > amountFact.getAmount();
> > > > >> >> Double chargeAmount
> =
> > > charge.getAmount();
> > > > >> >>
> amountFact.setAmount(amount +
> > > chargeAmount);
> > > > >> >> update(amountFact);
> > > > >> >> end
> > > > >> >>
> > > > >> >> The update statement
> causes an
> > > infinite loop.
> > > > >> >> I tried using no-loop,
> which works
> > > if there is 1
> > > > >> charge,
> > > > >> >> but not if there
> > > > >> >> are more than one.
> > > > >> >>
> > > > >> >> Any help with solutions or
> > > strategies would be
> > > > >> much
> > > > >> >> appreciated.
> > > > >> >> --
> > > > >> >> View this message in
> context:
> > > > >> >>
> > > > >>
> > > >
> > >
> >
> http://www.nabble.com/Chart-notation%2C-update%2C-and-infinite-loops-tp20...
> > > > >> >> Sent from the drools -
> user mailing
> > > list archive
> > > > >> at
> > > > >> >> Nabble.com.
> > > > >> >>
> > > > >> >>
> > > _______________________________________________
> > > > >> >> rules-users mailing list
> > > > >> >>
> rules-users(a)lists.jboss.org
> > > > >> >>
> > > > >>
> > >
> https://lists.jboss.org/mailman/listinfo/rules-users
> > > > >> >
> > > > >> >
> > > > >> >
> > > > >> >
> > > _______________________________________________
> > > > >> > rules-users mailing list
> > > > >> > rules-users(a)lists.jboss.org
> > > > >> >
> > >
> https://lists.jboss.org/mailman/listinfo/rules-users
> > > > >> >
> > > > >> >
> > > > >>
> > > > >> --
> > > > >> View this message in context:
> > > > >>
> > > >
> > >
> >
> http://www.nabble.com/Chart-notation%2C-update%2C-and-infinite-loops-tp20...
> > > > >> Sent from the drools - user mailing
> list
> > > archive at
> > > > >> Nabble.com.
> > > > >>
> > > > >>
> > > _______________________________________________
> > > > >> rules-users mailing list
> > > > >> rules-users(a)lists.jboss.org
> > > > >>
> > >
> https://lists.jboss.org/mailman/listinfo/rules-users
> > > > >
> > > > >
> > > > >
> > > > >
> _______________________________________________
> > > > > rules-users mailing list
> > > > > rules-users(a)lists.jboss.org
> > > > >
> > >
> https://lists.jboss.org/mailman/listinfo/rules-users
> > > > >
> > > > >
> > > >
> > > > --
> > > > View this message in context:
> > > >
> > >
> >
> http://www.nabble.com/Chart-notation%2C-update%2C-and-infinite-loops-tp20...
> > > > Sent from the drools - user mailing list
> archive at
> > > Nabble.com.
> > > >
> > > >
> _______________________________________________
> > > > rules-users mailing list
> > > > rules-users(a)lists.jboss.org
> > > >
> https://lists.jboss.org/mailman/listinfo/rules-users
> > > >
> > >
> > >
> > >
> > > --
> > > Edson Tirelli
> > > JBoss Drools Core Development
> > > JBoss, a division of Red Hat @ www.jboss.com
> > > _______________________________________________
> > > rules-users mailing list
> > > rules-users(a)lists.jboss.org
> > >
> https://lists.jboss.org/mailman/listinfo/rules-users
> >
> >
> >
> > _______________________________________________
> > rules-users mailing list
> > rules-users(a)lists.jboss.org
> > https://lists.jboss.org/mailman/listinfo/rules-users
> >
>
>
>
> --
> Edson Tirelli
> JBoss Drools Core Development
> JBoss, a division of Red Hat @ www.jboss.com
16 years, 1 month
audit logging: instant and appendable log
by Oleg Zenzin
Hi,as I've mentioned in my prev posting I'm trying to generate audit log,
and currently use drools 4.0.4.This time I have actually two questions:
1. Use of WorkingMemoryFileLogger seems to be dedicated to StatefulSession -
there's no way to keep the same log file for multiple StatelessSession
invocations.
2. Drools Eclipse plugin provides pretty nice Audit View which reads the
generated audit log file. The log file is in fact a serialized
java.util.ArrayList in form of xml. Problem is that being a well formed xml
this log file does not allow simply append new event to the end: to keep it
well formed xml I have to either completely re-write it each time a new
event is added or complicate the procedure with read the closing tag </List>
to insert the new event before. But even re-writing does not solve the
problem: the hierarchy of WorkingMemoryLogger does not allow add it to
multiple StatelessSession 's as a listener (see the constructor).
Question: is there a solution in later versions? Would you like me to
suggest my code here?
Thanks!
Oleg
16 years, 1 month
audit logging: better describe facts
by Oleg Zenzin
Best greatings to drools community!
I'm using drools 4.0.4, my current aim is to generate audit log.
Using *WorkingMemoryLogger* and Drools Eclipse IDE Audit View I was able to
fulfil the requirement. Looks pretty nice, thanx for your work!
I have a couple of notes, but think it's better to keep them under different
threads. The first one is about *facts* output. Currently *
WorkingMemoryLogger* uses *toString()* to output information about
*facts*inserted, updated or retracted. In addition there's information
about
*facts* in ActivationLogEvent, collected again using *toString() *default
method. In my code I've implemented simple static method to introspect *fact
* objects and produce Map<String, Object> of properties. That made the log
much more informative.
Question: are there any enhacements (planned) in next versions of Drools?
Would you like me contribute my code into the *WorkingMemoryLogger*?
Thanks!
Oleg
16 years, 1 month