Optimizing Performance of Workflow TaskList

Documentation home

 

Optimizing TaskList performance. 1

Archiving. 2

Caching of process attribute values 2

 

See also:  Workflow Index, Workflow Out of the Box Tools

Optimizing TaskList performance 

This document provides a technique to ensure the best possible performance for a workflow task list application. The following factors influence the performance of the task list:

 

  1. Whether or not additional information for each task is displayed to the user e.g. information fetched from a database (can be a major impact)
  2. The number of tasks displayed to the end user (can be a major impact when combined with item 1)
  3. The total number of active tasks (moderate impact)
  4. The total number of tasks including completed tasks (small impact)
  5. The assignment logic – this varies according to the assignment handler. For the supplied Xi or Ebase assignment handlers, this overhead is very small.

 

The most significant negative influence on task list performance is the inclusion of additional information to be displayed to the user e.g. the following should be avoided wherever possible:

 

fetchtable tasklist;

loop at table tasklist

  fetch additional_data;                            // for each task, fetch additional information from a database

  set tasklist-additional_var1 = additional_data_var1;

endloop

 

The inclusion of the fetch statement can add a large overhead e.g. the fetchtable tasklist statement will typically return up to 500 tasks in less than 2 seconds. But 500 additional database fetches can easily add another 5 seconds or more to the overall response.

 

To ensure optimal performance, it is recommended that any such “additional information” that is to be displayed to the user should be maintained as a process attribute within the appropriate workflow job. For best performance, include the process attribute as a substitutable value within the workflow task text e.g. Service request &&RequestNumber from &&RequestUser. If this is not possible, then process attribute values can be retrieved using the FPL getprocessattribute() function as shown below, or Javascript system.workflow.api.getProcessAttributeValue() method.

 

fetchtable tasklist;

loop at table tasklist

  set tasklist-additional_var1 = getprocessattribute(tasklist-job_id, 'ATTR1');

endloop

Archiving

A Workflow Maintenance scheduled task is provided to remove completed jobs from the workflow runtime database. This should be run periodically to stop the workflow database from growing too large.

Caching of process attribute values

The system ensures a fast response for the getprocessattribute() function by caching process attribute values for running jobs. The size of the process attribute cache can be configured using server property Process Attributes Cache Size; this property sets the maximum number of jobs held in the cache and has a default value of 2000. Setting this value to -1 disables the cache. The cache size should be set with care: if process attributes are used in the task list display as described above, caching will have a major impact on task list performance so the cache should be large enough to accommodate all active workflow jobs. However, setting the cache size too large can use excessive memory.