1 Reply Latest reply on Apr 28, 2014 1:42 AM by swiderski.maciej

    ksession.getProcessInstances()

    mm524262909

      i try to use ksesson.getProcessInstaces(); but it return a collecion of size 0 which confused ne a lot


      javadoc of org.drools.runtime.process.ProcessRuntime.getProcessInstances():

       

           * Returns a collection of currently active process instances.  Note that only process

           * instances that are currently loaded and active inside the engine will be returned.

           * When using persistence, it is likely not all running process instances will be loaded

           * as their state will be stored persistently.  It is recommended not to use this

           * method to collect information about the state of your process instances but to use

           * a history log for that purpose.



      someone says History logs is the way to go for getting that information and not impacting the jBPM5 runtime database.

      but i dont know how to use history log can you help me? @Mauricio Salatino

        • 1. Re: ksession.getProcessInstances()
          swiderski.maciej

          whenever persistence is used for processes the ksession.getProcessInstances() will return empty list to avoid loading all process instances that might be stored in data base as that number can be (and in many cases is ) huge. History log can be enabled by registering process event listener, take a look at documentation on how to do that.

           

          HTH