public StatelessKnowledgeSession newStatelessKnowledgeSession( KnowledgeSessionConfiguration conf) { return new StatelessKnowledgeSessionImpl( null, this, conf ); }
public void execute(Iterable objects) { StatefulKnowledgeSession ksession = newWorkingMemory(); try { for ( Object object : objects ) { ksession.insert( object ); } ksession.fireAllRules( ); } finally { dispose( ksession ); } }
public ClassLoader getClassLoader(CommandExecutor exec) { ClassLoader cl = null; if ( exec instanceof StatefulKnowledgeSessionImpl ) { cl = ((ReteooRuleBase) ((StatefulKnowledgeSessionImpl) exec).getRuleBase()).getRootClassLoader(); } else if ( exec instanceof StatelessKnowledgeSessionImpl ) { cl = ((ReteooRuleBase) ((StatelessKnowledgeSessionImpl) exec).getRuleBase()).getRootClassLoader(); } else if ( exec instanceof CommandBasedStatefulKnowledgeSession ) { cl = ((ReteooRuleBase) ((KnowledgeBaseImpl) ((CommandBasedStatefulKnowledgeSession) exec).getKnowledgeBase()).getRuleBase()).getRootClassLoader(); } return cl; }
registerSystemListeners( wm ); registerCustomListeners(); initialized = true;
public JPAWorkingMemoryDbLogger(KnowledgeRuntimeEventManager session) { super(session); if (session instanceof KnowledgeRuntime) { env = ((KnowledgeRuntime) session).getEnvironment(); } else if (session instanceof StatelessKnowledgeSessionImpl) { env = ((StatelessKnowledgeSessionImpl) session).getEnvironment(); } else { throw new IllegalArgumentException( "Not supported session in logger: " + session.getClass()); } Boolean bool = (Boolean) env.get("IS_JTA_TRANSACTION"); if (bool != null) { isJTA = bool.booleanValue(); } }
public ClassLoader getClassLoader(CommandExecutor exec) { ClassLoader cl = null; if ( exec instanceof StatefulKnowledgeSessionImpl ) { cl = ((ReteooRuleBase) ((StatefulKnowledgeSessionImpl) exec).getRuleBase()).getRootClassLoader(); } else if ( exec instanceof StatelessKnowledgeSessionImpl ) { cl = ((ReteooRuleBase) ((StatelessKnowledgeSessionImpl) exec).getRuleBase()).getRootClassLoader(); } else if ( exec instanceof CommandBasedStatefulKnowledgeSession ) { cl = ((ReteooRuleBase) ((KnowledgeBaseImpl) ((CommandBasedStatefulKnowledgeSession) exec).getKnowledgeBase()).getRuleBase()).getRootClassLoader(); } return cl; }
public WorkingMemoryLogger(final KnowledgeRuntimeEventManager session) { if (session instanceof StatefulKnowledgeSessionImpl) { WorkingMemoryEventManager eventManager = ((StatefulKnowledgeSessionImpl) session).session; eventManager.addEventListener( (WorkingMemoryEventListener) this ); eventManager.addEventListener( (AgendaEventListener) this ); eventManager.addEventListener( (RuleBaseEventListener) this ); InternalProcessRuntime processRuntime = ((StatefulKnowledgeSessionImpl) session).session.getProcessRuntime(); if (processRuntime != null) { processRuntime.addEventListener( (ProcessEventListener) this ); } } else if (session instanceof StatelessKnowledgeSessionImpl) { ((StatelessKnowledgeSessionImpl) session).workingMemoryEventSupport.addEventListener( this ); ((StatelessKnowledgeSessionImpl) session).agendaEventSupport.addEventListener( this ); ((StatelessKnowledgeSessionImpl) session).processEventSupport.addEventListener( this ); ((StatelessKnowledgeSessionImpl) session).getRuleBase().addEventListener( this ); } else if (session instanceof CommandBasedStatefulKnowledgeSession) { ReteooWorkingMemoryInterface eventManager = ((StatefulKnowledgeSessionImpl)((KnowledgeCommandContext)((CommandBasedStatefulKnowledgeSession) session).getCommandService().getContext()).getStatefulKnowledgesession()).session; eventManager.addEventListener( (WorkingMemoryEventListener) this ); eventManager.addEventListener( (AgendaEventListener) this ); InternalProcessRuntime processRuntime = eventManager.getProcessRuntime(); eventManager.addEventListener( (RuleBaseEventListener) this ); if (processRuntime != null) { processRuntime.addEventListener( (ProcessEventListener) this ); } } else { throw new IllegalArgumentException("Not supported session in logger: " + session.getClass()); } }
public void execute(Object object) { StatefulKnowledgeSession ksession = newWorkingMemory(); try { ksession.insert( object ); ksession.fireAllRules( ); } finally { dispose( ksession ); } }
public StatelessKnowledgeSession newStatelessKnowledgeSession() { return new StatelessKnowledgeSessionImpl( null, this, null ); }
sksi.getRuleBase().addEventListener((RuleBaseEventListener)el); } else if (el instanceof KnowledgeBaseEventListener) { new KnowledgeBaseImpl(sksi.getRuleBase()).addEventListener((KnowledgeBaseEventListener)el);
public <T> T execute(Command<T> command) { StatefulKnowledgeSession ksession = newWorkingMemory(); dispose( ksession );
public StatelessKnowledgeSession newStatelessKnowledgeSession() { return new StatelessKnowledgeSessionImpl( (InternalRuleBase) this.ruleBase, null, null ); }
public StatelessKnowledgeSession newStatelessKnowledgeSession(KnowledgeSessionConfiguration conf) { return new StatelessKnowledgeSessionImpl( (InternalRuleBase) this.ruleBase, null, conf ); }