AnsweredAssumed Answered

Searching tasks by workflow initiator

Question asked by alhol on Apr 15, 2013
Latest reply on Apr 15, 2013 by alhol
Hello!
Here is a problem:
We've got a working code from java-backed web-script task-instances.get:

            // a workflow instance id was provided so query for tasks
            WorkflowTaskQuery taskQuery = new WorkflowTaskQuery();
            taskQuery.setActive(null);
            taskQuery.setProcessId(workflowInstanceId);
            taskQuery.setTaskState(state);
            taskQuery.setOrderBy(new OrderBy[]{OrderBy.TaskDue_Asc});
           
            if (authority != null)
            {
                taskQuery.setActorId(authority);
            }
           
            allTasks = workflowService.queryTasks(taskQuery);


Then we've removed line

            taskQuery.setProcessId(workflowInstanceId);

and got as a result, allTasks list contains all active tasks "belong" to all existing workflows in a system assigned to given authority. That is exactly what we need.

But there is another challenge: we need to retrieve all active tasks which belong to workflows <em>initiated</em> by given authority. The purpose is to create a page similar to /my-tasks where user can see all workflows he initiated and their current status, i.e. current task.

Can someone give advice how to do it? Simple brute-force search seems to be very slow. Thanks in advance.

Outcomes