Available Workflow Metrics
The EnsLib.Workflow.EngineOpens in a new tab class provides methods that reporting statistics about workflow roles.
You can use these when you define business metrics, so that workflow progress can be tracked and analyzed by users. (For detailed instructions, see Defining Business Metrics. Also see Exploring the Workflow Sample, which presents an example.)
These methods are as follows:
ClassMethod BamActiveTasks(pRole As %String) As %Integer
Returns the number of active tasks for a given workflow role. The input argument pRole is the configured name of a workflow role. This method calculates the number of active tasks by getting the list of tasks assigned to this role and determining which of these tasks are not yet complete.
ClassMethod BamActiveLoad(pRole As %String) As %Integer
Returns a value indicating the active load for a given workflow role. The input argument pRole is the configured name of a workflow role. This method calculates the active load by getting the current number of active tasks for the workflow role, comparing it with the Capacity property from the workflow role definition, and presenting the result as a percentage of total capacity for the workflow role. The formula is:
(ActiveTasks/Capacity)*100
ClassMethod BamCompletedTasks(pRole As %String,
pStart As %TimeStamp = "",
pEnd As %TimeStamp = "") As %Integer
Returns the number of completed tasks for a given workflow role, where:
-
pRole is the configured name of a workflow role.
-
pStart and pEnd are in %TimeStampOpens in a new tab format: yyyy-mm-dd
This method calculates the number of completed tasks by getting the list of tasks assigned to this role and determining which of these tasks has a status of Complete. BamCompletedTasks() considers only those tasks that started within the time period specified by pStart and pEnd. The task may have completed after the pEnd time.
ClassMethod BamTasksWithStatus(pRole As %String,
pStatus As %String,
pStart As %TimeStamp = "",
pEnd As %TimeStamp = "") As %Integer
Returns the number of tasks that have a particular status for a given workflow role, where:
-
pRole is the configured name of a workflow role.
-
pStatus is one of the following strings indicating the status of the role:
-
Unassigned
-
Assigned
-
Discarded
-
Cancelled
-
Completed
-
-
pStart and pEnd are in %TimeStampOpens in a new tab format: yyyy-mm-dd
This method gets the list of tasks assigned to the role and determines how many of them currently have the given status. BamTasksWithStatus() considers only those tasks that started within the time period specified by pStart and pEnd. The task may have ended (for whatever reason) after the pEnd time.
If the status you are interested in is Completed, it is simpler to use BamCompletedTasks().
ClassMethod BamAvgTaskTime(pRole As %String,
pStart As %TimeStamp = "",
pEnd As %TimeStamp = "") As %Integer
Returns the average duration (in seconds) of completed tasks for a given workflow role, where:
-
pRole is the configured name of a workflow role.
-
pStart and pEnd are in %TimeStampOpens in a new tab format: yyyy-mm-dd
This method considers only those tasks that started within the time period specified by pStart and pEnd. The task may have completed after the pEnd time.
ClassMethod BamMinTaskTime(pRole As %String,
pStart As %TimeStamp = "",
pEnd As %TimeStamp = "") As %Integer
Returns the minimum duration (in seconds) of completed tasks for a given workflow role, where:
-
pRole is the configured name of a workflow role.
-
pStart and pEnd are in %TimeStampOpens in a new tab format: yyyy-mm-dd
This method considers only those tasks that started within the time period specified by pStart and pEnd. The task may have completed after the pEnd time.
ClassMethod BamMaxTaskTime(pRole As %String,
pStart As %TimeStamp = "",
pEnd As %TimeStamp = "") As %Integer
Returns the maximum duration (in seconds) of completed tasks for a given workflow role, where:
-
pRole is the configured name of a workflow role.
-
pStart and pEnd are in %TimeStampOpens in a new tab format: yyyy-mm-dd
This method considers only those tasks that started within the time period specified by pStart and pEnd. The task may have completed after the pEnd time.