Chained Rules
by djb
Hi all,
I know there are some basic ways to chain rules together, by setting flags
in consequences that are checked in the conditions of other rules...
but in a large system based on rule templates, where thousands of rules are
generated, it is not feasible to chain rules in this manner, especially when
they are chained in a somewhat arbitrary fashion
(eg. True if Rule 130 AND Rule 200 AND Rule 480 fire)
has anyone had this situation before? would I need to execute this as a
post-processing step? or, is there any design pattern that will allow rules
to be chained, preferably in a manageable way?
regards,
Daniel
--
View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/Chained-Rules-tp77549...
Sent from the Drools - User mailing list archive at Nabble.com.
15 years, 5 months
GWT Console - Drools Flow problems.
by tom ska
>
> Hello,
> I am trying to use Drools Flow with GWT Console v.2.1. I use Guvnor and
> Eclipse too. I am new in server applications, and jBoss is for me something
> new, so please be patient :)
> What I did are:
>
1.)Creating processes in Eclipse. They work.
2.)Exporting them to Guvnor - I can see them, everything is OK.
Then I try to start GWT-Console. When I log in, I get this:
- URL: 'http://localhost:8080/gwt-console-server/rs/tasks/admin'
- Action: 'org.jboss.bpm.console.client.task.LoadTasksAction'
- Exception: 'class com.google.gwt.http.client.RequestException'
HTTP 500:
HTTP Status 500 -
------------------------------
*type* Exception report
*message*
*description* *The server encountered an internal error () that prevented it
from fulfilling this request.*
*exception*
org.jboss.resteasy.spi.UnhandledException:
java.lang.IllegalArgumentException: Could not connect task client
org.jboss.resteasy.core.SynchronousDispatcher.handleApplicationException(SynchronousDispatcher.java:319)
org.jboss.resteasy.core.SynchronousDispatcher.handleException(SynchronousDispatcher.java:230)
org.jboss.resteasy.core.SynchronousDispatcher.handleInvokerException(SynchronousDispatcher.java:206)
org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:360)
org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:173)
org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:93)
org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:68)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
org.jboss.bpm.console.server.util.GWTJsonFilter.doFilter(GWTJsonFilter.java:59)
org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
*root cause*
java.lang.IllegalArgumentException: Could not connect task client
org.drools.integration.console.DroolsFlowTaskManagement.connect(DroolsFlowTaskManagement.java:43)
org.drools.integration.console.DroolsFlowTaskManagement.getAssignedTasks(DroolsFlowTaskManagement.java:112)
org.jboss.bpm.console.server.TaskListFacade.getTasksForIdRef(TaskListFacade.java:99)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
java.lang.reflect.Method.invoke(Method.java:597)
org.jboss.resteasy.core.MethodInjectorImpl.invoke(MethodInjectorImpl.java:117)
org.jboss.resteasy.core.ResourceMethod.invokeOnTarget(ResourceMethod.java:260)
org.jboss.resteasy.core.ResourceMethod.invoke(ResourceMethod.java:232)
org.jboss.resteasy.core.ResourceMethod.invoke(ResourceMethod.java:166)
org.jboss.resteasy.core.DispatcherUtilities.getJaxrsResponse(DispatcherUtilities.java:142)
org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:356)
org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:173)
org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:93)
org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:68)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
org.jboss.bpm.console.server.util.GWTJsonFilter.doFilter(GWTJsonFilter.java:59)
org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
*note* *The full stack trace of the root cause is available in the JBoss
Web/2.*
When I click on Process Overwiev, I get:
- URL: 'http://localhost:8080/gwt-console-server/rs/process/definitions'
- Action: 'org.jboss.bpm.console.client.process.UpdateDefinitionsAction'
- Exception: 'class com.google.gwt.http.client.RequestException'
HTTP 500:
HTTP Status 500 -
------------------------------
*type* Exception report
*message*
*description* *The server encountered an internal error () that prevented it
from fulfilling this request.*
*exception*
org.jboss.resteasy.spi.UnhandledException: java.lang.RuntimeException:
Could not initialize stateful knowledge session: Could not commit
session or rollback
org.jboss.resteasy.core.SynchronousDispatcher.handleApplicationException(SynchronousDispatcher.java:319)
org.jboss.resteasy.core.SynchronousDispatcher.handleException(SynchronousDispatcher.java:230)
org.jboss.resteasy.core.SynchronousDispatcher.handleInvokerException(SynchronousDispatcher.java:206)
org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:360)
org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:173)
org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:93)
org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:68)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
org.jboss.bpm.console.server.util.GWTJsonFilter.doFilter(GWTJsonFilter.java:59)
org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
*root cause*
java.lang.RuntimeException: Could not initialize stateful knowledge
session: Could not commit session or rollback
org.drools.integration.console.DroolsFlowCommandDelegate.newStatefulKnowledgeSession(DroolsFlowCommandDelegate.java:86)
org.drools.integration.console.DroolsFlowCommandDelegate.getSession(DroolsFlowCommandDelegate.java:94)
org.drools.integration.console.DroolsFlowCommandDelegate.<init>(DroolsFlowCommandDelegate.java:37)
org.drools.integration.console.DroolsFlowProcessManagement.<init>(DroolsFlowProcessManagement.java:20)
org.drools.integration.console.DroolsFlowManagementFactory.createProcessManagement(DroolsFlowManagementFactory.java:11)
org.jboss.bpm.console.server.ProcessMgmtFacade.getProcessManagement(ProcessMgmtFacade.java:98)
org.jboss.bpm.console.server.ProcessMgmtFacade.getDefinitionsJSON(ProcessMgmtFacade.java:122)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
java.lang.reflect.Method.invoke(Method.java:597)
org.jboss.resteasy.core.MethodInjectorImpl.invoke(MethodInjectorImpl.java:117)
org.jboss.resteasy.core.ResourceMethod.invokeOnTarget(ResourceMethod.java:260)
org.jboss.resteasy.core.ResourceMethod.invoke(ResourceMethod.java:232)
org.jboss.resteasy.core.ResourceMethod.invoke(ResourceMethod.java:166)
org.jboss.resteasy.core.DispatcherUtilities.getJaxrsResponse(DispatcherUtilities.java:142)
org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:356)
org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:173)
org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:93)
org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:68)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
org.jboss.bpm.console.server.util.GWTJsonFilter.doFilter(GWTJsonFilter.java:59)
org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
*root cause*
java.lang.RuntimeException: Could not commit session or rollback
org.drools.persistence.session.SingleSessionCommandService.execute(SingleSessionCommandService.java:289)
org.drools.command.impl.CommandBasedStatefulKnowledgeSession$1.registerWorkItemHandler(CommandBasedStatefulKnowledgeSession.java:144)
org.drools.integration.console.DroolsFlowCommandDelegate.newStatefulKnowledgeSession(DroolsFlowCommandDelegate.java:80)
org.drools.integration.console.DroolsFlowCommandDelegate.getSession(DroolsFlowCommandDelegate.java:94)
org.drools.integration.console.DroolsFlowCommandDelegate.<init>(DroolsFlowCommandDelegate.java:37)
org.drools.integration.console.DroolsFlowProcessManagement.<init>(DroolsFlowProcessManagement.java:20)
org.drools.integration.console.DroolsFlowManagementFactory.createProcessManagement(DroolsFlowManagementFactory.java:11)
org.jboss.bpm.console.server.ProcessMgmtFacade.getProcessManagement(ProcessMgmtFacade.java:98)
org.jboss.bpm.console.server.ProcessMgmtFacade.getDefinitionsJSON(ProcessMgmtFacade.java:122)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
java.lang.reflect.Method.invoke(Method.java:597)
org.jboss.resteasy.core.MethodInjectorImpl.invoke(MethodInjectorImpl.java:117)
org.jboss.resteasy.core.ResourceMethod.invokeOnTarget(ResourceMethod.java:260)
org.jboss.resteasy.core.ResourceMethod.invoke(ResourceMethod.java:232)
org.jboss.resteasy.core.ResourceMethod.invoke(ResourceMethod.java:166)
org.jboss.resteasy.core.DispatcherUtilities.getJaxrsResponse(DispatcherUtilities.java:142)
org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:356)
org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:173)
org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:93)
org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:68)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
org.jboss.bpm.console.server.util.GWTJsonFilter.doFilter(GWTJsonFilter.java:59)
org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
*root cause*
java.lang.RuntimeException: Unable to rollback transaction
org.drools.persistence.session.JtaTransactionManager.rollback(JtaTransactionManager.java:181)
org.drools.persistence.session.SingleSessionCommandService.execute(SingleSessionCommandService.java:287)
org.drools.command.impl.CommandBasedStatefulKnowledgeSession$1.registerWorkItemHandler(CommandBasedStatefulKnowledgeSession.java:144)
org.drools.integration.console.DroolsFlowCommandDelegate.newStatefulKnowledgeSession(DroolsFlowCommandDelegate.java:80)
org.drools.integration.console.DroolsFlowCommandDelegate.getSession(DroolsFlowCommandDelegate.java:94)
org.drools.integration.console.DroolsFlowCommandDelegate.<init>(DroolsFlowCommandDelegate.java:37)
org.drools.integration.console.DroolsFlowProcessManagement.<init>(DroolsFlowProcessManagement.java:20)
org.drools.integration.console.DroolsFlowManagementFactory.createProcessManagement(DroolsFlowManagementFactory.java:11)
org.jboss.bpm.console.server.ProcessMgmtFacade.getProcessManagement(ProcessMgmtFacade.java:98)
org.jboss.bpm.console.server.ProcessMgmtFacade.getDefinitionsJSON(ProcessMgmtFacade.java:122)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
java.lang.reflect.Method.invoke(Method.java:597)
org.jboss.resteasy.core.MethodInjectorImpl.invoke(MethodInjectorImpl.java:117)
org.jboss.resteasy.core.ResourceMethod.invokeOnTarget(ResourceMethod.java:260)
org.jboss.resteasy.core.ResourceMethod.invoke(ResourceMethod.java:232)
org.jboss.resteasy.core.ResourceMethod.invoke(ResourceMethod.java:166)
org.jboss.resteasy.core.DispatcherUtilities.getJaxrsResponse(DispatcherUtilities.java:142)
org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:356)
org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:173)
org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:93)
org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:68)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
org.jboss.bpm.console.server.util.GWTJsonFilter.doFilter(GWTJsonFilter.java:59)
org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
*root cause*
java.lang.IllegalStateException: BaseTransaction.rollback -
[com.arjuna.ats.internal.jta.transaction.arjunacore.notx]
[com.arjuna.ats.internal.jta.transaction.arjunacore.notx] no
transaction!
com.arjuna.ats.internal.jta.transaction.arjunacore.BaseTransaction.rollback(BaseTransaction.java:160)
com.arjuna.ats.jbossatx.BaseTransactionManagerDelegate.rollback(BaseTransactionManagerDelegate.java:114)
org.jboss.tm.usertx.client.ServerVMClientUserTransaction.rollback(ServerVMClientUserTransaction.java:170)
org.drools.persistence.session.JtaTransactionManager.rollback(JtaTransactionManager.java:178)
org.drools.persistence.session.SingleSessionCommandService.execute(SingleSessionCommandService.java:287)
org.drools.command.impl.CommandBasedStatefulKnowledgeSession$1.registerWorkItemHandler(CommandBasedStatefulKnowledgeSession.java:144)
org.drools.integration.console.DroolsFlowCommandDelegate.newStatefulKnowledgeSession(DroolsFlowCommandDelegate.java:80)
org.drools.integration.console.DroolsFlowCommandDelegate.getSession(DroolsFlowCommandDelegate.java:94)
org.drools.integration.console.DroolsFlowCommandDelegate.<init>(DroolsFlowCommandDelegate.java:37)
org.drools.integration.console.DroolsFlowProcessManagement.<init>(DroolsFlowProcessManagement.java:20)
org.drools.integration.console.DroolsFlowManagementFactory.createProcessManagement(DroolsFlowManagementFactory.java:11)
org.jboss.bpm.console.server.ProcessMgmtFacade.getProcessManagement(ProcessMgmtFacade.java:98)
org.jboss.bpm.console.server.ProcessMgmtFacade.getDefinitionsJSON(ProcessMgmtFacade.java:122)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
java.lang.reflect.Method.invoke(Method.java:597)
org.jboss.resteasy.core.MethodInjectorImpl.invoke(MethodInjectorImpl.java:117)
org.jboss.resteasy.core.ResourceMethod.invokeOnTarget(ResourceMethod.java:260)
org.jboss.resteasy.core.ResourceMethod.invoke(ResourceMethod.java:232)
org.jboss.resteasy.core.ResourceMethod.invoke(ResourceMethod.java:166)
org.jboss.resteasy.core.DispatcherUtilities.getJaxrsResponse(DispatcherUtilities.java:142)
org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:356)
org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:173)
org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:93)
org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:68)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
org.jboss.bpm.console.server.util.GWT
ProcessEnginePlugin is marked with this:
I don't know what to do. I read similar thread to this one, but with no
results for me...
Ramran wrote there:
"The gwt-server-console.jar contains 2 javaassit jar files. I have
deleted both these jars and used only 1 javassist.jar file in the JBOSS lib
folder. Try it "
But I was looking for javaassit.jar in gwt-server-console.jar, but I don't
have gwt-server-console.jar file in my jBoss... I have only
"gwt-console-server-
integration-2.1.jar".
I want to show you my jBoss logs while starting this server:
09:26:24,129 INFO [TomcatDeployment] deploy, ctxPath=/admin-console
09:26:24,176 INFO [config] Initializing Mojarra (1.2_12-b01-FCS) for
context '/admin-console'
09:26:27,109 INFO [TomcatDeployment] deploy, ctxPath=/
09:26:27,171 INFO [TomcatDeployment] deploy, ctxPath=/drools-guvnor
09:26:38,279 ERROR [STDERR] SLF4J: Class path contains multiple SLF4J
bindings.
09:26:38,294 ERROR [STDERR] SLF4J: Found binding in [vfszip:/C:/
jboss-5.1.0.GA/server/default/deploy/drools-guvnor.war/WEB-INF/lib/slf4j-log4j12-1.6.0.jar/org/slf4j/impl/StaticLoggerBinder.class<http://jboss-5.1.0.ga/server/default/deploy/drools-guvnor.war/WEB-INF/lib...>
]
09:26:38,294 ERROR [STDERR] SLF4J: Found binding in [vfszip:/C:/
jboss-5.1.0.GA/common/lib/slf4j-jboss-logging.jar/org/slf4j/impl/StaticLoggerBinder.class<http://jboss-5.1.0.ga/common/lib/slf4j-jboss-logging.jar/org/slf4j/impl/S...>
]
09:26:38,294 ERROR [STDERR] SLF4J: See
http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
09:26:44,721 INFO [STDOUT] INFO 27-07 09:26:44,706
(LoggingHelper.java:info:51) Starting mailbox service
09:26:44,721 INFO [STDOUT] INFO 27-07 09:26:44,721
(LoggingHelper.java:info:51) Waking up
09:26:44,737 INFO [STDOUT] INFO 27-07 09:26:44,721
(LoggingHelper.java:info:51) Processing outgoing messages
09:26:44,784 INFO [STDOUT] DEBUG 27-07 09:26:44,784
(LoggingHelper.java:debug:65) Outgoing messages size 0
09:26:44,815 INFO [TomcatDeployment] deploy, ctxPath=/gwt-console
09:26:44,831 INFO [STDOUT] DEBUG 27-07 09:26:44,831
(LoggingHelper.java:debug:65) Processing any inbound messages for
mailman
09:26:44,831 INFO [STDOUT] DEBUG 27-07 09:26:44,831
(LoggingHelper.java:debug:65) Processing any inbound messages for admin
09:26:44,877 ERROR [STDERR] SLF4J: Class path contains multiple SLF4J
bindings.
09:26:44,877 ERROR [STDERR] SLF4J: Found binding in [vfszip:/C:/
jboss-5.1.0.GA/common/lib/slf4j-jboss-logging.jar/org/slf4j/impl/StaticLoggerBinder.class<http://jboss-5.1.0.ga/common/lib/slf4j-jboss-logging.jar/org/slf4j/impl/S...>
]
09:26:44,877 ERROR [STDERR] SLF4J: Found binding in [vfszip:/C:/
jboss-5.1.0.GA/server/default/deploy/gwt-console-drools-5.1.0.CR1.war/WEB-INF/lib/slf4j-log4j12-1.6.0.jar/org/slf4j/impl/StaticLoggerBinder.class<http://jboss-5.1.0.ga/server/default/deploy/gwt-console-drools-5.1.0.CR1....>
]
09:26:44,877 ERROR [STDERR] SLF4J: See
http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
09:26:45,938 ERROR [STDERR] log4j:ERROR A
"org.jboss.logging.appender.FileAppender" object is not assignable to a
"org.apache.log4j.Appender" variable.
09:26:45,938 ERROR [STDERR] log4j:ERROR The class
"org.apache.log4j.Appender" was loaded by
09:26:45,938 ERROR [STDERR] log4j:ERROR [BaseClassLoader@44ee06be
{vfsfile:/C:/
jboss-5.1.0.GA/server/default/deploy/gwt-console-drools-5.1.0.CR1.war/<http://jboss-5.1.0.ga/server/default/deploy/gwt-console-drools-5.1.0.CR1....>}]
whereas object of type
09:26:45,938 ERROR [STDERR] log4j:ERROR
"org.jboss.logging.appender.FileAppender" was loaded by
[org.jboss.bootstrap.NoAnnotationURLClassLoader@4ce86da0].
09:26:45,938 ERROR [STDERR] log4j:ERROR Could not instantiate appender named
"FILE".
.
.
.
09:26:51,445 ERROR [SchemaUpdate] could not get database metadata
org.jboss.util.NestedSQLException: Unable to get managed connection for
jdbc/testDS1; - nested throwable: (javax.resource.ResourceException: Unable
to get managed connection for jdbc/testDS1)
at
org.jboss.resource.adapter.jdbc.WrapperDataSource.getConnection(WrapperDataSource.java:95)
.
.
.
09:26:51,445 ERROR [SchemaUpdate] could not complete schema update
org.jboss.util.NestedSQLException: Unable to get managed connection for
jdbc/testDS1; - nested throwable: (javax.resource.ResourceException: Unable
to get managed connection for jdbc/testDS1)
at
org.jboss.resource.adapter.jdbc.WrapperDataSource.getConnection(WrapperDataSource.java:95)
.
.
.
09:26:52,053 ERROR [STDERR] log4j:ERROR A
"org.jboss.logging.appender.FileAppender" object is not assignable to a
"org.apache.log4j.Appender" variable.
09:26:52,053 ERROR [STDERR] log4j:ERROR The class
"org.apache.log4j.Appender" was loaded by
09:26:52,053 ERROR [STDERR] log4j:ERROR [BaseClassLoader@34fe7e0e
{vfsfile:/C:/
jboss-5.1.0.GA/server/default/deploy/gwt-console-server-drools-5.1.0.CR1.war/<http://jboss-5.1.0.ga/server/default/deploy/gwt-console-server-drools-5.1...>}]
whereas object of type
09:26:52,053 ERROR [STDERR] log4j:ERROR
"org.jboss.logging.appender.FileAppender" was loaded by
[org.jboss.bootstrap.NoAnnotationURLClassLoader@4ce86da0].
09:26:52,053 ERROR [STDERR] log4j:ERROR Could not instantiate appender named
"FILE".
Thanks for any advise,
tom.
15 years, 7 months
creating .pkg from .drl
by Amit Kumar
Hi Folks,
I am trying to create a .pkg file (for probably faster loading) from a .drl
file
Does anybody has a code snippet which I can use. Am unable to find it in
javadocs.
Thanks
Amit
15 years, 7 months
KnowledgeAgent and OSGI
by mmarmol
Hi, I have managed to install Drools-core and Drools-compiler in my Equinox
osgi environment, I can compile rules and execute them just fine, I was just
wandering how to configure a KnowledgeAgent using
KnowledgeBuilderFactoryService and KnowledgeBaseFactoryService. I managed to
configure one but i am not able to reload rules when they change at runtime.
I have started ResourceChangeScannerService and
ResourceChangeNotifierService, changeset related to the rules file gets read
but no change gets implemented. An idea?
Here is the code:
ResourceFactory.getResourceChangeScannerService().start();
ResourceFactory.getResourceChangeNotifierService().start();
ServiceReference serviceRef = bc
.getServiceReference(ServiceRegistry.class.getName());
ServiceRegistry registry = (ServiceRegistry) bc.getService(serviceRef);
KnowledgeBuilderFactoryService knowledgeBuilderFactoryService = registry
.get(KnowledgeBuilderFactoryService.class);
KnowledgeBaseFactoryService knowledgeBaseFactoryService = registry
.get(KnowledgeBaseFactoryService.class);
ResourceFactoryService resourceFactoryService = registry
.get(ResourceFactoryService.class);
KnowledgeBuilderConfiguration kbConf = knowledgeBuilderFactoryService
.newKnowledgeBuilderConfiguration(null, getClass()
.getClassLoader());
KnowledgeBuilder kbuilder = knowledgeBuilderFactoryService
.newKnowledgeBuilder(kbConf);
ResourceFactoryService resource = resourceFactoryService;
kbuilder.add(resource.newFileSystemResource(filePath),
ResourceType.CHANGE_SET);
if (kbuilder.hasErrors()) {
System.out.println(kbuilder.getErrors());
throw new RuntimeException(kbuilder.getErrors().toString());
}
KnowledgeBaseConfiguration kbaseConf = knowledgeBaseFactoryService
.newKnowledgeBaseConfiguration(null, getClass()
.getClassLoader());
KnowledgeBase kbase = knowledgeBaseFactoryService
.newKnowledgeBase(kbaseConf);
kbase.addKnowledgePackages(kbuilder.getKnowledgePackages());
KnowledgeAgentConfiguration aconf =
KnowledgeAgentFactory.newKnowledgeAgentConfiguration();
aconf.setProperty("drools.agent.scanDirectories", "true");
aconf.setProperty("drools.agent.scanResources", "true");
aconf.setProperty("drools.agent.newInstance", "false");
kagent = KnowledgeAgentFactory.newKnowledgeAgent( "CoreDroolsAgent",kbase,
aconf);
kagent.applyChangeSet(resource.newFileSystemResource(filePath));
Thanks in advance!
Cheers
--
View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/KnowledgeAgent-and-OS...
Sent from the Drools - User mailing list archive at Nabble.com.
15 years, 7 months
Updating to 5.1 - what jars do I need to replace?
by Stephen Mcgruer
Hi guys,
Really struggling with what jars I need to replace to update to Drools
5.1. I've tried replacing just the "drools" jars, but I get a
"java.io.InvalidClassException:
org.drools.rule.DialectRuntimeRegistry; local class incompatible:
stream classdesc serialVersionUID = 5308493362083281112, local class
serialVersionUID = 510" error, so I assume I need to replace more -
but I don't know which. I tried replacing all of the ones that had new
versions in the drools 5.1 binaries, but this caused Hibernate to fail
on runtime, claiming it couldnt understand annotations! The following
is a list of the jars currently in the project for Drools 5.0 - I did
not put together this list originally, so some might not be needed but
I dont know which. I would much appreciate some help working out which
jars I need to change to get my code to talk to Guvnor 5.1...
Main lib:
activation-1.1.jar
antlr-2.7.6.jar
antlrworks-1.3.1.jar
btm-1.3.2.jar
com.springsource.org.apache.commons.pool-1.5.3.jar
commons-collections-3.1.jar
commons-dbcp-1.4.jar
commons-io-1.3.2.jar
commons-lang-2.4.jar
commons-logging.jar
core-3.4.2.v_883_R34x.jar
dom4j.jar
drools-ant-5.0.1.jar
drools-api-5.0.1.jar
drools-compiler-5.0.1.jar
drools-core-5.0.1.jar
drools-decisiontables-5.0.1.jar
drools-persistence-jpa-5.0.1.jar
drools-process-task-5.0.1.jar
drools-solver-core-5.0.1.jar
drools-templates-5.0.1.jar
drools-verifier-5.0.1.jar
drools-workitems-5.0.1.jar
ejb3-persistence.jar
hibernate-annotations.jar
hibernate-commons-annotations.jar
hibernate-core.jar
hibernate-entitymanager-3.3.2.GA.jar
hibernate3.jar
janino-2.5.15.jar
jars.txt
javassist-3.9.0.GA.jar
joda-time-1.6.jar
jstl.jar
jta-1.1.jar
junit-3.8.1.jar
log4j-1.2.15.jar
mail-1.4.jar
mvel2-2.0.10.jar
mysql-connector-java-5.1.12-bin.jar
persistence-api-1.0.jar
servlet-api-2.3.jar
slf4j-api-1.5.6.jar
slf4j-log4j12-1.5.10.jar
spring-2.5.6.jar
spring-beans-2.5.6.jar
spring-context-2.5.6.jar
spring-context-support-2.5.6.jar
spring-core-2.5.6.jar
spring-test-2.5.6.jar
spring-web-2.5.6.jar
spring-webmvc.jar
spring.jar
standard.jar
xpp3_min-1.1.4c.jar
xstream-1.3.1.jar
WEBINF:
antlr-2.7.6.jar
antlrworks-1.3.1.jar
com.springsource.org.apache.commons.pool-1.5.3.jar
commons-collections-3.1.jar
commons-dbcp-1.4.jar
commons-lang-2.4.jar
commons-logging.jar
dom4j.jar
drools-ant-5.0.1.jar
drools-api-5.0.1.jar
drools-compiler-5.0.1.jar
drools-core-5.0.1.jar
drools-decisiontables-5.0.1.jar
drools-persistence-jpa-5.0.1.jar
drools-process-task-5.0.1.jar
drools-templates-5.0.1.jar
drools-verifier-5.0.1.jar
drools-workitems-5.0.1.jar
ejb3-persistence.jar
hibernate-annotations.jar
hibernate-commons-annotations.jar
hibernate-core.jar
hibernate3.jar
javassist-3.9.0.GA.jar
jstl.jar
jta-1.1.jar
log4j-1.2.15.jar
mvel2-2.0.10.jar
mysql-connector-java-5.1.12-bin.jar
slf4j-api-1.5.6.jar
slf4j-log4j12-1.5.10.jar
spring-webmvc.jar
spring.jar
standard.jar
test.txt
xstream-1.3.1.jar
Cheers,
Stephen
--
The University of Edinburgh is a charitable body, registered in
Scotland, with registration number SC005336.
15 years, 7 months
Help : Enabling Role Base Authorization in Guvnor
by Han Ming Low
Hi all,
I try to enable the Role Base Authorization in Guvnor after it was running
fine with the default login mechanism.
But, encountered some problem with the attempt.
What I did was that in the components.xml,
- commented out the default <security:identity
authenticate-method="#{defaultAuthenticator.authenticate}"/>
- uncomment the <security:identity
authenticate-method="#{authenticator.authenticate}"
jaas-config-name="other"/>
- change the role base authorization to true,
<security:role-based-permission-resolver
enable-role-based-authorization="true"/>
And at the login-config.xml
I have changed the "other" application policy to
<application-policy name = "other">
<authentication>
<login-module code =
"org.jboss.security.auth.spi.UsersRolesLoginModule"
flag = "required" >
<module-option
name="usersProperties">props/guvnor-users.properties</module-option>
<module-option
name="rolesProperties">props/guvnor-roles.properties</module-option>
</login-module>
</authentication>
</application-policy>
guvnor-users.properties
admin=admin12
krisv=krisv
john=john
mary=mary
guvnor-roles.properties
admin=admin
krisv=admin,manager,user
john=admin,manager,user
mary=admin,manager,user
After restarting JBoss, I can login based on the user and password defined
in the guvnor-users.properties.
And, by changing the password in the properties, I verified that it is
taking in the value from the file itself.
However, when I login as user admin and tried to access the Administration |
User Permission or Event Log,
I'm prompt "Sorry, insufficient permissions to perform this action."
The error from the console is
11:15:36,046 INFO [STDOUT] ERROR 29-07 11:15:36,046
(LoggingHelper.java:error:76)
Service method 'public abstract java.util.Map
org.drools.guvnor.client.rpc.RepositoryService.listUserPermissions()
throws org.drools.guvnor.client.rpc.DetailedSerializationException'
threw an unexpected exception:
org.jboss.seam.security.AuthorizationException:
Authorization check failed for
permission[org.drools.guvnor.server.security.AdminType@bf7a4d,admin]
org.jboss.seam.security.AuthorizationException: Authorization check failed
for permission[org.drools.guvnor.server.security.AdminType@bf7a4d,admin]
at
org.jboss.seam.security.Identity.checkPermission(Identity.java:581)
at
org.drools.guvnor.server.ServiceImplementation.listUserPermissions(ServiceImplementation.java:2604)
.....
Checking on the org.drools.guvnor.server.security.RoleTypes code, the
available role should be
admin
analyst
analyst.readonly
package.admin
package.developer
package.readonly
Can anyone help to let me know what's wrong with my configuration?
Thanks.
Han Ming
15 years, 7 months
Guvnor BRL format
by Sreenath Putta
Hi,
I have couples of questions regarding Guvnor BRL format:
We have a requirement to store the rules in XML format, for that we are
planning to use Guvnor Brl format.Right now Guvnor BRL format does not
support for defining Event correlation part (Temporal reasoning part). we
would end up something like putting these event correlation part in a
freeform.
First thing is will there be any support for event correlation in Guvnor in
near future?
If not we are willing to contribute for that effort. we just wanted to find
out what exactly is the process for going forward and defining these
elements?
Thanks,
Sreenath
15 years, 7 months
Failed to read schema document when trying to transform from XML to DRL
by Chang Liu
Hi there,
Error message:
(null: 5, 77): schema_reference.4: Failed to read schema document 'drools.org/drools-5.0.xsd', because 1) could not find the document; 2) the document could not be read; 3) the root element of the document is not <xsd:schema>.
I ran into this issue when experimenting a project that transforming the rules back and forth from DRL to XML with utility classes as documented in following link:
http://downloads.jboss.com/drools/docs/5.0.1.26597.FINAL/drools-expert/ht...
My code:
...
XmlPackageReader xmlReader = new XmlPackageReader(null);
StringReader sr = new StringReader(rulesInXml);
try {
PackageDescr packageDescr = xmlReader.read(sr);
DrlDumper drlDumper = new DrlDumper();
String drlString = drlDumper.dump(packageDescr);
}
catch (Exception ex) {
System.out.println(ex);
}
...
where string "rulesInXml" is the result xml string transformed from a valid .drl file. It looks like:
<?xml version="1.0" encoding="UTF-8"?>
<package name="com.sample"
xmlns="http://drools.org/drools-5.0"
xmlns:xs="http://www.w3.org/2001/XMLSchema-instance"
xs:schemaLocation="http://drools.org/drools-5.0 drools.org/drools-5.0.xsd">
<import name="com.sample.DroolsTest.Message" />
<rule name="Hello World">
<lhs><pattern identifier="m" object-type="Message" >
<field-constraint field-name="status">
<qualified-identifier-restriction evaluator="==">Message.HELLO </qualified-identifier-restriction>
</field-constraint>
<field-binding field-name="message" identifier="myMessage" />
</pattern>
</lhs>
<rhs> System.out.println( myMessage );
m.setMessage( "Goodbye cruel world" );
m.setStatus( Message.GOODBYE );
update( m );
</rhs>
</rule>
<rule name="GoodBye">
<lhs><pattern object-type="Message" >
<field-constraint field-name="status">
<qualified-identifier-restriction evaluator="==">Message.GOODBYE </qualified-identifier-restriction>
</field-constraint>
<field-binding field-name="message" identifier="myMessage" />
</pattern>
</lhs>
<rhs> System.out.println( myMessage );
</rhs>
</rule>
</package>
What did I miss here?
Moreover, the Drools 5.0 API's for XML support are poorly-documented. For example, the constructors of class "XmlPackageReader" has an arg of "SemanticModules" type which is not documented. :(
Any help would be highly appreciated!
Thanks,
Chang
**********************************************************************
CONFIDENTIALITY NOTICE: The information contained in this email is intended only for the person or entity to which it is addressed and may contain confidential and/or privileged material. If you are not the intended recipient, you are hereby notified that any unauthorized review, use, dissemination, distribution or copying of this communication is prohibited and may be subject to legal restriction or sanction. If you have received this email in error, please notify the sender immediately to arrange for return or destruction of the information and all copies. If you are the intended recipient but do not wish to receive communications through this medium, please advise the sender immediately. Thank you
15 years, 7 months