Re: [rules-users] Problem with Banking Tutorial
Hi all, thanks a lot for your helpful answers. I'm looking forward to the update to 5.6.0. Is the mentioned time horizon (a few days) still realistic? I.e. could you recommend me to pause the evaluation of drools, instead of downgrading to 5.4.0? We consider to use drools in a larger project, and I have to decide whether I recommend drools, or prefer a simpler design developed from scratch. As far it's an fact that I cannot recommend drools 5.5.0. What version is reasonable to use for further evaluation? Stefan 2013/4/19 Wolfgang Laun wolfgang.l...@gmail.com On 18/04/2013, Stefan Schuster stefan.m.schus...@gmail.com wrote: Please don't misunderstand me, I have a deep respect for the developer of such complex systems like DROOLS, and I know from my own code that bugs simply happen. But I wonder why there is still this version without any warning the official release? Not putting out warnings when some release is known to be broken is a rather dark spot on the gloss of Drools. I have urged this before, mainly because not warning users is a primary cause for them wasting time and effort. Keep carping... Wolfgang Is it better to use an older version? best regards Stefan 2013/4/18 Mark Proctor mproc...@codehaus.org There are a lot of fixes in the 5.x master. Anyone verified their bugs against this? I suspect this is fixed in that. Mark On 18 Apr 2013, at 16:21, Wolfgang Laun wolfgang.l...@gmail.com wrote: Ah, my memory :-) http://lists.jboss.org/pipermail/rules-dev/2013-January/004338.html Mark has promised a fix for 3 months ago, but of course 5.5.0 remains broken. -W On 18/04/2013, Stefan Schuster stefan.m.schus...@gmail.com wrote: Hi, thank you for your response. I'm using the latest stable release of Drools 5.5.0 final. Eclipse is Juno Service Release 2. Can you confirm, that the order 1,2,3 is the expected result? If this is a known bug, is there some kind of jira or bugzilla numer assigned to it? 2013/4/18 Wolfgang Laun wolfgang.l...@gmail.com IIRC, this was a bug one or two minor versions ago. What version are you using? -W On 18/04/2013, Stefan Schuster stefan.m.schus...@gmail.com wrote: For the sake of completeness, here is also the RuleRunner class used in this example: package org.drools.tutorials.banking; import java.util.Collection; import org.drools.KnowledgeBase; import org.drools.KnowledgeBaseFactory; import org.drools.builder.KnowledgeBuilder; import org.drools.builder.KnowledgeBuilderFactory; import org.drools.builder.ResourceType; import org.drools.definition.KnowledgePackage; import org.drools.io.ResourceFactory; import org.drools.runtime.StatefulKnowledgeSession; public class RuleRunner { public RuleRunner() { } public void runRules(String[] rules, Object[] facts) { KnowledgeBase kbase = KnowledgeBaseFactory.newKnowledgeBase(); KnowledgeBuilder kbuilder = KnowledgeBuilderFactory.newKnowledgeBuilder(); for ( int i = 0; i rules.length; i++ ) { String ruleFile = rules[i]; System.out.println( Loading file: + ruleFile ); kbuilder.add( ResourceFactory.newClassPathResource( ruleFile, RuleRunner.class ), ResourceType.DRL ); } CollectionKnowledgePackage pkgs = kbuilder.getKnowledgePackages(); kbase.addKnowledgePackages( pkgs ); StatefulKnowledgeSession ksession = kbase.newStatefulKnowledgeSession(); for ( int i = 0; i facts.length; i++ ) { Object fact = facts[i]; System.out.println( Inserting fact: + fact ); ksession.insert( fact ); } ksession.fireAllRules(); } } 2013/4/18 Stefan Schuster stefan.m.schus...@gmail.com Hello, I have a problem with the banking tutorial number 3, which is part of the examples of drools expert. It simply adds some Numbers as facts, and retracts them in an increasing order. It is very short, therefore I post the whole Code: BankingExample3.java _ package org.drools.tutorials.banking; public class BankingExample3 { public static void main(String[] args) { Number[] numbers = new Number[] {wrap(3), wrap(1), wrap(4), wrap(1), wrap(5)}; new RuleRunner().runRules( new String[] { Example3.drl }, numbers ); } private static Integer wrap(int i) { return new Integer(i); } } _ Example3.drl: _ package org.drools.tutorials.banking
[rules-users] Problem migrating from newClassPathResource to newUrlResource
hi, I was recently trying to create a kbase using UrlResource instead of using changeset.xml. So, I wrote the following code : KnowledgeAgentConfiguration kaconf = KnowledgeAgentFactory.newKnowledgeAgentConfiguration(); kaconf.setProperty( drools.agent.scanDirectories, false ); KnowledgeAgent kagent = KnowledgeAgentFactory.newKnowledgeAgent( test agent, kaconf ); UrlResource urlResource = (UrlResource) ResourceFactory.newUrlResource(http://localhost:8080/drools-guvnor/org.drools.guvnor.Guvnor/package/Goal%20Creation%20Charges/LATEST/ChangeSet.xml;); urlResource.setResourceType(ResourceType.PKG); urlResource.setBasicAuthentication(enabled); urlResource.setUsername(admin); urlResource.setPassword(admin); kagent.applyChangeSet(urlResource); kbase=kagent.getKnowledgeBase(); But, to my disappointment this code kept giving me the following error : Server returned HTTP response code: 401 for URL: http://localhost:8080/drools-guvnor/org.drools.guvnor.Guvnor/package/Goal%20Creation%20Charges/LATEST The changeset which i was using with the follwing code is attached for reference : kagent.applyChangeSet(ResourceFactor.newClassPathResource(drools/resource/changeset.xml)); changeset.xml http://drools.46999.n3.nabble.com/file/n4023490/changeset.xml Regards, Abhinay -- View this message in context: http://drools.46999.n3.nabble.com/Problem-migrating-from-newClassPathResource-to-newUrlResource-tp4023490.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] Designer for Guvnor 5.3.5
You will need to deploy the war file. You should be able to find it here... http://mvnrepository.com/artifact/org.drools -- View this message in context: http://drools.46999.n3.nabble.com/rules-users-Designer-for-Guvnor-5-3-5-tp4023481p4023494.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] Error deploying Guvnor 6.0.0.Beta1 on Tomcat 7
Thank you manstis. I'll keep a watch for Beta2. -- View this message in context: http://drools.46999.n3.nabble.com/Error-deploying-Guvnor-6-0-0-Beta1-on-Tomcat-7-tp4023456p4023493.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] Problem with Banking Tutorial
It is still realistic.. the team is preparing a beta release of 6.x. When that is done, I hope they will focus on finalizing 5.x.. I am waiting for 5.6.Final myself :) You may have answered this question before.. could you give a try at 5.5.1-SNAPSHOT? Thanks for your patience Davide On 04/23/2013 01:50 AM, Stefan Schuster wrote: Hi all, thanks a lot for your helpful answers. I'm looking forward to the update to 5.6.0. Is the mentioned time horizon (a few days) still realistic? I.e. could you recommend me to pause the evaluation of drools, instead of downgrading to 5.4.0? We consider to use drools in a larger project, and I have to decide whether I recommend drools, or prefer a simpler design developed from scratch. As far it's an fact that I cannot recommend drools 5.5.0. What version is reasonable to use for further evaluation? Stefan 2013/4/19 Wolfgang Laun wolfgang.l...@gmail.com mailto:wolfgang.l...@gmail.com On 18/04/2013, Stefan Schuster stefan.m.schus...@gmail.com mailto:stefan.m.schus...@gmail.com wrote: Please don't misunderstand me, I have a deep respect for the developer of such complex systems like DROOLS, and I know from my own code that bugs simply happen. But I wonder why there is still this version without any warning the official release? Not putting out warnings when some release is known to be broken is a rather dark spot on the gloss of Drools. I have urged this before, mainly because not warning users is a primary cause for them wasting time and effort. Keep carping... Wolfgang Is it better to use an older version? best regards Stefan 2013/4/18 Mark Proctor mproc...@codehaus.org mailto:mproc...@codehaus.org There are a lot of fixes in the 5.x master. Anyone verified their bugs against this? I suspect this is fixed in that. Mark On 18 Apr 2013, at 16:21, Wolfgang Laun wolfgang.l...@gmail.com mailto:wolfgang.l...@gmail.com wrote: Ah, my memory :-) http://lists.jboss.org/pipermail/rules-dev/2013-January/004338.html Mark has promised a fix for 3 months ago, but of course 5.5.0 remains broken. -W On 18/04/2013, Stefan Schuster stefan.m.schus...@gmail.com mailto:stefan.m.schus...@gmail.com wrote: Hi, thank you for your response. I'm using the latest stable release of Drools 5.5.0 final. Eclipse is Juno Service Release 2. Can you confirm, that the order 1,2,3 is the expected result? If this is a known bug, is there some kind of jira or bugzilla numer assigned to it? 2013/4/18 Wolfgang Laun wolfgang.l...@gmail.com mailto:wolfgang.l...@gmail.com IIRC, this was a bug one or two minor versions ago. What version are you using? -W On 18/04/2013, Stefan Schuster stefan.m.schus...@gmail.com mailto:stefan.m.schus...@gmail.com wrote: For the sake of completeness, here is also the RuleRunner class used in this example: package org.drools.tutorials.banking; import java.util.Collection; import org.drools.KnowledgeBase; import org.drools.KnowledgeBaseFactory; import org.drools.builder.KnowledgeBuilder; import org.drools.builder.KnowledgeBuilderFactory; import org.drools.builder.ResourceType; import org.drools.definition.KnowledgePackage; import org.drools.io.ResourceFactory; import org.drools.runtime.StatefulKnowledgeSession; public class RuleRunner { public RuleRunner() { } public void runRules(String[] rules, Object[] facts) { KnowledgeBase kbase = KnowledgeBaseFactory.newKnowledgeBase(); KnowledgeBuilder kbuilder = KnowledgeBuilderFactory.newKnowledgeBuilder(); for ( int i = 0; i rules.length; i++ ) { String ruleFile = rules[i]; System.out.println( Loading file: + ruleFile ); kbuilder.add( ResourceFactory.newClassPathResource( ruleFile, RuleRunner.class ), ResourceType.DRL ); } CollectionKnowledgePackage pkgs = kbuilder.getKnowledgePackages(); kbase.addKnowledgePackages( pkgs ); StatefulKnowledgeSession ksession = kbase.newStatefulKnowledgeSession(); for ( int i = 0; i facts.length; i++ ) { Object fact = facts[i]; System.out.println( Inserting fact: + fact ); ksession.insert( fact );