<div dir="ltr">What replace the KnowledgeAgent ?</div><div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, Apr 18, 2013 at 6:09 PM, Mark Proctor <span dir="ltr">&lt;<a href="mailto:mproctor@codehaus.org" target="_blank">mproctor@codehaus.org</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word">The KnowledgeAgent no long exists, and was removed.  All the spring stuff has to be redone anyway.<div>
<br></div><div>Mark<br><div><div><div class="h5"><div>On 18 Apr 2013, at 09:04, Charles Moulliard &lt;<a href="mailto:ch007m@gmail.com" target="_blank">ch007m@gmail.com</a>&gt; wrote:</div><br></div></div><blockquote type="cite">
<div><div class="h5"><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" target="_blank">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/" target="_blank">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></div></div>
_______________________________________________<br>rules-dev mailing list<br><a href="mailto:rules-dev@lists.jboss.org" target="_blank">rules-dev@lists.jboss.org</a><br><a href="https://lists.jboss.org/mailman/listinfo/rules-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-dev</a></blockquote>
</div><br></div></div><br>_______________________________________________<br>
rules-dev mailing list<br>
<a href="mailto:rules-dev@lists.jboss.org">rules-dev@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/rules-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-dev</a><br></blockquote></div><br><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>