if ( environment == null ) {
throw new IllegalArgumentException( "Environment cannot be null" );
}
CommandService commandService = (CommandService) buildCommandService( kbase,
mergeConfig( configuration ),
environment );
commandService.getContext().set(WorkingMemoryEntryPointBuilder.class.getName(),
new CommandBasedWorkingMemoryEntryPointBuilder(commandService));
return new CommandBasedStatefulKnowledgeSession( commandService );
}