use of org.drools.core.command.impl.CommandBasedStatefulKnowledgeSession in project drools by kiegroup.
the class RuleFlowGroupRollbackTest method testRuleFlowGroupRollback.
@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) {
logger.info("The above " + RuntimeException.class.getSimpleName() + " was expected in this test.");
}
ksession.insert(list);
ksession.execute(new ActivateRuleFlowCommand("ruleflow-group"));
assertEquals(1, ksession.fireAllRules());
}
Aggregations