Toggle menu

Task Management

The Task Management template displays a list of workflow tasks that are either assigned to or claimable by users. It provides filters to find tasks and users, and controls to either reassign a task to a different user, or unassign it, returning it back to the pool of claimable tasks.

The article extras let you control which workflow processes and which users can be managed by the template, as well as being able to construct a range of filters and add custom columns to the view of tasks.

Searchable Values
The data returned by the template is taken from workflow process instances that have been indexed by the platform's search engine. If you want to add custom filters and columns, the fields/variables that hold the values you want to filter on will need to have been indexed in the search, which will mean setting them as "searchable" in the forms that created them. See Process Instance Search Indexing for more information.

Task Management with Search
 

Page Title and Content

The Task Management template displays its title and content, including inline elements, in the same way as the Default template.

Searching for Tasks

The main search can be used to search for process business keys:

Search
 

It will perform partial matches on any part of a business key.

In the article extras you can choose to show or hide this search.

Custom Columns and Filters

Columns and filters are set up in the article extras. They determine which users can be managed by the template, control the process instances that will be returned, and provide controls that you can use to filter tasks.

For all filters, make a selection, then press the "Update" button to reload the table with your chosen filters. Current filters are listed at the top of the table and can be removed individually or cleared.

Current Filters
 

Select the Processes to Display

A list box in the article extras displays all of the currently deployed process models in the workflow engine.

Process Picker
 

Select the processes whose tasks you'd like to appear on your article. You can use Ctrl-Click or Shift-Click to select more than one. If you don't select any none will appear.

Process Variables Filter

When building filters the variable names and values should be entered in lowercase, the ANDs and ORs in UPPERCASE

You can further restrict the tasks shown by the template so that it will only show tasks for process instances that have variables with certain values. For example, you could select the "case management" process, and then write an expression to only show cases of a certain type.

Note that this filter is used to restrict the instances shown for the processes selected above, you must select processes before applying a filter.

Filter expressions have the format variablename='value'. The name of the variable should not be in quotes, the value always will be.

The filter also lets you construct more complex expressions using ANDs or ORs with named variables and values.

This expression would only return tasks for processes that have a type of complaint or a type of feedback:

Filter - OR
 

This expression would only return complaints that also have an escalated status:

Filter - AND
 

Task/Process Filter

Once the template has been set up to only show tasks for the process instances you want, you can also build filters that will appear in the Task/Process drop-down filter on the article.

Simple Filters

Start by building some simple filters. This example shows Task Management set up to work with Case Management. Each filter will display one case type:

Variable Filter
 

Each item in the list has a display value and an expression:

Filter Expression
 

Which has generated the following drop-down options:

Process Filter
 

Remember, you can use any process variable to construct a filter! We've seen great examples using locations, postcodes and case statuses.

More Complex Expressions

You can also build filters using AND or OR expressions. In this example a single item in the drop-down would display a variety of waste-related tasks:

Expression Filter
 

Creating Multiple Filters at Once

To make adding multiple items easier, press the "Add multiple" button. This lets you enter the name of a single process variable, then a comma separated list of possible values:

Add Multiple
 

Which will automatically generate the following list of items:

Add Multiple Result
 

You can then edit each item individually to tidy up the display values.

Useful Case Management Filters

These are some common filters you can use with Case Management processes.

VariableExampleDescription
assignGroupNameassignGroupName = "CM-TEST"Show cases assigned to the test group
form_CASETYPEform_casetype = "complaint"Show cases of this type type
form_CASESTAGENAMEform_casestagename = "stage 1"Show cases at this stage
form_STATUSform_status = "under review"Show cases with this status
form_CASESUBTYPEform_casesubtype = "corporate"Show cases with this subtype

Groups and Users

In the article extras, select the user groups that can be managed by the template. Only tasks assigned to or claimable by users in the chosen groups will be returned. The groups and users automatically populate the Assignee drop-down filter on the article. The list also includes the current user ("you").

For example, this article has been set up to manage two groups:

Manageable Groups
 

Those groups and the users in them appear as filters:

Assignee Filter
 

The groups appear first and a list of users second. Groups display the group description, followed by the name. Users are listed by their profile display name and account username.

Selecting a group or a user from the assignee filter will only display tasks already assigned to those users. This is a change in behaviour from previous versions of Task Management (prior to October 2024) where you would see all tasks a user may be able to work on, even via other group memberships.

Created and Due Date Filters

The options in these two filters are set in the article extras. Pick a date or SLA to filter the task table.

