 
                                        
                                
                         
                        
                                
                                
                                        
                                                
                                        
                                        
                                        [JBoss JIRA] Created: (JGRP-457) Optimization: make threads return immediately if NAKACK has another active thread for the same sender
                                
                                
                                
                                    
                                        by Bela Ban (JIRA)
                                    
                                
                                
                                        Optimization: make threads return immediately if NAKACK has another active thread for the same sender
-----------------------------------------------------------------------------------------------------
                 Key: JGRP-457
                 URL: http://jira.jboss.com/jira/browse/JGRP-457
             Project: JGroups
          Issue Type: Feature Request
            Reporter: Bela Ban
         Assigned To: Bela Ban
            Priority: Minor
             Fix For: 2.5
In NAKACK, when a thread places a message for sender S into the NakReceiverWindow NRW, it subsequently acquires a lock on NRW (lock by sender) and removes as many messages as possible and passes them up.
If many threads do this at the same time, all threads but one are blocked, and - when finally unblocked - usually return. This causes context switches and possibly cache flushing, so a better way would be to have the threads check whether another thread is already removing messages using a CAS operation *before* acquiring the lock.
The effect should be that no threads will wait on the lock unnecessarily, and thus fewer context switches, and more threads available to the pool.
-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
        
                                
                         
                        
                                
                                1 week, 6 days
                        
                        
                 
         
 
        
            
        
        
        
            
        
        
        
                
                        
                                
                                 
                                        
                                
                         
                        
                                
                                
                                        
                                                
                                        
                                        
                                        [JBoss JIRA] Created: (JBRULES-2045) Rules Fact Error In Complex Condition Structure
                                
                                
                                
                                    
                                        by Hao Chen (JIRA)
                                    
                                
                                
                                        Rules Fact Error In Complex Condition Structure
-----------------------------------------------
                 Key: JBRULES-2045
                 URL: https://jira.jboss.org/jira/browse/JBRULES-2045
             Project: JBoss Drools
          Issue Type: Bug
      Security Level: Public (Everyone can see)
          Components: drools-core
    Affects Versions: 4.0.6
            Reporter: Hao Chen
            Assignee: Mark Proctor
We are running into a complex production rule that either doesn't work or generate errors. I debugged and it seems Drools is not using the correct fact for some segments of the rule conditions.  Steps to reproduce
1. Build the attached test case
2. Run the DroolsDefectTest junit test, it should print value "Worked!" on the output console.
3. Modify the rule by remove the commented condition that uses variable b2.
4. Run the test again. 
 Expected result: the rule should output "Worked!" again. 
 Actual result: failed with error: 
org.drools.RuntimeDroolsException: org.drools.test.Rule_test_0Eval4Invoker@68f1f17a : java.lang.NumberFormatException: For input string: "Y"
	at org.drools.rule.EvalCondition.isAllowed(EvalCondition.java:82)
	at org.drools.reteoo.EvalConditionNode.assertTuple(EvalConditionNode.java:148)
	at org.drools.reteoo.SingleTupleSinkAdapter.propagateAssertTuple(SingleTupleSinkAdapter.java:20)
	at org.drools.reteoo.JoinNode.assertObject(JoinNode.java:156)
	at org.drools.reteoo.CompositeObjectSinkAdapter.propagateAssertObject(CompositeObjectSinkAdapter.java:318)
	at org.drools.reteoo.AlphaNode.assertObject(AlphaNode.java:145)
	at org.drools.reteoo.CompositeObjectSinkAdapter.propagateAssertObject(CompositeObjectSinkAdapter.java:299)
	at org.drools.reteoo.ObjectTypeNode.assertObject(ObjectTypeNode.java:162)
	at org.drools.reteoo.Rete.assertObject(Rete.java:175)
	at org.drools.reteoo.ReteooRuleBase.assertObject(ReteooRuleBase.java:192)
	at org.drools.reteoo.ReteooWorkingMemory.doInsert(ReteooWorkingMemory.java:71)
	at org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:915)
	at org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:887)
	at org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:688)
	at com.firstbest.rules.DroolsDefectTest.test_drools(DroolsDefectTest.java:35)
	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 junit.framework.TestCase.runTest(TestCase.java:154)
	at junit.framework.TestCase.runBare(TestCase.java:127)
	at junit.framework.TestResult$1.protect(TestResult.java:106)
	at junit.framework.TestResult.runProtected(TestResult.java:124)
	at junit.framework.TestResult.run(TestResult.java:109)
	at junit.framework.TestCase.run(TestCase.java:118)
	at junit.framework.TestSuite.runTest(TestSuite.java:208)
	at junit.framework.TestSuite.run(TestSuite.java:203)
	at org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3TestReference.java:130)
	at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)
