0 Replies Latest reply on Mar 15, 2012 11:02 AM by pushpak1981

    jBPM5.2 KnowledgeBase Behaviour

    pushpak1981 Novice

      Hi,

       

      We have configured jBPM5.2 with Spring3. In our project we are trying to start multiple processes using a single stateful session. We are using spring threadingpool to execute multiple process into the same session.

       

      Our requirement is that we want the current active processes into the session. We can get it from session.getProcessInstanceMethod(). \

       

      This call is working fine when we directly lookup for ksession for springs cotainer.

       

      StatefulKnowledgeSession b = (StatefulKnowledgeSession) ctx.getBean("ksession"); 
      System.out.println(b.getProcessInstances().size() + "---" + b.getId());  /// Print 2 as 2 processes are running in spring thread pool
      

       

      But when we try to get the same process list using the KnowledgeBase we get list size as 0.

       

      KnowledgeBase b = (KnowledgeBase) ctx.getBean("kbase");
      System.out.println(b.getStatefulKnowledgeSessions().size());   /// Retruns 1 as we have one session configured in Spring application context xml
      
      for (StatefulKnowledgeSession s : b.getStatefulKnowledgeSessions()) {
              System.out.println(s.getProcessInstances().size() + "---" + s.getId());   //Returns Size as 0. even if 2 processes are running and are into wait state.
          }
      
      

       

      Are we doing anything wrong in case of KnowledgeBase API ? How we can get the Active process list from the KnowlegdeBase API ?

       

      Attached is the Spring Application context file.

       

      Thanks.