[jboss-jira] [JBoss JIRA] (JBRULES-3506) KnowledgeAgent is not detecting changes of a function defined in a package

Elisabeth Wirth (JIRA) jira-events at lists.jboss.org
Wed May 16 09:06:17 EDT 2012


Elisabeth Wirth created JBRULES-3506:
----------------------------------------

             Summary: KnowledgeAgent is not detecting changes of a function defined in a package
                 Key: JBRULES-3506
                 URL: https://issues.jboss.org/browse/JBRULES-3506
             Project: Drools
          Issue Type: Bug
      Security Level: Public (Everyone can see)
          Components: drools-core
    Affects Versions: 5.4.0.Final
            Reporter: Elisabeth Wirth
            Assignee: Mark Proctor


I have a pkg containing a function and I am checking, if there are any changes in my pkg by using the KnowledgeAgent.
Now I have the problem, that changes of the function are not recognized.
In the log I see the following entry:
KnowledgeAgent: impossible to add a map for a null resource! skiping.

I have analyzed the code of KnowledgeAgentImpl and found the reason for the problem:
in the method createPackageFromResource(Resource resource, KnowledgeBuilder kbuilder) in KnowledgeAgentImpl
the mapping for functions is missing.
I have added the following code and everything works as expected:

                for( KnowledgePackage kpkg : kpkgs ) {
                    for ( Rule rule : ((KnowledgePackageImp)kpkg).pkg.getRules() ) {
                        rule.setResource( resource );
                    } ....

                    // added
                    for ( Function function : ((KnowledgePackageImp)kpkg).pkg.getFunctions().values() ) {
                    	function.setResource( resource );
                    }

                }


--
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