<div dir="ltr">Hi,<div><br></div><div>kagent has been commented in drools-spring and cannot be used anymore. </div><div><br></div><div><div>/*</div><div> * Copyright 2010 JBoss Inc</div><div> *</div><div> * Licensed under the Apache License, Version 2.0 (the &quot;License&quot;);</div>
<div> * you may not use this file except in compliance with the License.</div><div> * You may obtain a copy of the License at</div><div> *</div><div> *      <a href="http://www.apache.org/licenses/LICENSE-2.0">http://www.apache.org/licenses/LICENSE-2.0</a></div>
<div> *</div><div> * Unless required by applicable law or agreed to in writing, software</div><div> * distributed under the License is distributed on an &quot;AS IS&quot; BASIS,</div><div> * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.</div>
<div> * See the License for the specific language governing permissions and</div><div> * limitations under the License.</div><div> */</div><div><br></div><div>package org.drools.container.spring.beans;</div><div><br></div>
<div>import java.util.Collections;</div><div>import java.util.List;</div><div><br></div><div>import org.kie.api.KieBase;</div><div>import org.springframework.beans.factory.FactoryBean;</div><div>import org.springframework.beans.factory.InitializingBean;</div>
<div><br></div><div>public class KnowledgeAgentBeanFactory</div><div>    implements</div><div>    FactoryBean,</div><div>    InitializingBean {</div><div><br></div><div>    private KieBase               kbase;</div><div><br>
</div><div>//    private KnowledgeAgent              kagent;</div><div><br></div><div>    private String                      id;</div><div><br></div><div>    private String                      newInstance;</div><div>    </div>
<div>    private String                      useKbaseClassloader = &quot;false&quot;;</div><div><br></div><div>    private List&lt;DroolsResourceAdapter&gt; resources = Collections.emptyList();</div><div><br></div><div>    public Object getObject() throws Exception {</div>
<div>        return null; //this.kagent;</div><div>    }</div><div><br></div><div>    public Class getObjectType() {</div><div>        return null; //KnowledgeAgent.class;</div><div>    }</div><div><br></div><div>    public void afterPropertiesSet() throws Exception {</div>
<div>//        KnowledgeAgentConfiguration kagentConf = KnowledgeAgentFactory.newKnowledgeAgentConfiguration();</div><div>//        if ( kbase == null ) {</div><div>//            throw new RuntimeException( &quot;kagent must reference an existing kbase&quot; );</div>
<div>//        }</div><div>//</div><div>//        kagentConf.setProperty( &quot;drools.agent.newInstance&quot;,</div><div>//                                newInstance );</div><div>//        </div><div>//        kagentConf.setProperty( &quot;drools.agent.useKBaseClassLoaderForCompiling&quot;,</div>
<div>//                                useKbaseClassloader );</div><div>//</div><div>//        this.kagent = KnowledgeAgentFactory.newKnowledgeAgent( <a href="http://this.id">this.id</a>,</div><div>//                                                               this.kbase,</div>
<div>//                                                               kagentConf );</div><div>//</div><div>//        if ( resources != null &amp;&amp; !resources.isEmpty() ) {</div><div>//            Collection&lt;Resource&gt; rs = new ArrayList&lt;Resource&gt;();</div>
<div>//            for ( DroolsResourceAdapter res : resources ) {</div><div>//                InternalResource resource = (InternalResource) res.getDroolsResource();</div><div>//</div><div>//                resource.setResourceType( res.getResourceType() );</div>
<div>//</div><div>//                if ( res.getResourceConfiguration() != null ) {</div><div>//                    resource.setConfiguration( res.getResourceConfiguration() );</div><div>//                }</div><div>//</div>
<div>//                rs.add( resource );</div><div>//            }</div><div>//            ChangeSetImpl changeSet = new ChangeSetImpl();</div><div>//            changeSet.setResourcesAdded( rs );</div><div>//</div><div>
//            kagent.applyChangeSet( changeSet );</div><div>//        }</div><div>    }</div><div><br></div><div>//    public KnowledgeBase getKbase() {</div><div>//        return kbase;</div><div>//    }</div><div>//</div>
<div>//    public void setKbase(KnowledgeBase kbase) {</div><div>//        this.kbase = kbase;</div><div>//    }</div><div>//</div><div>//    public KnowledgeAgent getKagent() {</div><div>//        return kagent;</div><div>
//    }</div><div>//</div><div>//    public void setKagent(KnowledgeAgent kagent) {</div><div>//        this.kagent = kagent;</div><div>//    }</div></div><div><br></div><div>What is the reason of that decision ? Is there an alternative ?</div>
<div><br></div><div>Regards,<br clear="all"><div><br></div>-- <br><div>Charles Moulliard</div><div>Apache Committer / Sr. Enterprise Architect (RedHat)</div><div>Twitter : @cmoulliard | Blog : <a href="http://cmoulliard.blogspot.com" target="_blank">http://cmoulliard.blogspot.com</a></div>
<div><br></div>
</div></div>