0 Replies Latest reply on Nov 15, 2013 4:18 AM by Sudha Balu

    Workflow not processing after 2nd human task completed.

    Sudha Balu Newbie

      If i create knowledge session using JPAKnowledgeservice then work flow is not processing after second human task is completed.

       

      • Jboss 6
      • MySQL

       

      My code :

       

      EntityManagerFactory emf = Persistence.createEntityManagerFactory("org.jbpm.persistence.jpa");

      Environment  env = KnowledgeBaseFactory.newEnvironment();

      env.set(EnvironmentName.ENTITY_MANAGER_FACTORY, emf);

      StatefulKnowledgeSession ksession = JPAKnowledgeService.newStatefulKnowledgeSession(kbase, null, env);

       

      EntityManagerFactory emf1 = Persistence.createEntityManagerFactory("org.jbpm.task");

      org.jbpm.task.service.TaskService taskService = new org.jbpm.task.service.TaskService(emf1, SystemEventListenerFactory.getSystemEventListener());

      TaskServiceSession taskSession  = taskService.createSession();

      taskService.addEventListener(new TestEventListenerImpl(ksession, taskSession));

      LocalTaskService  localTaskService = new LocalTaskService(taskService);

      localTaskService.connect();

       

      LocalHTWorkItemHandler humanTaskHandler = new LocalHTWorkItemHandler(ksession, OnErrorAction.RETHROW);

      humanTaskHandler.setOwningSessionOnly(true);

      humanTaskHandler.setClient(localTaskService);

      humanTaskHandler.connect();

       

      ksession.getWorkItemManager().registerWorkItemHandler("Human Task", humanTaskHandler);

       

      The same code is working fine  if i  create knowledge session as shown below.

      ksession =   kbase.newStatefulKnowledgeSession(null,env);

       

      Any idea.? I have attached my persistence xml file here.