1 Reply Latest reply on Jun 18, 2008 3:29 PM by Ronald van Kuijk

    query process instances using filter

    Martin Pelzer Newbie

      Hello,

      using the JBPM API I can query process instances using the graph session like this:

      jbpmContext.getGraphSession().findProcessInstances("processDefinitionId");


      Is there any possibility to add some filters to process instance queries? Filters could be "only suspended processes" or "processes where variable x is set to y" or "processes created after x".

      I know that I could query the JBPM database directly but is this really the only way?


      Thanks for your help,
      Martin

        • 1. Re: query process instances using filter
          Ronald van Kuijk Master

           

          I know that I could query the JBPM database directly but is this really the only way?


          This is the way jBPM also does it. Most common functions are put in the api but you can always get the current hibernate session from the jbpmContext and use HQL to do what you want (jBPM does exactely that in the api impl.)

          Besides that, your second example is not supported out of the box because it is VERY expensive. Either in adding loads of indexes to keep it somewhat performant while querying but making inserts a lot slower or by doing full table scans.