7 Replies Latest reply on Dec 4, 2013 3:10 AM by Maciej Swiderski

    JBPM6 - RuntimeManager @PerProcessInstance and KSession

    Fer Gia Newbie


      I have an RuntimeManager annotated with @PerProcessInstance in CDI:


      private RuntimeManager manager;
      private TaskService taskService;


      I create a new process like this:


      RuntimeEngine engine= manager.getRuntimeEngine(ProcessInstanceIdContext.get());
      KieSession session=engine.getKieSession();
      session.setGlobal("foo", new Foo());


      Thats works OK.

      When the process is created, inside the first task the global "foo" is correct and working.

      But when I try to acces the "foo" global in a separate request (for example when the task is completed)  this is null.


      If I use a @Singleton RuntimeManager the global is alive at all the tasks, but with PerProcessInstance its resets to null


      Is any way to keep the global alive during the process lifecycle?