Package org.drools.command.impl

Examples of org.drools.command.impl.CommandBasedStatefulKnowledgeSession


  }

    @Test 
  public void testRuleFlowGroupRollback() throws Exception {
   
    CommandBasedStatefulKnowledgeSession ksession = createSession();
   
    List<String> list = new ArrayList<String>();
    list.add("Test");
   
    ksession.insert(list);
    ksession.execute(new ActivateRuleFlowCommand("ruleflow-group"));
    assertEquals(1, ksession.fireAllRules());
   
    try {
      ksession.execute(new ExceptionCommand());
      fail("Process must throw an exception");
    } catch (Exception e) {
      e.printStackTrace();
    }
   
    ksession.insert(list);
    ksession.execute(new ActivateRuleFlowCommand("ruleflow-group"));
    assertEquals(1, ksession.fireAllRules());
   
  }
View Full Code Here


            environment = EnvironmentFactory.newEnvironment();
        }
       
      CommandService commandService = ((SessionConfiguration) conf).getCommandService(this, environment);
      if (commandService != null) {
      return new CommandBasedStatefulKnowledgeSession(commandService);
      } else {
        ReteooStatefulSession session = (ReteooStatefulSession) this.ruleBase.newStatefulSession( (SessionConfiguration) conf,
                                                                                                  environment );
        return new StatefulKnowledgeSessionImpl( session, this );
      }
View Full Code Here

        if ( environment == null ) {
            throw new IllegalArgumentException( "Environment cannot be null" );
        }

        return new CommandBasedStatefulKnowledgeSession( (CommandService) buildCommandService( kbase,
                                                                             mergeConfig( configuration ),
                                                                             environment ) );
    }
View Full Code Here

        if ( environment == null ) {
            throw new IllegalArgumentException( "Environment cannot be null" );
        }

        return new CommandBasedStatefulKnowledgeSession( (CommandService) buildCommandService( id,
                                                                                              kbase,
                                                                                              mergeConfig( configuration ),
                                                                                              environment ) );
    }
View Full Code Here

    ds1.close();
  }
 
  public void testRuleFlowGroupRollback() throws Exception {
   
    CommandBasedStatefulKnowledgeSession ksession = createSession();
   
    List<String> list = new ArrayList<String>();
    list.add("Test");
   
    ksession.insert(list);
    ksession.execute(new ActivateRuleFlowCommand("ruleflow-group"));
    assertEquals(1, ksession.fireAllRules());
   
    try {
      ksession.execute(new ExceptionCommand());
      fail("Process must throw an exception");
    } catch (Exception e) {
      e.printStackTrace();
    }
   
    ksession.insert(list);
    ksession.execute(new ActivateRuleFlowCommand("ruleflow-group"));
    assertEquals(1, ksession.fireAllRules());
   
  }
View Full Code Here

        if ( environment == null ) {
            throw new IllegalArgumentException( "Environment cannot be null" );
        }

        return new CommandBasedStatefulKnowledgeSession( (CommandService) buildCommanService( kbase,
                                                                             mergeConfig( configuration ),
                                                                             environment ) );
    }
View Full Code Here

        if ( environment == null ) {
            throw new IllegalArgumentException( "Environment cannot be null" );
        }

        return new CommandBasedStatefulKnowledgeSession( (CommandService) buildCommanService( id,
                                                                                              kbase,
                                                                                              mergeConfig( configuration ),
                                                                                              environment ) );
    }
View Full Code Here

        if ( environment == null ) {
            throw new IllegalArgumentException( "Environment cannot be null" );
        }

        return new CommandBasedStatefulKnowledgeSession( (CommandService) buildCommandService( kbase,
                                                                             mergeConfig( configuration ),
                                                                             environment ) );
    }
View Full Code Here

        if ( environment == null ) {
            throw new IllegalArgumentException( "Environment cannot be null" );
        }

        return new CommandBasedStatefulKnowledgeSession( (CommandService) buildCommandService( id,
                                                                                              kbase,
                                                                                              mergeConfig( configuration ),
                                                                                              environment ) );
    }
View Full Code Here

        if ( environment == null ) {
            throw new IllegalArgumentException( "Environment cannot be null" );
        }

        return new CommandBasedStatefulKnowledgeSession( (CommandService) buildCommanService( kbase,
                                                                             mergeConfig( configuration ),
                                                                             environment ) );
    }
View Full Code Here

TOP

Related Classes of org.drools.command.impl.CommandBasedStatefulKnowledgeSession

Copyright © 2018 www.massapicom. 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.