InternalProcessRuntime processRuntime = ((StatefulKnowledgeSessionImpl) session).session.getProcessRuntime();
if (processRuntime != null) {
processRuntime.addEventListener( this );
}
} else if (session instanceof StatelessKnowledgeSessionImpl) {
StatelessKnowledgeSessionImpl statelessSession = ((StatelessKnowledgeSessionImpl) session);
isPhreak = ((ReteooRuleBase)statelessSession.getRuleBase()).getConfig().isPhreakEnabled();
statelessSession.addWorkingMemoryEventListener( this );
statelessSession.addAgendaEventListener( this );
statelessSession.addEventListener( this );
statelessSession.getRuleBase().addEventListener( this );
} else if (session instanceof CommandBasedStatefulKnowledgeSession) {
StatefulKnowledgeSessionImpl statefulSession =
((StatefulKnowledgeSessionImpl)((KnowledgeCommandContext)((CommandBasedStatefulKnowledgeSession) session).getCommandService().getContext()).getKieSession());
isPhreak = ((ReteooRuleBase)statefulSession.getRuleBase()).getConfig().isPhreakEnabled();
ReteooWorkingMemoryInterface eventManager = statefulSession.session;