V9.5
Overview
For a task activity in a workflow, the turnaround time (TAT) property enables you to calculate the time taken to process a request. The calculated turnaround time can then be used by end users in reports for analysis.
System counts the working time between the task creation date and completion date. The selected calendar determines the business working time, and any exception rules to be considered for dates.
You can use one of the following calendar modes:
- Pre-defined calendar: an already created calendar in the system that can be directly selected in the wizard while configuring TAT for task.
For details on how to create your own calendar, see this article. - Dynamic calendar: an already created calendar in the system selected as a result of an expression set in the wizard while configuring TAT for a task.
For details on how to configure, see step 3 in the procedure below.
Configure TAT for task
- In App Studio, open the workflow, and click task activity.
- In the Properties panel, under the Behavior section, click Turn Around Time Definition ellipsis.
- In the Turn Around Time Definition wizard, select a calendar mode.
- To select a pre-defined existing calendar directly from list:
- Select the calendar mode as Calendar from the list, and select an existing calendar from the list.
By default, General calendar is selected.
- Select the calendar mode as Calendar from the list, and select an existing calendar from the list.
- To add a dynamic calendar:
- Select the calendar mode as Dynamic calendar.
- Click ellipsis next to the text box, and add an expression using fields.
The result of this expression is a calendar Id of an existing calendar. In the above case, it's the user's calendar.
- To select a pre-defined existing calendar directly from list:
- Click OK.
Calculate TAT using CalendarDateDiff function
Cora SeQuence now provides CalendarDateDiff function to calculate time difference between two dates using an expression. You can use this time difference to calculate TAT of a workflow or a segment of it.
Consider the following example.
- Add an Assign activity to the workflow.
- Edit the activity.
- In the Variable Value Expression wizard, add an expression using fields and the CalendarDateDiff function to calculate difference between start date and end date of tasks in the workflow.
(CalendarDateDiff(rt, wf.CreatedBy.CalendarId, {Task1TAT}.CreatedAt, {DynamicTaskTAT}.CompletedAt)).TotalSeconds
This function takes start date, end date, and Calendar Id as parameters, and returns difference in timespan type.
The calculated TAT value is stored in the fldTurnAroundTime
column of tblinstanceactivities
table in Cora SeQuence database.
NOTE
Providing an end date earlier than the start date results in a negative number.
For an expression resulting in an invalid calendar Id or not resulting in a calendar Id, the CalendarDateDiff function returns a Null value. This doesn’t impact the workflow execution.
IMPORTANT
- TAT is rollback compatible, so TAT for a task does not change with rollback and re-submission of an existing completed task. Rollback deletes the existing task instance and calculates TAT for new instance.
- Rollback also re-calculates TAT for new instance of tasks for which TAT was null.
- TAT does not change with manual change of task completion date.
- TAT is backward compatible. On upgrade from previous version, for existing active tasks the default calendar General is set to calculate TAT; for closed tasks the TAT appears null.