Examples of monitorResourceChangeEvents()


Examples of org.drools.agent.KnowledgeAgent.monitorResourceChangeEvents()

  public DiagramInfo getDiagramInfo(String processId) {
    if (kbase == null) {
      try {
        KnowledgeAgent kagent = KnowledgeAgentFactory.newKnowledgeAgent("Guvnor default");
        kagent.applyChangeSet(ResourceFactory.newClassPathResource("ChangeSet.xml"));
        kagent.monitorResourceChangeEvents(false);
        kbase = kagent.getKnowledgeBase();
      } catch (Throwable t) {
        if (t instanceof RuntimeException
            && "KnowledgeAgent exception while trying to deserialize".equals(t.getMessage())) {
          System.out.println("Could not connect to guvnor");
View Full Code Here

Examples of org.drools.agent.KnowledgeAgent.monitorResourceChangeEvents()

  }

  public DiagramInfo getDiagramInfo(String processId) {
    KnowledgeAgent kagent = KnowledgeAgentFactory.newKnowledgeAgent("Guvnor default");
    kagent.applyChangeSet(ResourceFactory.newClassPathResource("ChangeSet.xml"));
    kagent.monitorResourceChangeEvents(false);
    KnowledgeBase kbase = kagent.getKnowledgeBase();
    Process process = kbase.getProcess(processId);
    if (process == null) {
      return null;
    }
View Full Code Here

Examples of org.drools.agent.KnowledgeAgent.monitorResourceChangeEvents()

        //Compilation errors should occurred
        assertTrue(this.compilationErrors);
        this.compilationErrors=false;

        ksession.dispose();
        kagent.monitorResourceChangeEvents(false);
    }

    public void testDSLAndNewInstance() throws Exception {

        System.out.println("\n\ntestDSLAndNewInstance\n\n");
View Full Code Here

Examples of org.drools.agent.KnowledgeAgent.monitorResourceChangeEvents()

        //Compilation errors should occurred
        assertTrue(this.compilationErrors);
        this.compilationErrors=false;


        kagent.monitorResourceChangeEvents(false);
    }

    private KnowledgeAgent createKAgent(KnowledgeBase kbase, boolean newInstance) {
        ResourceChangeScannerConfiguration sconf = ResourceFactory.getResourceChangeScannerService().newResourceChangeScannerConfiguration();
        sconf.setProperty("drools.resource.scanner.interval", "2");
View Full Code Here

Examples of org.drools.agent.KnowledgeAgent.monitorResourceChangeEvents()

        assertEquals( 2,
                      list.size() );

        assertTrue( list.contains( "rule3" ) );
        assertTrue( list.contains( "rule2" ) );
        kagent.monitorResourceChangeEvents( false );       
    }
   
    public void  testModifyFileUrlWithStateless() throws Exception {
        String rule1 = "";
        rule1 += "package org.drools.test\n";
View Full Code Here

Examples of org.drools.agent.KnowledgeAgent.monitorResourceChangeEvents()

        assertEquals( 2,
                      list.size() );
       
        assertTrue( list.contains( "rule3" ) );
        assertTrue( list.contains( "rule2" ) );
        kagent.monitorResourceChangeEvents( false );       
    }   

    public void  testModifyPackageUrl() throws Exception {
        String rule1 = "";
        rule1 += "package org.drools.test\n";
View Full Code Here

Examples of org.drools.agent.KnowledgeAgent.monitorResourceChangeEvents()

        assertEquals( 2,
                      list.size() );
   
        assertTrue( list.contains( "rule3" ) );
        assertTrue( list.contains( "rule2" ) );
        kagent.monitorResourceChangeEvents( false );
    }


    public void testDeletePackageUrl() throws Exception {
        String rule1 = "";
View Full Code Here

Examples of org.drools.agent.KnowledgeAgent.monitorResourceChangeEvents()

        assertEquals( 1,
                      list.size() );

        assertTrue( list.contains( "rule1" ) );
        kagent.monitorResourceChangeEvents( false );
    }

    public void  testOldSchoolPackageUrl() throws Exception {
        String rule1 = "";
        rule1 += "package org.drools.test\n";
View Full Code Here

Examples of org.drools.agent.KnowledgeAgent.monitorResourceChangeEvents()

        assertEquals( 2,
                      list.size() );

        assertTrue( list.contains( "rule3" ) );
        assertTrue( list.contains( "rule2" ) );
        kagent.monitorResourceChangeEvents( false );
    }
   
    public void  testModifyDirectory() throws IOException,
                                     InterruptedException {
        // adds 2 files to a dir and executes then adds one and removes one and detects changes
View Full Code Here

Examples of org.drools.agent.KnowledgeAgent.monitorResourceChangeEvents()

        assertEquals( 2,
                      list.size() );
        assertTrue( list.contains( "rule2" ) );
        assertTrue( list.contains( "rule3" ) );

        kagent.monitorResourceChangeEvents( false );
    }

    public void testStatelessWithPipeline() throws Exception {
      String rule1 = "";
        rule1 += "package org.drools.test\n";
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.