[rules-dev] Why kagent is commented in drools-spring ?

Mark Proctor mproctor at codehaus.org
Thu Apr 18 13:38:51 EDT 2013


kie-ci. But it works in a different way to the kagent.

Mark
On 18 Apr 2013, at 17:38, Charles Moulliard <ch007m at gmail.com> wrote:

> What replace the KnowledgeAgent ?
> 
> 
> On Thu, Apr 18, 2013 at 6:09 PM, Mark Proctor <mproctor at codehaus.org> wrote:
> The KnowledgeAgent no long exists, and was removed.  All the spring stuff has to be redone anyway.
> 
> Mark
> On 18 Apr 2013, at 09:04, Charles Moulliard <ch007m at gmail.com> wrote:
> 
>> Hi,
>> 
>> kagent has been commented in drools-spring and cannot be used anymore. 
>> 
>> /*
>>  * Copyright 2010 JBoss Inc
>>  *
>>  * Licensed under the Apache License, Version 2.0 (the "License");
>>  * you may not use this file except in compliance with the License.
>>  * You may obtain a copy of the License at
>>  *
>>  *      http://www.apache.org/licenses/LICENSE-2.0
>>  *
>>  * Unless required by applicable law or agreed to in writing, software
>>  * distributed under the License is distributed on an "AS IS" BASIS,
>>  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
>>  * See the License for the specific language governing permissions and
>>  * limitations under the License.
>>  */
>> 
>> package org.drools.container.spring.beans;
>> 
>> import java.util.Collections;
>> import java.util.List;
>> 
>> import org.kie.api.KieBase;
>> import org.springframework.beans.factory.FactoryBean;
>> import org.springframework.beans.factory.InitializingBean;
>> 
>> public class KnowledgeAgentBeanFactory
>>     implements
>>     FactoryBean,
>>     InitializingBean {
>> 
>>     private KieBase               kbase;
>> 
>> //    private KnowledgeAgent              kagent;
>> 
>>     private String                      id;
>> 
>>     private String                      newInstance;
>>     
>>     private String                      useKbaseClassloader = "false";
>> 
>>     private List<DroolsResourceAdapter> resources = Collections.emptyList();
>> 
>>     public Object getObject() throws Exception {
>>         return null; //this.kagent;
>>     }
>> 
>>     public Class getObjectType() {
>>         return null; //KnowledgeAgent.class;
>>     }
>> 
>>     public void afterPropertiesSet() throws Exception {
>> //        KnowledgeAgentConfiguration kagentConf = KnowledgeAgentFactory.newKnowledgeAgentConfiguration();
>> //        if ( kbase == null ) {
>> //            throw new RuntimeException( "kagent must reference an existing kbase" );
>> //        }
>> //
>> //        kagentConf.setProperty( "drools.agent.newInstance",
>> //                                newInstance );
>> //        
>> //        kagentConf.setProperty( "drools.agent.useKBaseClassLoaderForCompiling",
>> //                                useKbaseClassloader );
>> //
>> //        this.kagent = KnowledgeAgentFactory.newKnowledgeAgent( this.id,
>> //                                                               this.kbase,
>> //                                                               kagentConf );
>> //
>> //        if ( resources != null && !resources.isEmpty() ) {
>> //            Collection<Resource> rs = new ArrayList<Resource>();
>> //            for ( DroolsResourceAdapter res : resources ) {
>> //                InternalResource resource = (InternalResource) res.getDroolsResource();
>> //
>> //                resource.setResourceType( res.getResourceType() );
>> //
>> //                if ( res.getResourceConfiguration() != null ) {
>> //                    resource.setConfiguration( res.getResourceConfiguration() );
>> //                }
>> //
>> //                rs.add( resource );
>> //            }
>> //            ChangeSetImpl changeSet = new ChangeSetImpl();
>> //            changeSet.setResourcesAdded( rs );
>> //
>> //            kagent.applyChangeSet( changeSet );
>> //        }
>>     }
>> 
>> //    public KnowledgeBase getKbase() {
>> //        return kbase;
>> //    }
>> //
>> //    public void setKbase(KnowledgeBase kbase) {
>> //        this.kbase = kbase;
>> //    }
>> //
>> //    public KnowledgeAgent getKagent() {
>> //        return kagent;
>> //    }
>> //
>> //    public void setKagent(KnowledgeAgent kagent) {
>> //        this.kagent = kagent;
>> //    }
>> 
>> What is the reason of that decision ? Is there an alternative ?
>> 
>> Regards,
>> 
>> -- 
>> Charles Moulliard
>> Apache Committer / Sr. Enterprise Architect (RedHat)
>> Twitter : @cmoulliard | Blog : http://cmoulliard.blogspot.com
>> 
>> _______________________________________________
>> rules-dev mailing list
>> rules-dev at lists.jboss.org
>> https://lists.jboss.org/mailman/listinfo/rules-dev
> 
> 
> _______________________________________________
> rules-dev mailing list
> rules-dev at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-dev
> 
> 
> 
> -- 
> Charles Moulliard
> Apache Committer / Sr. Enterprise Architect (RedHat)
> Twitter : @cmoulliard | Blog : http://cmoulliard.blogspot.com
> 
> _______________________________________________
> rules-dev mailing list
> rules-dev at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-dev

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-dev/attachments/20130418/ae1b1a8e/attachment-0001.html 


More information about the rules-dev mailing list