Introducing Task Filters

By
  • Blog
  • >
  • Introducing Task Filters
TOPICS

30 Day Free Trial

Bring together legacy systems, RPA bots, microservices and more with Camunda

Join the Camunda Developer Newsletter

Get the latest events, release notes, and product updates straight to your mailbox

TRENDING CONTENT
With Camunda BPM 7.2.0-alpha5, we introduce Task Filters. Task filters are TaskQueries which can be saved to the database so that you can run them repeatedly.

Creating a Filter using Java API

At a Java API Level, a filter can be created as a regular task query:

// create a taskQuery
TaskQuery myTasksQuery = taskService.createTaskQuery().taskAssignee("daniel.meyer").active();

// save taskQuery as filter
Filter myTasksFilter = filterService.newTaskFilter("My Tasks");
myTasksFilter.setOwner("daniel.meyer");
myTasksFilter.setQuery(myTasksQuery);
String filterId = filterService.saveFilter(myTasksFilter);

// execute the filter
List<Task> tasks = filterService.listPage(filterId, 0, 20);

If you want to share the filter with other users and for each user, make should return that particular user’s tasks, it is possible to use Expression Language in the task query:

taskService.createTaskQuery().taskAssigneeExpression("${ currentUser() }").active();

The above example uses the built-in expression currentUser() which returns the userId of the currently authenticated user (set through IdentityService.setAuthentication()).

For more built-in Expression Language functions, see the corresponding User Guide Section.

Filters can also be managed using the REST Api.

Managing Task Filters in camunda Tasklist

With the latest release of camunda Tasklist, you can manage filters. Filters are displayed at the left handside of the Tasklist and can be assigned a Name, a Priority and a Color.

assign approver in tasklist with filters

Creating a new Task Filter

A new filter can be created by selecting the “New filter” button. A dialog opens which allows to configure the filter:

create new filter modal dialog

Defining Filter Criteria

Filter criteria can be defined in the “Criteria” section. In this example we select all tasks by candidate Group and Due Date:

defining filter criteria

Sharing Filters

Filters can be shared with other users and Groups by defining Authorizations. This filter is shared with all users part of the group “management”. They have been granted “READ” permission meaning that they can see and execute the filter but they cannot modify or delete it.

defining Authorizations

What’s next?

With Camunda 7.2 we limit out of the box support for filters to Task Filters. If this is a success, we can think of many more interesting use cases for filters:
  • camunda Cockpit: Process Definition and Process Instance Filters in cockpit
  • Operations Monitoring: define a Filter Query and monitor it via REST from an Operations tool like Nagios
  • Combine Filers and Timer Jobs: At midnight, execute a Filter and for each Task, send a reminder email…

Try All Features of Camunda Platform

Related Content

What are business processes, and why are they important? Learn how they work, types of business processes, & why well-orchestrated processes are critical.
Study demonstrates significant benefits to adopting Camunda and provides a powerful customizable tool to help you understand the impact it can have on your organization.
Learn how Samantha, as a developer and a new Camunda user, explored Camunda Optimize to enhance their development process.