5 Replies Latest reply on Sep 3, 2007 5:57 PM by Ronald van Kuijk

    how list all tasks?

    s b Newbie

      JbpmContext.getTaskList() fetches the TaskInstance list for the current authenticated actor. Is there a way to get a list of TaskInstances for all actors in the process?

        • 1. Re: how list all tasks?
          s b Newbie

          I realize I've asked questions like these before, but the threads wandered off the topic.

          I'd have to think there are enumerators for all processinstances, taskinstances, etc., but I haven't found them. One answer was to write your own query against the hibernate db, but that bypasses the API and is dangerous from an upgrade standpoint.

          Are there global enumerators or list methods for all these objects? If not, doesn't that seem like an omission?

          • 2. Re: how list all tasks?
            Ronald van Kuijk Master

            what happens if you try an actor of '%' or '*' or likewise

            • 3. Re: how list all tasks?
              s b Newbie

              Thanks, I'll try...

              • 4. Re: how list all tasks?
                s b Newbie

                Unfortunately wild card doesn't work because the query in "hibernate.queries.hbm.xml" is:

                <query name="TaskMgmtSession.findTaskInstancesByActorId">
                 select ti
                 from org.jbpm.taskmgmt.exe.TaskInstance as ti
                 where ti.actorId = :actorId
                 and ti.isSuspended != true
                 and ti.isOpen = true

                I tried changing the
                where ti.actorId = :actorId
                where ti.actorId like :actorId
                in the "hibernate.queries.hbm.xml" file embedded in the "jbpm-jpdl.jar", and then the wildcard worked (using an Oracle9 connection, by the way).

                List taskList = jbpmContext.getTaskList("%");

                Again, making a custom jBPM library is a maintenance worry. I hope the developers will give us an API for getting the complete task list. Our need is to be able to filter the complete list by various groups of users or other criteria.

                • 5. Re: how list all tasks?
                  Ronald van Kuijk Master

                  One of the beauties of open source is that you *can* develop extensions. Yes, they are a little difficult to maintain, but at least you *can* do it. Instead of changing the current API, you can extend it which is a little less worry to maintain ;-)

                  But you can always file a jira issue for this. Not sure if it will be accepted, but you'll never know.