I'm trying to follow the Drools Flow example code in the Human Task documentation and I have the following code:
import javax.persistence.EntityManagerFactory;
import javax.persistence.Persistence;
import org.drools.task.service.TaskService;
// ...
EntityManagerFactory emf =
Persistence.createEntityManagerFactory("org.drools.task");
TaskService taskService = new TaskService(emf, null);
I have put a persistence.xml
file in META-INF
as specified here (which is definitely getting picked up as I get an XML parsing error if I mangle it) but the following exception is thrown:
Exception in thread "main" java.lang.IllegalArgumentException:
Named query not found: UnescalatedDeadlines
at org.hibernate.ejb.AbstractEntityManagerImpl.createNamedQuery(
AbstractEntityManagerImpl.java:108)
at org.drools.task.service.TaskService.<init>(TaskService.java:65)
at org.drools.task.service.TaskService.<init>(TaskService.java:48)
at com.sample.RuleFlowTest.main(RuleFlowTest.java:32)`
Note that the second parameter to TaskService
is required but not mentioned in the documentation. It seems unlikely to me but could it be that setting it to null
as I've done is causing this issue?