Caused by: java.lang.NumberFormatException: For input string: "Y"
	at java.lang.NumberFormatException.forInputString(Unknown Source)
	at java.lang.Integer.parseInt(Unknown Source)
	at java.lang.Integer.valueOf(Unknown Source)
	at com.firstbest.rules.Field.intValue(Field.java:29)
	at org.drools.test.Rule_test_0.eval4(Rule_test_0.java:32)
	at org.drools.test.Rule_test_0Eval4Invoker.evaluate(Rule_test_0Eval4Invoker.java:20)
	at org.drools.rule.EvalCondition.isAllowed(EvalCondition.java:77)
	... 32 more
-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
        
                                
                         
                        
                                
                                12 years, 11 months
                        
                        
                 
         
 
        
            
        
        
        
                
                        
                                
                                 
                                        
                                
                         
                        
                                
                                
                                        
                                                
                                        
                                        
                                        [JBoss JIRA] Created: (JBRULES-2123) issue with the call of a drl function
                                
                                
                                
                                    
                                        by Marco Ghanitab (JIRA)
                                    
                                
                                
                                        issue with the call of a drl function
-------------------------------------
                 Key: JBRULES-2123
                 URL: https://jira.jboss.org/jira/browse/JBRULES-2123
             Project: JBoss Drools
          Issue Type: Bug
      Security Level: Public (Everyone can see)
          Components: drools-core
    Affects Versions: 5.0.1.FINAL
            Reporter: Marco Ghanitab
            Assignee: Mark Proctor
            Priority: Minor
in a drl file with a rule "reset" ad a function "formatDate",a bad behaviour is verified when is called the function in the "when" block..it call the function many times, but if the function called is stored in a external java file (not drl) everything works fine, and it call the function only 2 times (correct).
Here the code of the drl file:
rule "reset"
        when
                $conversation:Conversation(resource.code == "sms", tickets.size > 0)
                not Discount(date == (formatDate($conversation.getStopDate())))
        then 
                Discount discount = new Discount();
                discount.setDate(formatDate($conversation.getStopDate()));
                discount.setQuantity(495);
                insert(discount);               
                System.out.println("reset " + discount.getDate());
end
 
declare Discount
   date : String
   quantity : int
end
 
function String formatDate(java.util.Date date) {
        java.text.SimpleDateFormat formatter = new java.text.SimpleDateFormat("dd/MM/yy");
        return formatter.format(date);
}
-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
        
                                
                         
                        
                                
                                12 years, 11 months
                        
                        
                 
         
 
        
            
        
        
        
                
                        
                                
                                 
                                        
                                
                         
                        
                                
                                
                                        
                                                
                                        
                                        
                                        [JBoss JIRA] Created: (JBRULES-2052) DrlDumper does wrong dumps, when lhs contains complex conditions with And.
                                
                                
                                
                                    
                                        by Kateryna Rudenko (JIRA)
                                    
                                
                                
                                        DrlDumper does wrong dumps, when lhs contains complex conditions with And.  
----------------------------------------------------------------------------
                 Key: JBRULES-2052
                 URL: https://jira.jboss.org/jira/browse/JBRULES-2052
             Project: JBoss Drools
          Issue Type: Bug
      Security Level: Public (Everyone can see)
          Components: drools-core
    Affects Versions: 5.0.0.CR1
            Reporter: Kateryna Rudenko
            Assignee: Mark Proctor
DrlDumper does wrong dumps, when lhs contains complex conditions with And.
When there is ConditionalElementDescr in other ConditionalElementDescr, DrlDumper prints condition without round brackets. But should, because formed text can not be parsed with DrlParser into the same tree structure.
Example 1.
rule in file "Test1.drl":
rule "continued_rule"
	no-loop true
when
   ($a : Action1() || $b : Action2())
   &&
   ($c : Action3() || $d : Action4())
then
   System.out.println("Fired.");
end
And method:
   public void test1() throws DroolsParserException
   {
      DrlParser parser = new DrlParser();
      final InputStream drl = getClass().getResourceAsStream(
            "Test1.drl");
      final PackageDescr packageDescr = parser.parse(drl);
      if (parser.hasErrors())
      {
         Assert.fail(parser.getErrors().toString());
      }
      final String dump = new DrlDumper().dump(packageDescr);
      System.out.println(dump);
   }
Output is:
rule "continued_rule" 
	 no-loop true
	 when
		$a : Action1(  ) || 		$b : Action2(  ) && 		$c : Action3(  ) || 		$d : Action4(  )
	 then
   System.out.println("Fired.");
