2 Replies Latest reply on Jul 8, 2011 5:41 AM by Marco Piraccini

    JPA Persistence and issues

    Marco Piraccini Newbie

      Hi guys,

       

      Since I switched to the JPA Persistence, I have some weird issues:

       

      1) When i get a ProcessInstance, it seems that the InternalKnowledgeRuntime is always null! That produces some NPE at runtime, for instance in:

      at org.jbpm.workflow.instance.node.WorkItemNodeInstance.getWorkItem(WorkItemNodeInstance.java:65) when I execute: workItemNodeInstance.getWorkItem()

       

      All I do is:

              StatefulKnowledgeSession session =

              JPAKnowledgeService.

                      newStatefulKnowledgeSession(knowledgeBase,

                              getKnowledgeSessionConfiguration(),

                                  getEnvironment());

       

              WorkflowProcessInstance processInstance = (WorkflowProcessInstance) session

                      .startProcess(processId, params);

             

              processInstance.getKnowledgeRuntime().toString() // NPE!!!!!!!!!!!!!!

       

      2) The  ProcessInstance.getState() returns "STATE_ACTIVE" even when the process is (correctly) ended. All seems ok (the ProcessEventListener method are fired, etc)...but if I use the ProcessInstance getState() method to test the state, that returns always STATE_ACTIVE.

       

      I'm using JBPM 5.1 final.

       

      Marco.