[rules-users] how to restore the knowledgeBase when newly created kb has compilationFailed error
Hi there, I am using KnowledgeAgent to get the knowledgeBase and have notifierService started to monitor the rules resource. New knowledgeBase is being created when kAgent finds changes on the rules. However, I don't want to replace the old knowledgebase if newly created knowledgebase has some rules with compilation error. Is this something possible? I am using KnowledgeAgentEventListener to detect the compilation error and using drools 5.3 version. thanks in advance. -- View this message in context: http://drools.46999.n3.nabble.com/how-to-restore-the-knowledgeBase-when-newly-created-kb-has-compilationFailed-error-tp4027387.html Sent from the Drools: User forum 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] how to restore the knowledgeBase when newly created kb has compilationFailed error
Thanks for the reply, so far from documentation, I believe newInstance=true(default) replaces the old kb as a whole and =false will update the existing kb. But I didn't see anywhere explaining that if there is a compilation error on rules, it will not update the kb. And I verified. It updates the kb. I don't know if that is expected or bugs in this version. Anyway, I found the workthrough by assigning the kb to the variable and update it only if there is not resourceCompilationFailed using knowledgeBaseUpdated event on KnowledgeAgentEventListener. Anyway, thanks for your help. -- View this message in context: http://drools.46999.n3.nabble.com/how-to-restore-the-knowledgeBase-when-newly-created-kb-has-compilationFailed-error-tp4027387p4027389.html Sent from the Drools: User forum 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] how to check error using knowledgeAgent when rules has error or doesn't compile
Got this working. I was adding the listener at wrong place. thanks -- View this message in context: http://drools.46999.n3.nabble.com/how-to-check-error-using-knowledgeAgent-when-rules-has-error-or-doesn-t-compile-tp4027221p4027362.html Sent from the Drools: User forum 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] Knowledge Agent unexpected behavior for remote resource at guvnor
I added kagent.setSystemEventListener(new PrintStreamSystemEventListener()); to debug futher, its logging following as if it found changes even with no changes made at guvnor. It just seems bug to me. Any comments? -- View this message in context: http://drools.46999.n3.nabble.com/Knowledge-Agent-unexpected-behavior-for-remote-resource-at-guvnor-tp4023893p4023915.html Sent from the Drools: User forum mailing list archive at Nabble.com. ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
[rules-users] Knowledge Agent unexpected behavior for remote resource at guvnor
I am trying to use KnowledgeAgent to auto update the knowledgebase when rules are updated at guvnor. Following is my Test Class that creates the kAgent and executes the rules every 3 Seconds. / import org.drools.KnowledgeBase; import org.drools.agent.KnowledgeAgent; import org.drools.agent.KnowledgeAgentConfiguration; import org.drools.agent.KnowledgeAgentFactory; import org.drools.io.ResourceFactory; import org.drools.runtime.StatefulKnowledgeSession; public class MainClass { public static void main(String[] st) throws Exception { KnowledgeAgentConfiguration aconf = KnowledgeAgentFactory.newKnowledgeAgentConfiguration(); aconf.setProperty(drools.agent.newInstance, true); final KnowledgeAgent kagent = KnowledgeAgentFactory.newKnowledgeAgent(kagent, aconf); ResourceFactory.getResourceChangeNotifierService().start(); ResourceFactory.getResourceChangeScannerService().start(); kagent.applyChangeSet(ResourceFactory.newClassPathResource(ChangeSet.xml)); KnowledgeBase kbase = kagent.getKnowledgeBase(); while (true) { try { Thread.sleep(3000); kbase = kagent.getKnowledgeBase(); System.out.println(Number of packages(should be 1): + kbase.getKnowledgePackages().size()); StatefulKnowledgeSession session = kbase.newStatefulKnowledgeSession(); session.insert(); System.out.println(Number of rules fired: + session.fireAllRules()); session.dispose(); } catch (Exception e) { e.printStackTrace(); } } } } / And following is my ChangeSet.xml / change-set xmlns='http://drools.org/drools-5.0/change-set' xmlns:xs='http://www.w3.org/2001/XMLSchema-instance' xs:schemaLocation='http://drools.org/drools-5.0/change-set http://anonsvn.jboss.org/repos/labs/labs/jbossrules/trunk/drools-api/src/main/resources/change-set-1.0.0.xsd' add resource basicAuthentication=enabled username=admin password=admin type=DRL source=http://localhost:8080/brms/rest/packages/ReceiverConfigurationRules/source;/resource /add /change-set / And I have one rules package ReceiverConfigurationRules and simple drl rule with no condition( so will always fire). So, when I run my program, for few times, it works as expected printing number of packages and number of rule fired as 1. However as soon as DebugKnowledgeAgentEventListener logs the following into the console, It starts printing number of packages with kBase as 0 and number of rules fired as 0. This is unexpected behavior. Is this a bug or am I missing something important? ==[BeforeChangeSetAppliedEvent: org.drools.io.impl.ChangeSetImpl@34f2e383] ==[BeforeChangeSetProcessedEvent: org.drools.io.impl.ChangeSetImpl@34f2e383] ==[BeforeResourceProcessedEvent(RESOURCE_MODIFIED): [UrlResource path='http://localhost:8080/brms/rest/packages/ReceiverConfigurationRules/source']] ==[AfterResourceProcessedEvent(RESOURCE_MODIFIED): [UrlResource path='http://localhost:8080/brms/rest/packages/ReceiverConfigurationRules/source']] ==[AfterChangeSetProcessedEvent: org.drools.io.impl.ChangeSetImpl@34f2e383] ==[KnowledgeBaseUpdatedEvent: org.drools.impl.KnowledgeBaseImpl@3fd7ada9] ==[AfterChangeSetAppliedEvent: org.drools.io.impl.ChangeSetImpl@34f2e383] Weird thing is when I use local resource like source=file:\\\configRules.drl, everything is works perfect. Have anyone experienced such issue? I used drools 5.4.final core as well as 5.3 but same issue. I appreciate your help in advance. -- View this message in context: http://drools.46999.n3.nabble.com/Knowledge-Agent-unexpected-behavior-for-remote-resource-at-guvnor-tp4023893.html Sent from the Drools: User forum 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] Custom Form with DSL
Ghanshyam, Were you able to display the country list based on value selected on other variable? thanks -- View this message in context: http://drools.46999.n3.nabble.com/Custom-Form-with-DSL-tp4020207p4020846.html Sent from the Drools: User forum mailing list archive at Nabble.com. ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
[rules-users] How to retrieving LHS or RHS from the rule.
Guys, Is there anyway we can list out of LHS and RHS from the rule? I know we can get rulename and all metaattributes of a rules from its knowledgebase but didn't see anyway to get LHS and RHS. Thanks in Advance. -- View this message in context: http://drools.46999.n3.nabble.com/How-to-retrieving-LHS-or-RHS-from-the-rule-tp4020634.html Sent from the Drools: User forum 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] Custom Form with DSL
Thanks Mike! I created the JIRA. https://issues.jboss.org/browse/GUVNOR-1956. Regards Rupesh -- View this message in context: http://drools.46999.n3.nabble.com/Custom-Form-with-DSL-tp4020207p4020250.html Sent from the Drools: User forum mailing list archive at Nabble.com. ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
[rules-users] Custom Form with DSL
I were able to launch the custom form in DSL, however the rule condition is not mapped to corresponding DRL. I don't know if this is a bug or just something is missing. my DSL mapping looks like this: [when] my dsl is {varName:CF:MyFactType.fieldName} = System.out.println({varName}) I have working set created then configured custom form for fieldName. All things working but rule is not validating. When I check drl source, I found the mapping is not taking place, its still displaying DSL expression in DRL source instead of displaying: System.out.println(values from cf) Any ideas? I have tried this in guvnor 5.4.0.final and 5.5.beta1 -- View this message in context: http://drools.46999.n3.nabble.com/Custom-Form-with-DSL-tp4020207.html Sent from the Drools: User forum mailing list archive at Nabble.com. ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
[rules-users] DSL with multi value selectable listbox
Hi, Selecting one value from the selectbox using enum is not a problem. But I am wondering if it is possible to create a DSL expression where you can select multiple values from the listbox? bhochhi -- View this message in context: http://drools.46999.n3.nabble.com/DSL-with-multi-value-selectable-listbox-tp4019656.html Sent from the Drools: User forum 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] DSL with multi value selectable listbox
Thanks for the response. -- View this message in context: http://drools.46999.n3.nabble.com/DSL-with-multi-value-selectable-listbox-tp4019656p4019661.html Sent from the Drools: User forum mailing list archive at Nabble.com. ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
[rules-users] how to fetch fresh guvnor resources from drools-camel-server?
I am using drools-camel-server to fetch the remote guvnor resource as follows in knowledge-service.xml: drools:resource type=PKG source=http://localhost:8080/drools-guvnor/org.drools.guvnor.Guvnor/package/mypackage/Test; basic-authentication=enabled username=test password=test / /drools:resources My problem is when I change/add rules at guvnor, this is not reflected on drools-camel-server unless it is restarted. It seems like it is using the local cache and doesn't fetch resource from guvnor after it fetch once during server startup. Does anyone have an idea how to make drools-camel-server fetch guvnor resource remotely every time the service is called? any settings or configuration that I am missing? I am using Jboss AS7. -- View this message in context: http://drools.46999.n3.nabble.com/how-to-fetch-fresh-guvnor-resources-from-drools-camel-server-tp4017721.html Sent from the Drools: User forum mailing list archive at Nabble.com. ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
[rules-users] Re-loading of guvnor resource at drools-camel-server
I am using drools-camel-server 5.4 final to execute the rules fetched from guvnor at follows: drools:resource type=PKG source=http://localhost:8080/drools-guvnor/org.drools.guvnor.Guvnor/package/mypackage/Test; basic-authentication=enabled username=test password=test / /drools:resources drools:ksession id=ksession1 type=stateless kbase=kbase node=node1 / how can I reload or rebuild the knowledgebase so that any changes in the rules instantly get reflected on execution server? -- View this message in context: http://drools.46999.n3.nabble.com/Re-loading-of-guvnor-resource-at-drools-camel-server-tp4017727.html Sent from the Drools: User forum 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] Guvnor 5.4 CR1 role based authentication with JBossAS 7
Any ideas guys? This is making me believe there is something mixing with bean configuration. When I uncommented ... security:jaas.JaasAuthenticator s:modifies/ jaasConfigNameother/jaasConfigName /security:jaas.JaasAuthenticator .. guvnor fails to deploy with following with following snippet of exception. 02:20:35,659 WARN [org.jboss.solder.config.xml.model.ModelBuilder] (MSC service thread 1-6) Solder Config could not resolve XML namspace for: {} 02:20:35,659 ERROR [stderr] (MSC service thread 1-6) java.lang.NullPointerException 02:20:35,659 ERROR [stderr] (MSC service thread 1-6)at org.jboss.solder.config.xml.model.ModelBuilder.validateXmlItem(ModelBuilder.java:237) 02:20:35,659 ERROR [stderr] (MSC service thread 1-6)at org.jboss.solder.config.xml.model.ModelBuilder.addNodeToResult(ModelBuilder.java:102) 02:20:35,659 ERROR [stderr] (MSC service thread 1-6)at org.jboss.solder.config.xml.model.ModelBuilder.build(ModelBuilder.java:88) 02:20:35,664 ERROR [stderr] (MSC service thread 1-6)at org.jboss.solder.config.xml.bootstrap.XmlConfigExtension.beforeBeanDiscovery(XmlConfigExtension.java:93) Any help appreciated. -- View this message in context: http://drools.46999.n3.nabble.com/Guvnor-5-4-CR1-role-based-authentication-with-JBossAS-7-tp3969454p3970612.html Sent from the Drools: User forum mailing list archive at Nabble.com. ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
[rules-users] Guvnor 5.4 CR1 role based authentication with JBossAS 7
Hello, Has anybody successfully set up the role based authentication on Guvnor 5.4 CR1 hosted on Jboss AS7? I tried all possible way I could think of but in vain. I modified bean.xml(commented security:IdentityImpl in whole and uncommented security:jaas.JaasAuthenticator and guvnorSecurity:RoleBasedPermissionResolver ). I also replaced code=UsersRoles for security-domain name=other cache-type=default under login-module in standalone.xml. Could anyone please help me how to configure role-based authentication for guvnor based on properties files? Is was so obvious on 5.3 or former. But this new 5.4 looks so different. Thanks -- View this message in context: http://drools.46999.n3.nabble.com/Guvnor-5-4-CR1-role-based-authentication-with-JBossAS-7-tp3969454.html Sent from the Drools: User forum mailing list archive at Nabble.com. ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
[rules-users] upgrading drools-server 5.0 to drools-camel-server 5.4
After 2 years, I am trying to upgrade from drools 5.0 to latest. The way we are using the drools: the client apps(in c# and ruby) sends the request to drools-server 5.0. This execution server gets the rules .pkg file from guvnor using the properties files that map rules package at guvnor and response with output of rules execution. Unfortunately, the new execution server doesn't seems to work same way as the new one is completely different. I deployed drools-camel-server-5.4.war and saw how test.jsp is working. Then I changed knowledge-service.xml to replace the local drl resource to remote pkg at guvnor as follows: drools:resource type=DRL source=classpath:test.drl/ to drools:resource type=PKG source=http://localhost:8080/drools-guvnor/org.drools.guvnor.Guvnor/package/test/ex; basicAuthentication=enabled username=admin password=admin / When I ran the test.jsp, I got exception, snippet below. There were few other warning exceptions too, but not sure which is cause this problem. To make my question short, I want to know is there at quick example or docs that explain how I can use drools-camel-server to response the actions(output of execution) to external app that sends the request with conditions, where camel server gets the rules pkg from guvnor? I have create the jersey based webservice to do exactly the same, but I want to understand how this new camel-based server works. I appreciate any kind of your help. ERROR [org.apache.camel.processor.DefaultErrorHandler] (http--127.0.0.1-8080-4) Failed delivery for exchangeId: ID-NormanDev2-52157-1335809674758-0-1. Exhausted after delivery attempt: 1 caught: org.apache.camel.RuntimeCamelException: Body of in message not of the expected type 'org.drools.command.Command' for uridrools://node1/ksession1: org.apache.camel.RuntimeCamelException: Body of in message not of the expected type 'org.drools.command.Command' for uridrools://node1/ksession1 at org.drools.camel.component.DroolsExecuteProducer.process(DroolsExecuteProducer.java:63) [drools-camel-5.4.0.CR1.jar:5.4.0.CR1] at org.apache.camel.util.AsyncProcessorConverterHelper$ProcessorToAsyncProcessorBridge.process(AsyncProcessorConverterHelper.java:61) [camel-core-2.9.0.jar:2.9.0] at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73) [camel-core-2.9.0.jar:2.9.0] at org.apache.camel.processor.SendProcessor$2.doInAsyncProducer(SendProcessor.java:115) [camel-core-2.9.0.jar:2.9.0] at org.apache.camel.impl.ProducerCache.doInAsyncProducer(ProducerCache.java:285) [camel-core-2.9.0.jar:2.9.0] -- View this message in context: http://drools.46999.n3.nabble.com/upgrading-drools-server-5-0-to-drools-camel-server-5-4-tp3951496.html Sent from the Drools: User forum 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] Some problems with Deploying drools-camel-sever 5.3.x in Weblogic 10.x
To make your test example work, make sure that you are deploying the server as drools-server.war or drools-server. Or you might have to change route at client-client.xml -- View this message in context: http://drools.46999.n3.nabble.com/Some-problems-with-Deploying-drools-camel-sever-5-3-x-in-Weblogic-10-x-tp3786473p3951656.html Sent from the Drools: User forum mailing list archive at Nabble.com. ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users