Hi
we have the same problem, with this code snip.
| try { |
| | InitialContext ctx= new InitialContext(); |
| | kbi=(KnowledgeBaseInterface)ctx.lookup("java:global/examplejbpm5/KnowledgeBaseEJB!it.comp.example.jbpm5.KnowledgeBaseInterface"); |
| } catch (NamingException e) { |
| | // TODO Auto-generated catch block |
| | e.printStackTrace(); |
| } |
| KnowledgeBase kbase= kbi.getKB(); |
| EntityManagerFactory emf = Persistence.createEntityManagerFactory("it.comp.example.jbpm5.jpa"); |
| Environment env = KnowledgeBaseFactory.newEnvironment(); |
| env.set(EnvironmentName.ENTITY_MANAGER_FACTORY, emf); |
| |
| StatefulKnowledgeSession ksession = JPAKnowledgeService.newStatefulKnowledgeSession(kbase, null, env); |
| ProcessInstance pi = ksession.getProcessInstance(1); |
| if (pi == null) { |
| | Map<String, Object> params = new HashMap<String, Object>(); |
| | params.put("employee", "krisv"); |
| | params.put("reason", "Yearly performance evaluation"); |
| | pi = ksession.startProcess("sayhello", params); // <--- exception |