<html><head><meta http-equiv="Content-Type" content="text/html charset=iso-8859-1"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">kie-ci. But it works in a different way to the kagent.<div><br></div><div>Mark<br><div><div>On 18 Apr 2013, at 17:38, Charles Moulliard &lt;<a href="mailto:ch007m@gmail.com">ch007m@gmail.com</a>&gt; wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><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. &nbsp;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.&nbsp;</div><div><br></div><div><div>/*</div><div>&nbsp;* Copyright 2010 JBoss Inc</div><div>&nbsp;*</div><div>
&nbsp;* Licensed under the Apache License, Version 2.0 (the "License");</div>
<div>&nbsp;* you may not use this file except in compliance with the License.</div><div>&nbsp;* You may obtain a copy of the License at</div><div>&nbsp;*</div><div>&nbsp;* &nbsp; &nbsp; &nbsp;<a href="http://www.apache.org/licenses/LICENSE-2.0" target="_blank">http://www.apache.org/licenses/LICENSE-2.0</a></div>

<div>&nbsp;*</div><div>&nbsp;* Unless required by applicable law or agreed to in writing, software</div><div>&nbsp;* distributed under the License is distributed on an "AS IS" BASIS,</div><div>&nbsp;* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.</div>

<div>&nbsp;* See the License for the specific language governing permissions and</div><div>&nbsp;* limitations under the License.</div><div>&nbsp;*/</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>&nbsp; &nbsp; implements</div><div>&nbsp; &nbsp; FactoryBean,</div><div>&nbsp; &nbsp; InitializingBean {</div><div><br></div><div>&nbsp; &nbsp; private KieBase &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; kbase;</div><div>
<br>
</div><div>// &nbsp; &nbsp;private KnowledgeAgent &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;kagent;</div><div><br></div><div>&nbsp; &nbsp; private String &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;id;</div><div><br></div><div>&nbsp; &nbsp; private String &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;newInstance;</div><div>&nbsp; &nbsp;&nbsp;</div>

<div>&nbsp; &nbsp; private String &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;useKbaseClassloader = "false";</div><div><br></div><div>&nbsp; &nbsp; private List&lt;DroolsResourceAdapter&gt; resources = Collections.emptyList();</div><div><br></div><div>&nbsp; &nbsp; public Object getObject() throws Exception {</div>

<div>&nbsp; &nbsp; &nbsp; &nbsp; return null; //this.kagent;</div><div>&nbsp; &nbsp; }</div><div><br></div><div>&nbsp; &nbsp; public Class getObjectType() {</div><div>&nbsp; &nbsp; &nbsp; &nbsp; return null; //KnowledgeAgent.class;</div><div>&nbsp; &nbsp; }</div><div><br></div><div>&nbsp; &nbsp; public void afterPropertiesSet() throws Exception {</div>

<div>// &nbsp; &nbsp; &nbsp; &nbsp;KnowledgeAgentConfiguration kagentConf = KnowledgeAgentFactory.newKnowledgeAgentConfiguration();</div><div>// &nbsp; &nbsp; &nbsp; &nbsp;if ( kbase == null ) {</div><div>// &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;throw new RuntimeException( "kagent must reference an existing kbase" );</div>

<div>// &nbsp; &nbsp; &nbsp; &nbsp;}</div><div>//</div><div>// &nbsp; &nbsp; &nbsp; &nbsp;kagentConf.setProperty( "drools.agent.newInstance",</div><div>// &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;newInstance );</div><div>// &nbsp; &nbsp; &nbsp; &nbsp;</div><div>// &nbsp; &nbsp; &nbsp; &nbsp;kagentConf.setProperty( "drools.agent.useKBaseClassLoaderForCompiling",</div>

<div>// &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;useKbaseClassloader );</div><div>//</div><div>// &nbsp; &nbsp; &nbsp; &nbsp;this.kagent = KnowledgeAgentFactory.newKnowledgeAgent( <a href="http://this.id/" target="_blank">this.id</a>,</div><div>// &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; this.kbase,</div>

<div>// &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; kagentConf );</div><div>//</div><div>// &nbsp; &nbsp; &nbsp; &nbsp;if ( resources != null &amp;&amp; !resources.isEmpty() ) {</div><div>// &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Collection&lt;Resource&gt; rs = new ArrayList&lt;Resource&gt;();</div>

<div>// &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;for ( DroolsResourceAdapter res : resources ) {</div><div>// &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;InternalResource resource = (InternalResource) res.getDroolsResource();</div><div>//</div><div>// &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;resource.setResourceType( res.getResourceType() );</div>

<div>//</div><div>// &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;if ( res.getResourceConfiguration() != null ) {</div><div>// &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;resource.setConfiguration( res.getResourceConfiguration() );</div><div>// &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}</div><div>//</div>

<div>// &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;rs.add( resource );</div><div>// &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}</div><div>// &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;ChangeSetImpl changeSet = new ChangeSetImpl();</div><div>// &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;changeSet.setResourcesAdded( rs );</div><div>//</div><div>

// &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;kagent.applyChangeSet( changeSet );</div><div>// &nbsp; &nbsp; &nbsp; &nbsp;}</div><div>&nbsp; &nbsp; }</div><div><br></div><div>// &nbsp; &nbsp;public KnowledgeBase getKbase() {</div><div>// &nbsp; &nbsp; &nbsp; &nbsp;return kbase;</div><div>// &nbsp; &nbsp;}</div><div>//</div>

<div>// &nbsp; &nbsp;public void setKbase(KnowledgeBase kbase) {</div><div>// &nbsp; &nbsp; &nbsp; &nbsp;this.kbase = kbase;</div><div>// &nbsp; &nbsp;}</div><div>//</div><div>// &nbsp; &nbsp;public KnowledgeAgent getKagent() {</div><div>// &nbsp; &nbsp; &nbsp; &nbsp;return kagent;</div><div>

// &nbsp; &nbsp;}</div><div>//</div><div>// &nbsp; &nbsp;public void setKagent(KnowledgeAgent kagent) {</div><div>// &nbsp; &nbsp; &nbsp; &nbsp;this.kagent = kagent;</div><div>// &nbsp; &nbsp;}</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 |&nbsp;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 |&nbsp;Blog : <a href="http://cmoulliard.blogspot.com/" target="_blank">http://cmoulliard.blogspot.com</a></div><div><br></div>
</div>
_______________________________________________<br>rules-dev mailing list<br><a href="mailto:rules-dev@lists.jboss.org">rules-dev@lists.jboss.org</a><br>https://lists.jboss.org/mailman/listinfo/rules-dev</blockquote></div><br></div></body></html>