1 Reply Latest reply on Jun 7, 2006 3:27 AM by kukeltje

    query for instances in state X

    wrschneider99

      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

        • 1. Re: query for instances in state X
          kukeltje

          1: It is just not implemented. The webapp of 3.1 contains some functionality for this, which is indeed done by implementing hibernate queries. It is not seriously wrong.

          2: I store references to data in the process, not the other way around. Is there a best practice? Not realy, both have some small advantages and disadvanteges.