Returns information about a specified set of workflow tasks.
Class Name |
|
---|---|
Component | None provided; see Usage Notes. |
Required Input Parameters
None
Optional Input Parameters
activeOnly
If true, the query returns only active tasks; otherwise, it returns all tasks, including inactive and completed tasks. Default is true.
accessibleOnly
If true, the query returns only tasks that are accessible to a particular principal. The default is true. If the principal
parameter is set, accessibility is checked against the specified directory principal; otherwise, accessibility is checked against the current user.
principal
The atg.userdirectory.DirectoryPrincipal
(which can represent a user, role, group, or organization) whose access rights determine the tasks’ accessibility. If omitted, accessibility is checked against the current user. This parameter takes effect only if the accessibleOnly
parameter is set to true.
accessRight
Determines the tasks’ accessibility, set to one of the following values:
write
: represents the ability to change various attributes of a task, such as its priority, owner, and access control listexecute
: represents the ability to execute, claim, and release a task
This parameter takes effect only if the accessibleOnly
parameter is set to true.
For example, if accessRight
is set to execute
, only those tasks which can be executed, claimed, and released by the current user or principal are returned.
ownership
Specifies how tasks should be filtered by ownership, set to one of the following values:
any
: Accept all tasks regardless of ownership (default).self
: Accept only tasks owned by the current user or principal.unowned
: Accept only tasks that are not owned.selfOrUnowned
: Accept only tasks that are either not owned or owned by the current user or principal.
This parameter takes effect only if the accessibleOnly
parameter is set to true.
subjectId
Repository ID of the workflow subject whose tasks should be returned. If omitted, tasks for all workflow subjects are returned. The subjectId
parameter must be set if the activeOnly
parameter is set to false; in other words, inactive and completed tasks can be returned relative to a particular workflow subject only.
processName
Name of the workflow process whose tasks should be returned. If omitted, tasks for all workflow processes are returned.
segmentName
Name of the workflow process segment whose tasks should be returned. This parameter takes effect only if the processName
parameter is set. If omitted, tasks for all segments of the specified workflow process are returned.
taskElementId
Process element ID of the workflow task which should be returned. This parameter takes effect only if both the processName
and segmentName
parameters are set. If omitted and taskElementIds
, taskName
, and taskNames
are also omitted, all tasks for the specified workflow segment are returned.
taskElementIds
Process element IDs of the workflow tasks which should be returned. This parameter takes effect only if both the processName
and segmentName
parameters are set, and if taskElementId
is not set. If omitted and taskName
and taskNames
are also omitted, all tasks for the specified workflow segment are returned.
taskName
Name of the workflow task which should be returned. This parameter takes effect only if both the processName
and segmentName
parameters are set, and if taskElementId
and taskElementIds
are not set. If omitted and taskNames
is also omitted, all tasks for the specified workflow segment are returned.
taskNames
Names of the workflow tasks which should be returned. This parameter takes effect only if both the processName
and segmentName
parameters are set, and if taskElementId
, taskElementIds
, and taskName
are not set. If omitted, all tasks for the specified workflow segment are returned.
sorter
The Comparator
used to sort the tasks returned by the query. If omitted, the tasks are returned sorted first by the workflow process and segment names and subject IDs, then by their order of appearance in the workflow definition.
Output Parameters
tasks
Set to the results of the task query, a Collection
of TaskInfo
objects.
errorMessage
Set to the error message if an error occurs in the course of executing the query.
Open Parameters
output
Rendered after the task query has been completed, and the results are placed into the tasks
parameter.
empty
Rendered if no tasks are returned from the query.
error
Rendered if an error occurs while executing the query. The errorMessage
parameter is set to the corresponding error message.
Usage Notes
WorkflowTaskQueryDroplet performs a workflow task query and returns the resulting Collection
of atg.workflow.TaskInfo
objects. WorkflowTaskQueryDroplet is typically used in conjunction with another servlet bean, such as ForEach
or Range
, which can iterate through the Collection
to display the TaskInfo
objects.
The Scenarios module does not include a Nucleus component of this class, because each component is typically configured to work with a specific type of workflow. When you create a workflow type, you can create a WorkflowTaskQueryDroplet and configure it by setting the following properties in the component’s properties file:
workflowManager
:atg.workflow.WorkflowManager
used to find the tasks.workflowViewPath
: Nucleus path of the session-scopedatg.workflow.WorkflowView
component used to find the tasks accessible to the current user.userDirectoryUserAuthority
:atg.userdirectory.UserDirectoryUserAuthority
used to resolve directory principals.
Example
The following example shows how to use a WorkflowTaskQueryDroplet component to display all active tasks that are owned by the current user, and which he or she can execute, claim, and release:
<dsp:droplet name="WorkflowTaskQuery"> <dsp:param name="accessRight" value="execute"/> <dsp:param name="ownership" value="self"/> <dsp:oparam name="empty"> No tasks to execute. </dsp:oparam> <dsp:oparam name="output"> <dsp:droplet name="/atg/dynamo/droplet/ForEach"> <dsp:param name="array" param="tasks"/> <dsp:oparam name="output"> Workflow subject <dsp:valueof param="element.subjectId"/>: task <dsp:valueof param="element.taskDescriptor.name"/><br/> </dsp:oparam> </dsp:droplet> </dsp:oparam> </dsp:droplet>