use of org.jbpm.task.service.TaskServiceSession in project jBPM5-Developer-Guide by Salaboy.
the class TaskServerDaemon method startServer.
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));
}
taskServer = new HornetQTaskServer(taskService, 5443);
Thread thread = new Thread(taskServer);
thread.start();
}
Aggregations