end 
According to operation priority in this case will be 
		$a : Action1(  ) || 		($b : Action2(  ) && 		$c : Action3(  )) || 		$d : Action4(  )
and it is quite another operation.
DrlDumper should support brackets to save operation grouping.
Example 2.
Rule
rule "continued_rule2"
	no-loop true
when
   ($a : Action1() && $b : Action2())
   ||
   ($c : Action3() && $d : Action4())
then
   System.out.println("Fired.");
end
Out after performing test1() from Example 1:
rule "continued_rule" 
	 no-loop true
	 when
		$a : Action1(  ) || 		$c : Action3(  )
	 then
   System.out.println("Fired.");
end
DrlDumper lost $b : Action2() and $d : Action4()! It happened because processOrDescrList in DrlDumper. 
In string 
if ( descrString.endsWith( DrlDumper.eol ) ) {
                descrString = descrString.substring( 0,
                                                     descrString.indexOf( DrlDumper.eol ) );
            } 
we lose all subconditions except first line. It should be 
if ( descrString.endsWith( DrlDumper.eol ) ) {
                descrString = descrString.substring( 0,
                                                     descrString.LastIndexOf( DrlDumper.eol ) );
            }.
-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
        
                                
                         
                        
                                
                                12 years, 11 months
                        
                        
                 
         
 
        
            
        
        
        
                
                        
                                
                                 
                                        
                                
                         
                        
                                
                                
                                        
                                                
                                        
                                        
                                        [JBoss JIRA] Created: (JBRULES-2040) Drools, Jboss AS, Dynamic Bean Generation
                                
                                
                                
                                    
                                        by Shawn Ritchie (JIRA)
                                    
                                
                                
                                        Drools, Jboss AS, Dynamic Bean Generation 
------------------------------------------
                 Key: JBRULES-2040
                 URL: https://jira.jboss.org/jira/browse/JBRULES-2040
             Project: JBoss Drools
          Issue Type: Task
      Security Level: Public (Everyone can see)
          Components: All
    Affects Versions: 4.0.7
         Environment: Jboss Application Server v4.2
Drools 4.0.7
Javassist
JDK1.6
            Reporter: Shawn Ritchie
            Assignee: Mark Proctor
