ClassName |
|
---|---|
Component | (see below) |
The WorkflowTaskQueryDroplet
servlet bean 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.
Note that 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 tasksworkflowViewPath
—Nucleus path of the session-scopedatg.workflow.WorkflowView
component used to find the tasks accessible to the current useruserDirectoryUserAuthority
—atg.userdirectory.UserDirectoryUserAuthority
used to resolve directory principals
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 not specified, accessibility is checked against the current user. This parameter takes effect only if the accessibleOnly
parameter is set to true.
accessRight
The access right that determines the tasks’ accessibility. This parameter takes effect only if the accessibleOnly
parameter is set to true. Its value must be one of the following:
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
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. This parameter takes effect only if the accessibleOnly
parameter is set to true. Its value must be one of the following:
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.
subjectId
Repository ID of the workflow subject whose tasks should be returned. If this parameter is not set, tasks for all workflow subjects are returned. Note that 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 this parameter is not set, 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 this parameter is not set, 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 this parameter is not set, and if taskElementIds
, taskName
, and taskNames
are also not set, 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 this parameter is not set, and if taskName
and taskNames
are also not set, 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 this parameter is not set, and if taskNames
is also not set, 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 this parameter is not set, all tasks for the specified workflow segment are returned.
sorter
The Comparator
which should be used to sort the tasks returned by the query. If this parameter is not set, 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.
Example
The following example demonstrates using a WorkflowTaskQueryDroplet
component to display all active tasks which are owned by the current user, and which he or she has the right to 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>