我正在尝试制作一个基于spring mvc和hibernate的drools应用程序。
EntityManagerFactory emf = Persistence.createEntityManagerFactory("org.drools.task");
Environment env = KnowledgeBaseFactory.newEnvironment();
env.set(EnvironmentName.ENTITY_MANAGER_FACTORY, emf);
TaskService taskService = new TaskService(emf, systemEventListener);
TaskServiceSession taskSession = taskService.createSession();
taskSession.addUser(new User("Administrator"));
taskSession.addUser(new User("Myuser"));// can be set to logged in user at runtime
MinaTaskServer server = new MinaTaskServer(taskService);
Thread thread = new Thread(server);
thread.start();
ksession.getWorkItemManager().registerWorkItemHandler("Log",humanTaskHandler);
ksession.getWorkItemManager().registerWorkItemHandler("Human Task", wsHumanTaskHandler);
KnowledgeRuntimeLogger logger = KnowledgeRuntimeLoggerFactory.newFileLogger(ksession, "test");
// start a new process instance
ksession.startProcess("HumanTaskSample");
做什么createEntityManagerFactory
?它会从数据库中删除我所有的表并每次都创建一个新表吗?
因为在我的任务表中,每次它只包含一行?
为什么??
提前致谢。