[jboss-jira] [JBoss JIRA] (JBRULES-3258) compiled processes in PKG removed by knowledge agent after first change scan

Jiang Zhu (Created) (JIRA) jira-events at lists.jboss.org
Wed Oct 19 23:55:45 EDT 2011


compiled processes in PKG removed by knowledge agent after first change scan
----------------------------------------------------------------------------

                 Key: JBRULES-3258
                 URL: https://issues.jboss.org/browse/JBRULES-3258
             Project: Drools
          Issue Type: Bug
      Security Level: Public (Everyone can see)
          Components: drools-core
    Affects Versions: 5.3.0.CR1
         Environment: Java6, Drools 5.3.0.CR1, Drools Guvnor 5.3.0.CR1, jBPM 5.1.0.Final
            Reporter: Jiang Zhu
            Assignee: Mark Proctor


I'm having trouble with scanning changed knowledge from Guvnor. I found out that compiled processes from Guvnor are missing after resource change scanner scan for changes first time (event there is no changes). 

It looks similar to JBRULES-2293, but I'm loading knowledge from Guvnor

I wrote a simple test to reproduce this. (tried with Drools 5.2.0.Final and Drools 5.3.0.CR1) 

public class KnowledgeAgentTest { 

        @Test 
        public void should_load_processes() throws Exception { 
                ResourceChangeScannerConfiguration sconf = ResourceFactory.getResourceChangeScannerService().newResourceChangeScannerConfiguration(); 
                // Scan change every 2 seconds 
                KnowledgeAgent kagent = KnowledgeAgentFactory.newKnowledgeAgent("agent"); 
                // Changeset points to a PKG contains 12 processes on Guvnor 
                kagent.applyChangeSet(ResourceFactory.newClassPathResource("test/drools-changeset.xml")); 
                // Everything is still ok now 
                System.out.println("Processes before scan: " + kagent.getKnowledgeBase().getProcesses().size()); 
                Assert.assertFalse(kagent.getKnowledgeBase().getProcesses().isEmpty()); 
                // Scan change every 2 seconds 
                sconf.setProperty("drools.resource.scanner.interval", "2"); 
                ResourceFactory.getResourceChangeScannerService().configure(sconf); 
                ResourceFactory.getResourceChangeScannerService().start(); 
                ResourceFactory.getResourceChangeNotifierService().start(); 
                // Wait long enough 
                Thread.sleep(5000); 
                // Processes are gone somehow 
                System.out.println("Processes after scan: " + kagent.getKnowledgeBase().getProcesses().size()); 
                Assert.assertFalse(kagent.getKnowledgeBase().getProcesses().isEmpty()); 
        } 

} 

Here is what I'm getting when run the test. 
------------------------------------------------------- 
 T E S T S 
------------------------------------------------------- 
Running test.KnowledgeAgentTest 
Processes before scan: 12 
Processes after scan: 0 
Tests run: 1, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 5.802 sec <<< FAILURE! 

Results : 

Failed tests:   should_load_processes(test.KnowledgeAgentTest) 

Tests run: 1, Failures: 1, Errors: 0, Skipped: 0 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.jboss.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the jboss-jira mailing list