Show next available task on completion

We have a requirement that when a user completes a task it should not take him back to the results page. They want the task detail of the next available task to be opened.

To make it worse, they prefer if the next task can be picked from the search result on the previous page.

For example. lets say

a) A user searches for tasks with a particular search criteria.
b) The search returns 10 tasks.
c) User selects the first task(1 of 10) and completes it.
d) They want the task details of the second task (2 of 10) to be displayed immediately and not return to the result page.

Is this doable? Help appreciated.


The basic pattern is that you can add a few lines of code to the Complete Action that do the following:

  • acquire the URL for the next task for the current user,
  • redirect to the new task instead of the inbox.

Let me know if that makes sense.


Thanks for the reply. What I am unable to understand is how I can access the search results from the previous page (task inbox search page) in the task details page.

For example, if the user search query results in 3 tasks (say ids 111, 222,333). When he clicks on task 111 it goes to the task detail page. So after he approves the task the user should see the task details of 222.

Should I pass all task ids (from the search result) to the task detail page as parameter?

Should I pass the search query itself and then rerun the query in the task detail page? If so how :slight_smile:

Please advise and thanks much for your help. This is all very new to me !!

You shouldn’t have to pass the task ids. What i recommend is that you re-execute the query programatically.

You can do this by reusing the search beans in the Search Results portlet. Add a reference to your task details page to that bean, (optionally invoke the refresh method) and get the first row. From that row, you’ll be able to get the id of the next task at the top of the list.

Hope this helps.


I referenced the entire “Task_processImageWFInboxResults/Default” page bean in the “Task_processImageWFView/Default” page. When I call the following
“ITask ita = getTask_processImageWFInboxResultsDefaultviewView().getTaskSearchProvider().getResults();”

it gives me a bunch of errors

Failed to evaluate binding expression: “#{activePageBean.activeSearchQuery.refineFields.taskID}”
Failed to evaluate binding expression: “#{activePageBean.activeSearchQuery.refineFields.priority}”
Failed to evaluate binding expression: “#{activePageBean.activeSearchQuery.refineFields.createdDateRange}”
Failed to evaluate binding expression: “#{activePageBean.activeSearchQuery.refineFields.modifiedDateRange}”
Failed to evaluate binding expression: “#{activePageBean.activeSearchQuery.refineFields.expirationDateRange}”
Failed to evaluate binding expression: “#{activePageBean.activeSearchQuery.refineFields.acceptedByCurrentUser}”
Failed to evaluate binding expression: “#{activePageBean.activeSearchQuery.invocationID}”

Am I missing something?


Any hints on the solution?

I guess the problem is that when the task search provider is called from the detail view it looks for activePageBean.activeSearchQuery.refineFields.taskID, activePageBean.activeSearchQuery.refineFields.priority and several other search fields.

As these fields are defined in the WFInboxResult/default page and not on the task detail page it fails.

Do I have to manually define (and set) each of the activeSearchQuery fields into my default view page bean?


If you want to replicate the exact same search, then you’ll have to ensure that you use the same search fields (aka refine fields).