JBoss Community

Re: jBPM 5.2 issue Jboss7.1Beta

created by rigazilla in jBPM - View the full discussion

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

Reply to this message by going to Community

Start a new discussion in jBPM at Community