return new CommandBasedStatefulKnowledgeSession( commandService );
}
public int getStatefulKnowledgeSessionId(StatefulKnowledgeSession ksession) {
if ( ksession instanceof CommandBasedStatefulKnowledgeSession) {
SingleSessionCommandService commandService = ( SingleSessionCommandService ) ((CommandBasedStatefulKnowledgeSession)ksession).getCommandService();
return commandService.getSessionId();
} else {
throw new IllegalArgumentException( "StatefulKnowledgeSession must be an a CommandBasedStatefulKnowledgeSession" );
}
}