Re: [rules-users] Fwd: Re: Guvnor - expected value of a list
In the summary: "...was [[test1,test1]] expected [[test1,test1]]" Looks like it should work. Can you tell me more about ClassB. Is it a pojo or declared model and is the field "items" a collection and what kind of? Thanks Toni On Feb 15, 2012, at 10:07 AM, Péter Gombás wrote: > Hi, > > still not working. Now i get even an error message (in attachment). > > Peter > > 2012/2/15 Toni Rikkola : >> Try =[test1,test1] >> >> Toni >> >> On Feb 15, 2012, at 9:47 AM, Michael Anstis wrote: >> >> >> sent on the move >> >> -- Forwarded message -- >> From: "Péter Gombás" >> Date: 15 Feb 2012 07:40 >> Subject: Re: [rules-users] Guvnor - expected value of a list >> To: >> >> Hello Michael, >> >> yes, it is a Test scenario in Guvnor. In attachment is a very simple >> project. Target is to check the resulting list. On the picture you can >> see the problem: altough expected values are the same as target the >> test is not succesful. Or am i using it not correctly? >> >> Peter >> >> 2012/2/14 Michael Anstis : >>> I assume this is a QA \ Test Scenario in Guvnor? >>> >>> It's going to be helpful if you can provide an export of your repository >>> (or >>> an extract) showing the issue. >>> >>> >>> On 14 February 2012 16:12, gombasp wrote: Hello, I have the following problem: i would like to compare a value in expected section of a Guvnor test. Guvnor says actual value is: (Actual: [test1, test1]) When i enter [test1, test1] to the expected value it will not match with actual. Is it possible to compare list values? If yes, what is the syntax? Thanks, Peter -- View this message in context: http://drools.46999.n3.nabble.com/Guvnor-expected-value-of-a-list-tp3744129p3744129.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 mailing list >>> rules-users@lists.jboss.org >>> https://lists.jboss.org/mailman/listinfo/rules-users >>> >> >> >> >> -- >> Gombás Péter >> >> ___ >> >> rules-users mailing list >> rules-users@lists.jboss.org >> https://lists.jboss.org/mailman/listinfo/rules-users >> >> >> >> ___ >> rules-users mailing list >> rules-users@lists.jboss.org >> https://lists.jboss.org/mailman/listinfo/rules-users >> > > > > -- > Gombás Péter > ___ > rules-users mailing list > rules-users@lists.jboss.org > https://lists.jboss.org/mailman/listinfo/rules-users ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] [planner] uninitialized planning value [error]
For the record: In your solverConfig, you're missing a || section (use FIRST_FIT) before the || section, see manual for more information or most of the examples. I 'll file a JIRA to get a better exception message when this occurs. Op 14-02-12 15:39, Nurlan schreef: Is it possible setting planning entity with uninitialized planning value into solution? if it is possible, then how? :) plz, help me :) When I execute my code with not null planning variables everything work fine, but when i execute without setting planning variables I have [Exception in thread "main" java.lang.NullPointerException] 2012-02-14 17:32:08,119 [main] INFO Solver started: time spend (0), score (null), new best score (null), random seed (0). Exception in thread "main" java.lang.NullPointerException at org.drools.planner.core.score.definition.HardAndSoftScoreDefinition.calculateTimeGradient(HardAndSoftScoreDefinition.java:73) at org.drools.planner.core.score.definition.HardAndSoftScoreDefinition.calculateTimeGradient(HardAndSoftScoreDefinition.java:25) at org.drools.planner.core.termination.ScoreAttainedTermination.calculateSolverTimeGradient(ScoreAttainedTermination.java:52) at org.drools.planner.core.termination.OrCompositeTermination.calculateSolverTimeGradient(OrCompositeTermination.java:70) at org.drools.planner.core.termination.OrCompositeTermination.calculateSolverTimeGradient(OrCompositeTermination.java:70) at org.drools.planner.core.termination.PhaseToSolverTerminationBridge.calculatePhaseTimeGradient(PhaseToSolverTerminationBridge.java:49) at org.drools.planner.core.localsearch.DefaultLocalSearchSolverPhase.solve(DefaultLocalSearchSolverPhase.java:55) at org.drools.planner.core.solver.DefaultSolver.runSolverPhases(DefaultSolver.java:166) at org.drools.planner.core.solver.DefaultSolver.solve(DefaultSolver.java:138) at kz.bee.drools.planner.dating.DatingMain.start(DatingMain.java:58) at kz.bee.drools.planner.dating.DatingMain.main(DatingMain.java:38) -- View this message in context: http://drools.46999.n3.nabble.com/uninitialized-planning-value-error-tp3743831p3743831.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 -- With kind regards, Geoffrey De Smet ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] Fwd: Re: Guvnor - expected value of a list
Hello, its a simple pojo: package com.gp; import java.util.ArrayList; import java.util.List; public class ClassB { List items = new ArrayList(); public void add(String s, int faktor) { for (int i = 0; i < faktor; i++) { items.add(s); } } public List getItems() { return items; } public void setItems(List items) { this.items = items; } } 2012/2/15 Toni Rikkola : > In the summary: "...was [[test1,test1]] expected [[test1,test1]]" > Looks like it should work. Can you tell me more about ClassB. Is it a pojo or > declared model and is the field "items" a collection and what kind of? > > Thanks > Toni > > On Feb 15, 2012, at 10:07 AM, Péter Gombás wrote: > >> Hi, >> >> still not working. Now i get even an error message (in attachment). >> >> Peter >> >> 2012/2/15 Toni Rikkola : >>> Try =[test1,test1] >>> >>> Toni >>> >>> On Feb 15, 2012, at 9:47 AM, Michael Anstis wrote: >>> >>> >>> sent on the move >>> >>> -- Forwarded message -- >>> From: "Péter Gombás" >>> Date: 15 Feb 2012 07:40 >>> Subject: Re: [rules-users] Guvnor - expected value of a list >>> To: >>> >>> Hello Michael, >>> >>> yes, it is a Test scenario in Guvnor. In attachment is a very simple >>> project. Target is to check the resulting list. On the picture you can >>> see the problem: altough expected values are the same as target the >>> test is not succesful. Or am i using it not correctly? >>> >>> Peter >>> >>> 2012/2/14 Michael Anstis : I assume this is a QA \ Test Scenario in Guvnor? It's going to be helpful if you can provide an export of your repository (or an extract) showing the issue. On 14 February 2012 16:12, gombasp wrote: > > Hello, > > I have the following problem: i would like to compare a value in expected > section of a Guvnor test. Guvnor says actual value is: > > (Actual: [test1, test1]) > > When i enter [test1, test1] to the expected value it will not match with > actual. > Is it possible to compare list values? If yes, what is the syntax? > > Thanks, > > Peter > > -- > View this message in context: > > http://drools.46999.n3.nabble.com/Guvnor-expected-value-of-a-list-tp3744129p3744129.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 mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users >>> >>> >>> >>> -- >>> Gombás Péter >>> >>> ___ >>> >>> rules-users mailing list >>> rules-users@lists.jboss.org >>> https://lists.jboss.org/mailman/listinfo/rules-users >>> >>> >>> >>> ___ >>> rules-users mailing list >>> rules-users@lists.jboss.org >>> https://lists.jboss.org/mailman/listinfo/rules-users >>> >> >> >> >> -- >> Gombás Péter >> ___ >> rules-users mailing list >> rules-users@lists.jboss.org >> https://lists.jboss.org/mailman/listinfo/rules-users > > > ___ > rules-users mailing list > rules-users@lists.jboss.org > https://lists.jboss.org/mailman/listinfo/rules-users -- Gombás Péter ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] [planner] uninitialized planning value [error]
after this I get another NPE: I tried find my mistake :( Exception in thread "main" java.lang.NullPointerException at org.drools.common.NamedEntryPoint.update(NamedEntryPoint.java:380) at org.drools.common.AbstractWorkingMemory.update(AbstractWorkingMemory.java:958) at org.drools.common.AbstractWorkingMemory.update(AbstractWorkingMemory.java:931) at kz.bee.drools.planner.dating.solver.move.WomanChangeMove.doMove(WomanChangeMove.java:67) at org.drools.planner.core.localsearch.decider.DefaultDecider.doMove(DefaultDecider.java:141) at org.drools.planner.core.localsearch.decider.DefaultDecider.decideNextStep(DefaultDecider.java:116) at org.drools.planner.core.localsearch.DefaultLocalSearchSolverPhase.solve(DefaultLocalSearchSolverPhase.java:57) at org.drools.planner.core.solver.DefaultSolver.runSolverPhases(DefaultSolver.java:166) at org.drools.planner.core.solver.DefaultSolver.solve(DefaultSolver.java:138) at kz.bee.drools.planner.dating.DatingMain.start(DatingMain.java:59) at kz.bee.drools.planner.dating.DatingMain.main(DatingMain.java:39) -- View this message in context: http://drools.46999.n3.nabble.com/uninitialized-planning-value-error-tp3743831p3746381.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] KnowledgeAgent custom class loader not working for PKG resources
I believe there may be a bug when trying to use a custom class loader with the KnowledgeAgent and the KnowledgeBuilderConfiguration, and when the ChangeSet is a PKG resource. I have been trying to get the knowledge-agent-classloader sample from the new Drools Cookbook to work with a PKG resource. The sample works fine for a DRL resource, but when I convert it to use my fact jar, and a PKG resource containing my rules, which I downloaded from Guvnor, it throws a ClassNotFoundException for my fact model. If I put my fact model in the classpath, the error goes away and my rules can be added to the KnowledgeAgent and run correctly. Following is the code from the sample that I have converted, and I have attached a zip file with a complete project demonstrating the problem. Also, I can get my rules and fact model to work if I use a DRL ChangeSet.knowledge-agent-classloader.zip URL modelJarURL = getClass().getResource("Patient-1.0.jar"); URLClassLoader customURLClassloader = new URLClassLoader(new URL[] {modelJarURL }); KnowledgeBuilderConfiguration kbuilderConfig = KnowledgeBuilderFactory.newKnowledgeBuilderConfiguration(null, customURLClassloader); KnowledgeBaseConfiguration kbaseConfig = KnowledgeBaseFactory.newKnowledgeBaseConfiguration(null, customURLClassloader); KnowledgeBase kbase = KnowledgeBaseFactory.newKnowledgeBase(kbaseConfig); KnowledgeAgentConfiguration aconf = KnowledgeAgentFactory.newKnowledgeAgentConfiguration(); KnowledgeAgent kagent = KnowledgeAgentFactory.newKnowledgeAgent("test", kbase, aconf, kbuilderConfig); // kagent.applyChangeSet(new ClassPathResource("change-set.xml", getClass())); // this goes with model.jar // kagent.applyChangeSet(new ClassPathResource("drl-change-set.xml", getClass())); // this goes with Patient.jar kagent.applyChangeSet(new ClassPathResource("pkg-change-set.xml", getClass())); // this goes with Patient.jar return kagent.getKnowledgeBase(); Following is the stack trace from the error: java.lang.NullPointerException at org.drools.impl.KnowledgeBaseImpl.addKnowledgePackages(KnowledgeBaseImpl.java:148) at org.drools.agent.impl.KnowledgeAgentImpl.addResourcesToKnowledgeBase(KnowledgeAgentImpl.java:1016) at org.drools.agent.impl.KnowledgeAgentImpl.rebuildResources(KnowledgeAgentImpl.java:785) at org.drools.agent.impl.KnowledgeAgentImpl.buildKnowledgeBase(KnowledgeAgentImpl.java:657) at org.drools.agent.impl.KnowledgeAgentImpl.applyChangeSet(KnowledgeAgentImpl.java:190) at org.drools.agent.impl.KnowledgeAgentImpl.applyChangeSet(KnowledgeAgentImpl.java:169) at drools.cookbook.chapter02.KnowledgeAgentClassloaderTest.createKnowledgeBase(KnowledgeAgentClassloaderTest.java:59) at drools.cookbook.chapter02.KnowledgeAgentClassloaderTest.customClassloaderTest(KnowledgeAgentClassloaderTest.java:30) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.junit.internal.runners.TestMethod.invoke(TestMethod.java:59) at org.junit.internal.runners.MethodRoadie.runTestMethod(MethodRoadie.java:98) at org.junit.internal.runners.MethodRoadie$2.run(MethodRoadie.java:79) at org.junit.internal.runners.MethodRoadie.runBeforesThenTestThenAfters(MethodRoadie.java:87) at org.junit.internal.runners.MethodRoadie.runTest(MethodRoadie.java:77) at org.junit.internal.runners.MethodRoadie.run(MethodRoadie.java:42) at org.junit.internal.runners.JUnit4ClassRunner.invokeTestMethod(JUnit4ClassRunner.java:88) at org.junit.internal.runners.JUnit4ClassRunner.runMethods(JUnit4ClassRunner.java:51) at org.junit.internal.runners.JUnit4ClassRunner$1.run(JUnit4ClassRunner.java:44) at org.junit.internal.runners.ClassRoadie.runUnprotected(ClassRoadie.java:27) at org.junit.internal.runners.ClassRoadie.runProtected(ClassRoadie.java:37) at org.junit.internal.runners.JUnit4ClassRunner.run(JUnit4ClassRunner.java:42) at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50) at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197) I have been having the exact same problem when trying to use a custom class l
Re: [rules-users] [planner] uninitialized planning value [error]
Looks like in WomanChangeMove you do workingMemory(null, entity) or (handle, null) Op 15-02-12 10:56, Nurlan schreef: > after this I get another NPE: > > I tried find my mistake :( > > > Exception in thread "main" java.lang.NullPointerException > at org.drools.common.NamedEntryPoint.update(NamedEntryPoint.java:380) > at > org.drools.common.AbstractWorkingMemory.update(AbstractWorkingMemory.java:958) > at > org.drools.common.AbstractWorkingMemory.update(AbstractWorkingMemory.java:931) > at > kz.bee.drools.planner.dating.solver.move.WomanChangeMove.doMove(WomanChangeMove.java:67) > at > org.drools.planner.core.localsearch.decider.DefaultDecider.doMove(DefaultDecider.java:141) > at > org.drools.planner.core.localsearch.decider.DefaultDecider.decideNextStep(DefaultDecider.java:116) > at > org.drools.planner.core.localsearch.DefaultLocalSearchSolverPhase.solve(DefaultLocalSearchSolverPhase.java:57) > at > org.drools.planner.core.solver.DefaultSolver.runSolverPhases(DefaultSolver.java:166) > at > org.drools.planner.core.solver.DefaultSolver.solve(DefaultSolver.java:138) > at kz.bee.drools.planner.dating.DatingMain.start(DatingMain.java:59) > at kz.bee.drools.planner.dating.DatingMain.main(DatingMain.java:39) > > > -- > View this message in context: > http://drools.46999.n3.nabble.com/uninitialized-planning-value-error-tp3743831p3746381.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 > -- With kind regards, Geoffrey De Smet ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
[rules-users] Opening Package in Designer editor through UUID
I have a one doubt in this designer editor of DROOLS-guvnor war file.When I open the designer editor through http://localhost:8080/designer/editor?profile=jbpm&uuid=123456..It is succesfully opening the designer editor.But,there is no option to save it.So,I tried with URL http://localhost:8080/drools-guvnor/org.drools.guvnor.Guvnor/standaloneEditorServlet?client=oryx&hideRuleLHS=false&hideRuleRHS=true&hideRuleAttributes=true&assetsUUIDs=123456. Now,I can succesfully see the save changes option... Can you suggest me in opening Package through Designer editor using uuids.I'm able to open rules,BPMN Process using uuids. Regards Krishna Murthy -- View this message in context: http://drools.46999.n3.nabble.com/Opening-Package-in-Designer-editor-through-UUID-tp3746626p3746626.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] Can we edit "view source " option in Drools Guvnor
Hi All, I dont know wheter it is possible or not. i was create a one Decison Table with 100 rules( 100 rows) , So i want to copy this decision table into another new Guvnor (if i export the repository i am loosing the data which is there already in new Guvnor ) So my requirement is to copy the Decision table into new Guvnor without loosing the existing data in new Guvnor. (OR) else is there any way to edit the "view source" option , So that i can copy the code into the new Guvnor... Thanks in Advance, Regards, Veera -- View this message in context: http://drools.46999.n3.nabble.com/Can-we-edit-view-source-option-in-Drools-Guvnor-tp3746631p3746631.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] Opening Package in Designer editor through UUID
Your question answered in the jBPM forum (https://community.jboss.org/message/716783#716783). Thanks. On 2/15/12 6:24 AM, srinivasasanda wrote: > I have a one doubt in this designer editor of DROOLS-guvnor war file.When I > open the designer editor through > http://localhost:8080/designer/editor?profile=jbpm&uuid=123456..It is > succesfully opening the designer editor.But,there is no option to save > it.So,I tried with URL > http://localhost:8080/drools-guvnor/org.drools.guvnor.Guvnor/standaloneEditorServlet?client=oryx&hideRuleLHS=false&hideRuleRHS=true&hideRuleAttributes=true&assetsUUIDs=123456. > > > > Now,I can succesfully see the save changes option... > > > Can you suggest me in opening Package through Designer editor using > uuids.I'm able to open rules,BPMN Process using uuids. > > > > Regards > > Krishna Murthy > > -- > View this message in context: > http://drools.46999.n3.nabble.com/Opening-Package-in-Designer-editor-through-UUID-tp3746626p3746626.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 mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] Fwd: Re: Guvnor - expected value of a list
Looks like a bug. I made a Jira for it. https://issues.jboss.org/browse/GUVNOR-1830 Toni On Feb 15, 2012, at 10:45 AM, Péter Gombás wrote: > Hello, > > its a simple pojo: > > package com.gp; > > > import java.util.ArrayList; > import java.util.List; > > public class ClassB > { >List items = new ArrayList(); > >public void add(String s, int faktor) >{ >for (int i = 0; i < faktor; i++) >{ >items.add(s); >} > >} > >public List getItems() >{ >return items; >} > >public void setItems(List items) >{ >this.items = items; >} > > } > > > > > > 2012/2/15 Toni Rikkola : >> In the summary: "...was [[test1,test1]] expected [[test1,test1]]" >> Looks like it should work. Can you tell me more about ClassB. Is it a pojo >> or declared model and is the field "items" a collection and what kind of? >> >> Thanks >> Toni >> >> On Feb 15, 2012, at 10:07 AM, Péter Gombás wrote: >> >>> Hi, >>> >>> still not working. Now i get even an error message (in attachment). >>> >>> Peter >>> >>> 2012/2/15 Toni Rikkola : Try =[test1,test1] Toni On Feb 15, 2012, at 9:47 AM, Michael Anstis wrote: sent on the move -- Forwarded message -- From: "Péter Gombás" Date: 15 Feb 2012 07:40 Subject: Re: [rules-users] Guvnor - expected value of a list To: Hello Michael, yes, it is a Test scenario in Guvnor. In attachment is a very simple project. Target is to check the resulting list. On the picture you can see the problem: altough expected values are the same as target the test is not succesful. Or am i using it not correctly? Peter 2012/2/14 Michael Anstis : > I assume this is a QA \ Test Scenario in Guvnor? > > It's going to be helpful if you can provide an export of your repository > (or > an extract) showing the issue. > > > On 14 February 2012 16:12, gombasp wrote: >> >> Hello, >> >> I have the following problem: i would like to compare a value in expected >> section of a Guvnor test. Guvnor says actual value is: >> >> (Actual: [test1, test1]) >> >> When i enter [test1, test1] to the expected value it will not match with >> actual. >> Is it possible to compare list values? If yes, what is the syntax? >> >> Thanks, >> >> Peter >> >> -- >> View this message in context: >> >> http://drools.46999.n3.nabble.com/Guvnor-expected-value-of-a-list-tp3744129p3744129.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 mailing list > rules-users@lists.jboss.org > https://lists.jboss.org/mailman/listinfo/rules-users > -- Gombás Péter ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users >>> >>> >>> >>> -- >>> Gombás Péter >>> ___ >>> rules-users mailing list >>> rules-users@lists.jboss.org >>> https://lists.jboss.org/mailman/listinfo/rules-users >> >> >> ___ >> rules-users mailing list >> rules-users@lists.jboss.org >> https://lists.jboss.org/mailman/listinfo/rules-users > > > > -- > Gombás Péter > > ___ > rules-users mailing list > rules-users@lists.jboss.org > https://lists.jboss.org/mailman/listinfo/rules-users ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] Can we edit "view source " option in Drools Guvnor
You could copy the DRL from source view (edit, remove line numbers) and import as a new package... however this is a bit of a cludge. There is a bulk importer but I don't know if it will help (Rikkola may know). Otherwise using the REST API to connect to one instance (of Guvnor) and write to another may prove a useful mechanism. sent on the move On 15 Feb 2012 11:28, "Veera" wrote: > Hi All, > > I dont know wheter it is possible or not. > > i was create a one Decison Table with 100 rules( 100 rows) , So i want to > copy > this decision table into another new Guvnor > > (if i export the repository i am loosing the data which is there already in > new Guvnor ) > > So my requirement is to copy the Decision table into new Guvnor without > loosing the existing data in > new Guvnor. > > > (OR) else is there any way to edit the "view source" option , So that i can > copy the code into the new > Guvnor... > > Thanks in Advance, > > Regards, > Veera > > > > -- > View this message in context: > http://drools.46999.n3.nabble.com/Can-we-edit-view-source-option-in-Drools-Guvnor-tp3746631p3746631.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 mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] Failed to get rules from Guvor after apply Security using Tomcat and JAAS
Please search in this list about this problem. Your question has been answered before. I think the documentation also has a section about how to add security elements to the change-set. Best Regards, Esteban Aliverti - Developer @ http://www.plugtree.com - Blog @ http://ilesteban.wordpress.com 2012/2/15 mujoko mujoko > Dear Rules Users, > > > Previously, I use guvnor with no security. > Now, my boss wants me to apply security on guvnor. > > The way I implement is use this link > http://ngjweb.wordpress.com/2011/12/07/drools-guvnor-manage-access-part-2/ > > > which is using realm of tomcat and create a table is the system for guvnor > user. > I tested from browser, the security is working fine even more than 10 > users access concurrently. > > But when my application access the guvnor and try to create the knowledge > base. It's becoming intermittent. > After several time access the guvnor, the guvnor is hang/can not access > even from browser. > > Here is the exception I got > > java.lang.RuntimeException: java.io.IOException: Server returned HTTP > response code: 401 for URL: > http://localhost:9090/guvnor/org.drools.guvnor.Guvnor/package/com.rbtsb.tm.meter/meter-internet/Dro > pCDR-LocalcallWithBRemarks.drl > > at > org.drools.compiler.PackageBuilder.addKnowledgeResource(PackageBuilder.java:692) > at > org.drools.builder.impl.KnowledgeBuilderImpl.add(KnowledgeBuilderImpl.java:37 > > The way our app access the guvnor after apply security is as below. > Snipped Code > > UrlResource urlResource = (UrlResource) > ResourceFactory.newUrlResource(ruleUrl); > urlResource.setBasicAuthentication("enabled"); > urlResource.setUsername("admin"); > urlResource.setPassword("admin"); > builder.add(urlResource,ResourceType.DRL); > > -- > Mujoko > http://www.linkedin.com/in/mujoko > > > ___ > rules-users mailing list > rules-users@lists.jboss.org > https://lists.jboss.org/mailman/listinfo/rules-users > > ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
[rules-users] rule with array
Hi, I meet a problem to find an element in an array. First, I have a 2 dimensional array and a 1 dimensional array. I need to compare whether the element in 2 dimensional array is as same as 1 dimensional array. How to solve it? Like: In Java - int [][] A; int [] B; how to iterate array A and array B to find which element is the same in Drool? -- View this message in context: http://drools.46999.n3.nabble.com/rule-with-array-tp3747680p3747680.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] rule with array
Consider writing a DRL function that does the test and call it in an inline eval(). -W On 15 February 2012 18:26, shawn wrote: > Hi, > I meet a problem to find an element in an array. > First, I have a 2 dimensional array and a 1 dimensional array. > I need to compare whether the element in 2 dimensional array is as same as > 1 > dimensional array. > How to solve it? > Like: > In Java - int [][] A; int [] B; > how to iterate array A and array B to find which element is the same in > Drool? > > > -- > View this message in context: > http://drools.46999.n3.nabble.com/rule-with-array-tp3747680p3747680.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 mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] rule with array
yeah, I have thought about it. But if I use function, I have to write three for loops. like: /*function Boolean findSubject(Request request) { Pointer sPointer = request.getSubjectPath(); Pointer aPointer = request.getAuthorTable(); for( int i = 0; i < p.length; i++ ) { for( int j = 0; j < p[i].length; j++) { for( Iterator iter = aPointer.iterator(); iter.hasNext(); ) // if..else } } }*/ sPointer is a int[][]; aPointer is a ArrayList. I need to find which element in aPointer has the same value in sPointer. If I use function, I think it the efficiency is not so good. Do you have any other ideas? -- View this message in context: http://drools.46999.n3.nabble.com/rule-with-array-tp3747680p3747895.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] rule with array
I found someone idea. It's kind of like split array. when Request( $sPath : getSubjectPath() ) // get two dimensional array then for( int i = 0; i < $sPath.length; i++ ) { insert( $sPath[i]); } But I don't know how to find the facts that are inserted through for loop. -- View this message in context: http://drools.46999.n3.nabble.com/rule-with-array-tp3747680p3747911.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] drools template - drt
In many ways, I find using drools template(drt) is more convenient than using Dtable. But I could not find much info about the templates(drt) user forum or drools web site . any comments or am i missing something. thanks, - with kind regards, -- View this message in context: http://drools.46999.n3.nabble.com/drools-template-drt-tp3749115p3749115.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] Failed to get rules from Guvor after apply Security using Tomcat and JAAS
Thank you Esteban, I'll try to find it 2012/2/16 Esteban Aliverti > Please search in this list about this problem. Your question has been > answered before. I think the documentation also has a section about how to > add security elements to the change-set. > > Best Regards, > > > > Esteban Aliverti > - Developer @ http://www.plugtree.com > - Blog @ http://ilesteban.wordpress.com > > > 2012/2/15 mujoko mujoko > >> Dear Rules Users, >> >> >> Previously, I use guvnor with no security. >> Now, my boss wants me to apply security on guvnor. >> >> The way I implement is use this link >> http://ngjweb.wordpress.com/2011/12/07/drools-guvnor-manage-access-part-2/ >> >> >> which is using realm of tomcat and create a table is the system for >> guvnor user. >> I tested from browser, the security is working fine even more than 10 >> users access concurrently. >> >> But when my application access the guvnor and try to create the knowledge >> base. It's becoming intermittent. >> After several time access the guvnor, the guvnor is hang/can not access >> even from browser. >> >> Here is the exception I got >> >> java.lang.RuntimeException: java.io.IOException: Server returned HTTP >> response code: 401 for URL: >> http://localhost:9090/guvnor/org.drools.guvnor.Guvnor/package/com.rbtsb.tm.meter/meter-internet/Dro >> pCDR-LocalcallWithBRemarks.drl >> >> at >> org.drools.compiler.PackageBuilder.addKnowledgeResource(PackageBuilder.java:692) >> at >> org.drools.builder.impl.KnowledgeBuilderImpl.add(KnowledgeBuilderImpl.java:37 >> >> The way our app access the guvnor after apply security is as below. >> Snipped Code >> >> UrlResource urlResource = (UrlResource) >> ResourceFactory.newUrlResource(ruleUrl); >> urlResource.setBasicAuthentication("enabled"); >> urlResource.setUsername("admin"); >> urlResource.setPassword("admin"); >> builder.add(urlResource,ResourceType.DRL); >> >> -- >> Mujoko >> http://www.linkedin.com/in/mujoko >> >> >> ___ >> rules-users mailing list >> rules-users@lists.jboss.org >> https://lists.jboss.org/mailman/listinfo/rules-users >> >> > > ___ > rules-users mailing list > rules-users@lists.jboss.org > https://lists.jboss.org/mailman/listinfo/rules-users > > -- Mujoko http://www.linkedin.com/in/mujoko ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] drools template - drt
Have you read the Drools Expert documentation? sent on the move On 16 Feb 2012 03:19, "domingo" wrote: > In many ways, I find using drools template(drt) is more convenient than > using > Dtable. But I could not find much info about the templates(drt) user forum > or drools web site . any comments or am i missing something. > > thanks, > > - > with kind regards, > > -- > View this message in context: > http://drools.46999.n3.nabble.com/drools-template-drt-tp3749115p3749115.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 mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] rule with array
On 15/02/2012, shawn wrote: > I found someone idea. It's kind of like split array. > when > Request( $sPath : getSubjectPath() ) // get two dimensional array > then > for( int i = 0; i < $sPath.length; i++ ) { > > insert( $sPath[i]); > > } > But I don't know how to find the facts that are inserted through for loop. > This is almost certainly not a good idea. Apart from not being able to write a pattern for int[] you'd have to deal with the inserted arrays, and the efficiency isn't improved by this at all. If you don't see a triple nested loop in your code then this doesn't mean that it isn't there. It seems to me that the type of Request could be improved upon. -W ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users