Date Filters
 

Custom Column Filters

You can add any number of extra custom columns to the table to use as filters for your tasks. There are two types of column, drop-down and text box, which determines the type of filter they provide.

Custom Drop-down

This column and filter creates a custom drop-down list.

Custom Drop-down
 

To create this column, in the article extras, pick "Add a custom column". Then choose "Dropdown".

Custom Drop-down Extras
 

  • Display label is the label that appears above the column
  • Query field is the name of the process variable (it is case sensitive) that holds the values you'd like to filter on
  • Type is either dropdown or fixed text (so, dropdown in this case)
  • Options type lets you enter fixed values that will appear in the drop-down, or lists all of the end points found in the TaskSearch.getConfig end point (see Configuration below)

Custom Text Box

This column filter works like a search, rather than picking options from a drop-down.

Custom Text Box Filter
 

To create this column, in the article extras, pick "Add a custom column". Then choose "Text box".

Custom Text Box Extras
 

  • Display label is the label that appears above the column
  • Query field is the name of the process variable (it is case sensitive) that holds the values you'd like to search for
  • Type is either dropdown or text box (so, text box in this case)

Standard Columns

The table of tasks always displays the following information.

Task/Process

This column includes the task description (as set in the workflow model), the process instance business key, and, in a tooltip, the process name.

Assignee

The display name of the user the task is currently assigned to, or the word "unassigned", with a button to assign the task.

Created and Due Dates

These dates are those of the task, not the process. You can sort tasks by date by clicking on the column titles. If a due date is in the past it will be highlighted in red.

Assigning Tasks

To assign a single task, press the assign button:

Assign Button
 

This launches the assign dialog:

Assign Dialog
 

The drop-down in this column displays who the task is currently assigned to or, if not assigned to anyone, the word unassigned. The users in the drop-down are taken from the task's candidates set in the workflow model. To assign the task, pick a user and press "Assign".

To assign multiple tasks at once, use the checkboxes next to the task descriptions, then press the "Assign selected tasks" button:

Assign Multiple
 

All of your chosen tasks will be loaded into the dialog. The dropdown of users will be filtered to only display users who are eligible to be assigned all of the tasks in the list.

Audit Log

The Task Management template writes an audit log using the platform's history service. A new history is added for each task that gets assigned or reassigned, with relevant information written into the history's subject:

{
    "id": "196f7581-756c-48bc-8edc-6c0a883ee22f",
    "labela": "Template log",
    "labelb": "c76465c0-4f8b-4c56-abb5-fd361cac6ac1",
    "labelc": null,
    "labeld": null,
    "labele": null,
    "created": 1626335004390,
    "lastupdated": 1626335004390,
    "sealed": true,
    "subject": {
        "private": false,
        "templateName": "taskmanagement",
        "articleID": 1865,
        "description": "Re-assigned task 623201 from stevew to adame",
        "subsiteName": "staff",
        "event": "Task Management",
        "userId": "TIMG"
    }
}

Where:

  • labela - always "Template log"
  • labelb - a unique ID generated by the site framework
  • created/lastupdated - the time of the assigning/unassigning
  • templateName - always "taskmanagement"
  • articleID - the ID of the article that was used
  • description - one of "Unclaimed task <taskID> from <userID>""Assigned task <taskID> to <userID>""Re-assigned task <taskID> from <userID> to <userID>"
  • subsiteName - the name of the subsite the article was published on
  • event - always "Task Management"
  • userId - the user who performed the assigning/unassigning/reassigning

Configuration

The custom drop-down column can generate its options from an end point rather than having fixed values entered into the article extras. The names of the end points you'd like to use need to be added into the Task Management configuration, so they can be selected in the article extras. The end points themselves need to return a single array of values that will appear in the drop-down on the template.

The configuration end point has the namespace config.[environment].TaskSearch.getConfig.

The end point should list the namespaces of other end points which will generate options for your drop-downs. For example, this configuration end point lists two end points:

function(params, credentials) {
    return {
        optionsEndpoints: [{
                name: "Initiator",
                endpoint: "test.alex.initiatorOptions"
            },
            {
                name: "Location",
                endpoint: "test.tim.locationOptions"
            }
        ]
    };
}

It provides these options in the article extras:

End Point Options
 

The initiatorOptions end point returns:

{
    "result": ["anonymous", "citizen1", "sarah"],
}

Which appears in the drop-down as:

End Point Drop-down
 

Last modified on November 20, 2024

Share this page

Facebook icon Twitter icon email icon

Print

print icon