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().