1 Reply Latest reply on Jun 7, 2006 3:27 AM by Ronald van Kuijk

    query for instances in state X

    Bill Schneider Newbie

      what is the preferred way to get a list of task instances in a given state?

      I don't see a clear method on JbpmContext for doing something like this. but it seems like you should be able to do a direct HQL query like

      "from Token t where t.node.name = ?"

      is that seriously wrong, or is it ok?

      Relatedly, is there a best-practice for how to link domain model entities to process instances? It seems like I could just add a ProcessInstance property to any old object if I'm using Hibernate already, and then do queries like

      "from MyObject foo where foo.processInstance.rootToken.node.name = :state"

      Is that the right way to use the tool, or would that be an abuse of the jBPM abstractions?

      Thanks in advance,
      -- Bill