env.set( EnvironmentName.TRANSACTION_MANAGER,
TransactionManagerServices.getTransactionManager() );
Properties properties = new Properties();
properties.put("drools.processInstanceManagerFactory", "org.jbpm.persistence.processinstance.JPAProcessInstanceManagerFactory");
properties.put("drools.processSignalManagerFactory", "org.jbpm.persistence.processinstance.JPASignalManagerFactory");
KnowledgeSessionConfiguration config = KnowledgeBaseFactory.newKnowledgeSessionConfiguration(properties);
StatefulKnowledgeSession session = JPAKnowledgeService.newStatefulKnowledgeSession(kbase, config, env);
new JPAWorkingMemoryDbLogger(session);
JPAProcessInstanceDbLog log = new JPAProcessInstanceDbLog(env);
session.getWorkItemManager().registerWorkItemHandler("Human Task", new WorkItemHandler() {
public void executeWorkItem(WorkItem workItem, WorkItemManager manager) {