The issues is this guys i am creating a bean dynamically in this simple example i have an arraylist of strings which will create a private field, and a getXXX and a setXXX method for each of these fields
The problem arises when i try to load the .drl file in the package builder which gives me the follow error (SEE BELOW)
I suspect it has something to do with the class loader or the package structure in the rules?
Any suggestion reading material or help would be greatly usefull
the code i have loaded is a simple application which replicates the error
22:20:59,435 ERROR [STDERR] Unable to create Field Extractor for 'name' of '[ClassObjectType class=com.beancreation.personXYZ]' in rule 'Credit Allowed' : [Rule name=Credit Allowed, agendaGroup=MAIN, salience=0, no-loop=false]
22:20:59,435 ERROR [STDERR] Rule Compilation error : [Rule name=Credit Allowed, agendaGroup=MAIN, salience=0, no-loop=false]
com/beancreation/Rule_Credit_Allowed_0.java (1:0) : The type java.lang.Object cannot be resolved. It is indirectly referenced from required .class files
com/beancreation/Rule_Credit_Allowed_0.java (1:8) : The package com.beancreation collides with a type
com/beancreation/Rule_Credit_Allowed_0.java (2:34) : The import com.beancreation cannot be resolved
22:20:59,435 INFO [STDOUT] Could not parse knowledge.
22:20:59,435 ERROR [STDERR] java.lang.IllegalArgumentException: Could not parse knowledge.
22:20:59,435 ERROR [STDERR] at com.expertsystem.DroolsExecution.loadRules(DroolsExecution.java:49)
22:20:59,435 ERROR [STDERR] at com.create.TestCase.run(TestCase.java:52)
22:20:59,445 ERROR [STDERR] at org.apache.jsp.index_jsp._jspService(index_jsp.java:74)
22:20:59,445 ERROR [STDERR] at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
22:20:59,445 ERROR [STDERR] at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
22:20:59,445 ERROR [STDERR] at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:373)
22:20:59,445 ERROR [STDERR] at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:336)
22:20:59,445 ERROR [STDERR] at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
22:20:59,445 ERROR [STDERR] at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
22:20:59,445 ERROR [STDERR] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
22:20:59,445 ERROR [STDERR] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
22:20:59,445 ERROR [STDERR] at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
22:20:59,445 ERROR [STDERR] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
22:20:59,445 ERROR [STDERR] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
22:20:59,445 ERROR [STDERR] at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
22:20:59,445 ERROR [STDERR] at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
22:20:59,445 ERROR [STDERR] at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:179)
22:20:59,445 ERROR [STDERR] at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
22:20:59,445 ERROR [STDERR] at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
22:20:59,445 ERROR [STDERR] at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
22:20:59,445 ERROR [STDERR] at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
22:20:59,445 ERROR [STDERR] at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
22:20:59,445 ERROR [STDERR] at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:262)
22:20:59,445 ERROR [STDERR] at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
22:20:59,445 ERROR [STDERR] at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
22:20:59,445 ERROR [STDERR] at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:446)
22:20:59,445 ERROR [STDERR] at java.lang.Thread.run(Thread.java:619)
22:20:59,445 ERROR [STDERR] java.lang.IllegalArgumentException: Could not parse knowledge.
22:20:59,445 ERROR [STDERR] at com.expertsystem.DroolsExecution.loadRules(DroolsExecution.java:49)
22:20:59,445 ERROR [STDERR] at com.create.TestCase.run(TestCase.java:52)
22:20:59,445 ERROR [STDERR] at org.apache.jsp.index_jsp._jspService(index_jsp.java:74)
22:20:59,445 ERROR [STDERR] at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
22:20:59,445 ERROR [STDERR] at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
22:20:59,445 ERROR [STDERR] at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:373)
22:20:59,445 ERROR [STDERR] at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:336)
22:20:59,445 ERROR [STDERR] at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
22:20:59,445 ERROR [STDERR] at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
22:20:59,445 ERROR [STDERR] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
22:20:59,445 ERROR [STDERR] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
22:20:59,445 ERROR [STDERR] at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
22:20:59,445 ERROR [STDERR] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
22:20:59,445 ERROR [STDERR] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
22:20:59,445 ERROR [STDERR] at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
22:20:59,445 ERROR [STDERR] at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
22:20:59,445 ERROR [STDERR] at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:179)
22:20:59,445 ERROR [STDERR] at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
22:20:59,445 ERROR [STDERR] at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
22:20:59,445 ERROR [STDERR] at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
22:20:59,445 ERROR [STDERR] at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
22:20:59,445 ERROR [STDERR] at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
22:20:59,445 ERROR [STDERR] at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:262)
22:20:59,445 ERROR [STDERR] at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
22:20:59,445 ERROR [STDERR] at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
22:20:59,445 ERROR [STDERR] at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:446)
22:20:59,445 ERROR [STDERR] at java.lang.Thread.run(Thread.java:619)
-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
        
                                
                         
                        
                                
                                12 years, 11 months
                        
                        
                 
         
 
        
            
        
        
        
                
                        
                                
                                 
                                        
                                
                         
                        
                                
                                
                                        
                                                
                                        
                                        
                                        [JBoss JIRA] Created: (JBRULES-1829) Nested From Tag Not Supported in Drools
                                
                                
                                
                                    
                                        by Nagarajan Shanmugam (JIRA)
                                    
                                
                                
                                        Nested From Tag Not Supported in Drools
---------------------------------------
                 Key: JBRULES-1829
                 URL: https://jira.jboss.org/jira/browse/JBRULES-1829
             Project: JBoss Drools
          Issue Type: Bug
      Security Level: Public (Everyone can see)
          Components: drools-compiler
    Affects Versions:  5.0.0.M2
         Environment: Windows XP, Eclipse 3.3.
            Reporter: Nagarajan Shanmugam
            Assignee: Mark Proctor
HI i have Created one rule file that have two From tag. Using XmlDumper I create Xml rule file. When i try to parse that Xml rule file its throwing Error. And also the parsed Xml files also Wrong.
Exception in thread "main" org.drools.compiler.DroolsParserException: org.xml.sax.SAXParseException: <from>  may not be nested
	at com.drools.service.ConvertDrlToXml.main(ConvertDrlToXml.java:47)
-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
        
                                
                         
                        
                                
                                12 years, 11 months
                        
                        
                 
         
 
        
            
        
        
        
                
                        
                                
                                 
                                        
                                
                         
                        
                                
                                
                                        
                                                
                                        
                                        
                                        [JBoss JIRA] Created: (JBRULES-1009) Can't execute rules twice with a second classloader
                                
                                
                                
                                    
                                        by aaron dixon (JIRA)
                                    
                                
                                
                                        Can't execute rules twice with a second classloader
