public KnowledgeSessionConfiguration newKnowledgeSessionConfiguration() { return new SessionConfiguration(); }
public KnowledgeSessionConfiguration newKnowledgeSessionConfiguration(Properties properties) { return new SessionConfiguration(properties); }
/** * Resets this rule session. Calling this method will bring the rule session * state to its initial state for this rule session and will reset any other * state associated with this rule session. * <p/> * A reset will not reset the state on the default object filter for a * <code>RuleExecutionSet</code>. */ public void reset() { // stateful rule sessions should not be high load, thus safe to keep references initSession( new SessionConfiguration() ); }
public static CommandExecutor createKnowledgeSession(KnowledgeBase kbase,GridNode node,String type,String name){ CommandExecutor ksession; if (type.equals("stateful")) { //Adding a configuration forces drools to use the current classloader (see issue SM-2316) ksession = kbase.newStatefulKnowledgeSession(new SessionConfiguration(), null); }else { //Adding a configuration forces drools to use the current classloader (see issue SM-2316) ksession = kbase.newStatelessKnowledgeSession(new SessionConfiguration()); } node.set(name,ksession); return ksession; }
public StatefulSession newStatefulSession(boolean keepReference) { SessionConfiguration config = new SessionConfiguration(); config.setKeepReference( keepReference ); return newStatefulSession( config, EnvironmentFactory.newEnvironment() ); }
new SessionConfiguration(), EnvironmentFactory.newEnvironment() ); bais.close();
SessionConfiguration conf = new SessionConfiguration(); conf.setKeepReference( true ); initSession( conf );
/** * Return a wm ready to go based on the rules in a drl at the specified uri (in the classpath). */ public StatefulSession getWorkingMemory(String uri) throws DroolsParserException, IOException, Exception { PackageBuilder builder = new PackageBuilder(); builder.addPackageFromDrl(new InputStreamReader(this.getClass() .getResourceAsStream(uri))); assertFalse(builder.getErrors().toString(), builder.hasErrors()); RuleBase rb = RuleBaseFactory.newRuleBase(); rb.addPackage(builder.getPackage()); SessionConfiguration conf = new SessionConfiguration(); conf.setClockType( ClockType.PSEUDO_CLOCK ); StatefulSession wm = rb.newStatefulSession( conf, null ); return wm; } }