public void startServer() {
if(isRunning())
throw new IllegalStateException("Server is already started");
this.running = true;
EntityManagerFactory entityManagerFactory = Persistence.createEntityManagerFactory("org.drools.task");
TaskService taskService = new TaskService(entityManagerFactory, SystemEventListenerFactory.getSystemEventListener());
TaskServiceSession taskSession = taskService.createSession() ;
MockUserInfo userInfo = new MockUserInfo();
taskService.setUserinfo( userInfo);
for (String userName : getDefaultUsers()) {
taskSession.addUser(new User(userName));
}