---------------------------------------------------
                 Key: JBRULES-1009
                 URL: http://jira.jboss.com/jira/browse/JBRULES-1009
             Project: JBoss Rules
          Issue Type: Bug
      Security Level: Public (Everyone can see)
          Components: Reteoo
    Affects Versions:  4.0.0.MR3
            Reporter: aaron dixon
         Assigned To: Mark Proctor
            Priority: Minor
         Attachments: drools-test.zip
I am trying to sequentially perform two rules executions using two
different classloaders in the same VM. I create completely new state
for each execution, yet I still fail on the second execution (the first execution succeeds). I
believe this has to do with some internal static cached state that
JBossRules is maintaining. An integration test is attached as an archived Eclipse project (zip).
Exception thrown: 
Exception in thread "main" java.lang.ClassCastException: test.drools.classloader.FooShadowProxy
	at org.drools.base.test.drools.classloader.Foo$getName.getValue(Unknown Source)
	at org.drools.base.ClassFieldExtractor.getValue(ClassFieldExtractor.java:94)
	at org.drools.base.evaluators.StringFactory$StringEqualEvaluator.evaluate(StringFactory.java:85)
	at org.drools.rule.LiteralRestriction.isAllowed(LiteralRestriction.java:61)
	at org.drools.rule.LiteralConstraint.isAllowed(LiteralConstraint.java:82)
	at org.drools.reteoo.AlphaNode.assertObject(AlphaNode.java:121)
	at org.drools.reteoo.SingleObjectSinkAdapter.propagateAssertObject(SingleObjectSinkAdapter.java:20)
	at org.drools.reteoo.ObjectTypeNode.assertObject(ObjectTypeNode.java:159)
	at org.drools.reteoo.Rete.assertObject(Rete.java:175)
	at org.drools.reteoo.ReteooRuleBase.assertObject(ReteooRuleBase.java:190)
	at org.drools.reteoo.ReteooWorkingMemory.doInsert(ReteooWorkingMemory.java:70)
	at org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:772)
	at org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:584)
	at org.drools.reteoo.ReteooStatelessSession.execute(ReteooStatelessSession.java:63)
	at test.drools.classloader.Driver.testRules(Driver.java:49)
	at test.drools.classloader.Driver.go(Driver.java:35)
	at test.drools.classloader.Driver.main(Driver.java:19)
-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
        
                                
                         
                        
                                
                                12 years, 11 months
                        
                        
                 
         
 
        
            
        
        
        
            
        
        
        
                
                        
                                
                                 
                                        
                                
                         
                        
                                
                                
                                        
                                                
                                        
                                        
                                        [JBoss JIRA] Created: (JBRULES-2031) Enhancements to spreadsheet based testing tool
                                
                                
                                
                                    
                                        by Michael Neale (JIRA)
                                    
                                
                                
                                        Enhancements to spreadsheet based testing tool
----------------------------------------------
                 Key: JBRULES-2031
                 URL: https://jira.jboss.org/jira/browse/JBRULES-2031
             Project: JBoss Drools
          Issue Type: Feature Request
      Security Level: Public (Everyone can see)
          Components: drools-testing
            Reporter: Michael Neale
            Assignee: Michael Neale
             Fix For: FUTURE
As mentioned by Ansgar in blog comments: http://blog.athico.com/2009/03/new-testing-tool.html
Hi,
we're using Drools to perform mortgage scoring. For testing, we developed a somewhat similar, but already more sophisticated testing framework. Currently, our test set comprises of roughly 800 test scenarios/test cases.
Similarities:
* also uses spreadsheet tables to define test cases.
* each column resembles a test case
* leftmost column used to name elements of input facts or define expected conditions (see below)
Differences:
* concept of "expected values" not expressed as mere values, but as drools conditions which are expected to hold after rules all under test finished execution. These conditions are automagically converted into a drools query which is run against the working memory after rule execution.
Enhancements:
* conditions support simple text replacement, like a macro preprocessor. Wildcards in drools condition can be replaced by test case-specific text
* allows skipping of certain condition checks on a per-test-case basis
* event logging of the drools working memory embedded into fit output file for failed checks. visibility of log can be toggled using html-embedded javascript. allows for simple copy/paste into "audit view" window in eclipse. This eases debugging rules a lot!
* possibility to define a subset of rules contained in a *.drl file to be tested
Open issues:
* Syntax of initial facts specification is probably a bit cumbersome. We're using a self-brewed language to do this. Already thought of replacing this by MVEL, but not done yet. For us, the current solution works ok.
* Up to now, requires explicit import of all used Java classes. This is rather a limitation of drools - we did not manage to get package imports in *.drl files to work. Could probably be solved.
-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
        
                                
                         
                        
                                
                                12 years, 11 months