RE: [rules-users] QueryResult.getFactHandles bug?
Any feedback on this? Just curious, we've worked around it, but I'd like to know if my assumption was wrong or if this is an actual problem. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Fenderbosch, Eric Sent: Monday, June 09, 2008 11:39 AM To: rules-users@lists.jboss.org Subject: [rules-users] QueryResult.getFactHandles bug? I didn't find a JIRA for this and I'm pretty sure my test is valid. QueryResult.getFactHandles() seems to be only returning [fid:-1:X:null] I'm using 4.0.7. Here's my test case: public void testQueryResults() throws Exception { StatefulSession workingMemory = DroolsUtil.getWorkingMemory(); TestFact testFact = new TestFact(); String id = "1234"; testFact.setId(id); FactHandle testHandle = workingMemory.insert(testFact); System.out.println(testHandle); Object[] args = {id}; int resultCount = 0; int factCount = 0; int handleCount = 0; Object fact = null; FactHandle handle = null; // query getTestFact(String _id) // TestFact(id == _id) // end QueryResults queryResults = workingMemory.getQueryResults("getTestFact", args); Iterator iterator = queryResults.iterator(); while (iterator.hasNext()) { resultCount++; QueryResult result = iterator.next(); FactHandle[] handles = result.getFactHandles(); for (FactHandle h : handles) { handleCount++; handle = h; } for (int i = 0; i < result.size(); i++) { factCount++; fact = result.get(i); } } System.out.println(handle); assertTrue(resultCount == 1); assertTrue(factCount == 1); assertTrue(testFact == fact); assertTrue(handleCount == 1); // this fails assertTrue(testHandle == handle); } TestFact is very simple, using id in hashCode and equals. Am I using getFactHandles correctly? Thanks. ___ 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] QueryResult.getFactHandles bug?
Hi Drools users, I am trying to compile drools rule files in to a package file using ANT task as follows. But I am getting an error when the ANT build is run. Here is my ANT build file. All the necessary jars are there in the classpath. Could you please correct me if I have done a wrong thing or let me know if there is a alternative for this. Appreciate all your help. Error : Buildfile: build.xml rules: BUILD FAILED C:\eclipse3.3.2\workspace\CalCulateVAT\cmdcompile\src\build.xml:31: RuleBaseTask failed: U nable to load dialect 'org.drools.rule.builder.dialect.java.JavaDialectConfiguration:java' Thanks Hareendra Pelige This message, including any attachments, contains confidential information intended for a specific individual and purpose, and is intended for the addressee only. Any unauthorized disclosure, use, dissemination, copying, or distribution of this message or any of its attachments or the information contained in this e-mail, or the taking of any action based on it, is strictly prohibited. If you are not the intended recipient, please notify the sender immediately by return e-mail and delete this message.___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
RE: [rules-users] QueryResult.getFactHandles bug?
Looks like there's a JIRA for this now. Some feedback would have been nice, however. http://jira.jboss.com/jira/browse/JBRULES-1649 -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Fenderbosch, Eric Sent: Monday, June 16, 2008 11:00 AM To: Rules Users List Subject: RE: [rules-users] QueryResult.getFactHandles bug? Any feedback on this? Just curious, we've worked around it, but I'd like to know if my assumption was wrong or if this is an actual problem. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Fenderbosch, Eric Sent: Monday, June 09, 2008 11:39 AM To: rules-users@lists.jboss.org Subject: [rules-users] QueryResult.getFactHandles bug? I didn't find a JIRA for this and I'm pretty sure my test is valid. QueryResult.getFactHandles() seems to be only returning [fid:-1:X:null] I'm using 4.0.7. Here's my test case: public void testQueryResults() throws Exception { StatefulSession workingMemory = DroolsUtil.getWorkingMemory(); TestFact testFact = new TestFact(); String id = "1234"; testFact.setId(id); FactHandle testHandle = workingMemory.insert(testFact); System.out.println(testHandle); Object[] args = {id}; int resultCount = 0; int factCount = 0; int handleCount = 0; Object fact = null; FactHandle handle = null; // query getTestFact(String _id) // TestFact(id == _id) // end QueryResults queryResults = workingMemory.getQueryResults("getTestFact", args); Iterator iterator = queryResults.iterator(); while (iterator.hasNext()) { resultCount++; QueryResult result = iterator.next(); FactHandle[] handles = result.getFactHandles(); for (FactHandle h : handles) { handleCount++; handle = h; } for (int i = 0; i < result.size(); i++) { factCount++; fact = result.get(i); } } System.out.println(handle); assertTrue(resultCount == 1); assertTrue(factCount == 1); assertTrue(testFact == fact); assertTrue(handleCount == 1); // this fails assertTrue(testHandle == handle); } TestFact is very simple, using id in hashCode and equals. Am I using getFactHandles correctly? Thanks. ___ 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 mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users