Examples of KnowledgeAgentConfiguration


Examples of org.drools.agent.KnowledgeAgentConfiguration

                                         "changeset.xml" );
        output = new BufferedWriter( new FileWriter( fxml ) );
        output.write( xml );
        output.close();
       
        KnowledgeAgentConfiguration aconf = KnowledgeAgentFactory.newKnowledgeAgentConfiguration();
        aconf.setProperty( "drools.agent.scanDirectories",
                           "true" );
        aconf.setProperty( "drools.agent.newInstance",
                           "true" );

        KnowledgeAgent kagent = KnowledgeAgentFactory.newKnowledgeAgent( "test agent",
                                                                         aconf );
        kagent.applyChangeSet( ResourceFactory.newUrlResource( fxml.toURI().toURL() ) );
View Full Code Here

Examples of org.drools.agent.KnowledgeAgentConfiguration

    public Class<KnowledgeAgent> getObjectType() {
        return 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 );
View Full Code Here

Examples of org.drools.agent.KnowledgeAgentConfiguration

       
    }

    public KnowledgeAgent execute( Context context ) {
        KnowledgeBase kbase = ( (KnowledgeCommandContext) context ).getKnowledgeBase();
        KnowledgeAgentConfiguration kaConfig = KnowledgeAgentFactory.newKnowledgeAgentConfiguration();
        kaConfig.setProperty( NewInstanceOption.PROPERTY_NAME, "false" );
        kaConfig.setProperty( UseKnowledgeBaseClassloaderOption.PROPERTY_NAME, "true" );
        KnowledgeAgent kagent = KnowledgeAgentFactory.newKnowledgeAgent( this.kAgentId, kbase, kaConfig );
        SystemEventListener systemEventListener = new SystemEventListener() {

            public void info(String string) {
                System.out.println("INFO: "+string);
View Full Code Here

Examples of org.drools.agent.KnowledgeAgentConfiguration

        return;
    }

    KnowledgeBase kbase = KnowledgeBaseFactory.newKnowledgeBase();

    KnowledgeAgentConfiguration aconf = KnowledgeAgentFactory.newKnowledgeAgentConfiguration();
    aconf.setProperty("drools.agent.newInstance", "false");
    KnowledgeAgent kagent = KnowledgeAgentFactory.newKnowledgeAgent("RuleAgent", kbase, aconf);    
    kagent.applyChangeSet(ResourceFactory.newClassPathResource(RULES_CHANGESET, getClass()));
    kbase.addKnowledgePackages(kbuilder.getKnowledgePackages());
    ksession = kbase.newStatefulKnowledgeSession();
       
View Full Code Here

Examples of org.drools.agent.KnowledgeAgentConfiguration

     */
    public static KnowledgeAgent createKnowledgeAgent(int scannerInterval) {
        KnowledgeBaseConfiguration kBaseConfiguration = KnowledgeBaseFactory.newKnowledgeBaseConfiguration();
        kBaseConfiguration.setOption(EventProcessingOption.STREAM);

        KnowledgeAgentConfiguration kaConf = KnowledgeAgentFactory.newKnowledgeAgentConfiguration();

        /* Do not scan directories, just scan files */
        kaConf.setProperty("drools.agent.scanDirectories", "false");
        kaConf.setProperty("drools.agent.scanResources", "true");

        /* Incremental KnowledgeBase build */
        kaConf.setProperty("drools.agent.newInstance", "false");
        kaConf.setProperty("drools.agent.useKBaseClassLoaderForCompiling", "true");
        KnowledgeBase kBase = KnowledgeBaseFactory.newKnowledgeBase(kBaseConfiguration);
        KnowledgeAgent kAgent = KnowledgeAgentFactory.newKnowledgeAgent("Gnostic", kBase, kaConf);

        ResourceFactory.getResourceChangeNotifierService().start();
        ResourceChangeScannerConfiguration sConf =
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.