atg.workflow.servlet
Class WorkflowTaskQueryDroplet

java.lang.Object
  extended by atg.nucleus.logging.VariableArgumentApplicationLoggingImpl
      extended by atg.nucleus.GenericService
          extended by atg.nucleus.TimedOperationService
              extended by atg.nucleus.servlet.ServletService
                  extended by atg.nucleus.servlet.HttpServletService
                      extended by atg.servlet.DynamoServlet
                          extended by atg.workflow.servlet.WorkflowTaskQueryDroplet
All Implemented Interfaces:
atg.naming.AbsoluteNameable, NameContextBindingListener, NameContextElement, atg.naming.NameContextParentable, NameResolver, AdminableService, atg.nucleus.Configured, ApplicationLogging, atg.nucleus.logging.ApplicationLoggingSender, atg.nucleus.logging.TraceApplicationLogging, VariableArgumentApplicationLogging, ComponentNameResolver, Service, ServiceListener, ParameterServlet, java.util.EventListener, javax.servlet.Servlet

public class WorkflowTaskQueryDroplet
extends DynamoServlet

A droplet used to perform workflow task queries.

This droplet performs a task query, sets the output tasks parameter to the resulting Collection of TaskInfo objects, and renders its output parameter. It is typically used in conjunction with another droplet, such as ForEach or Range, which specifies the formatting of each of the TaskInfo objects.

Here is the complete description of the parameters to the WorkflowTaskQueryDroplet:

activeOnly
If true, the query will return only active tasks; otherwise, it will return all tasks, including inactive and completed tasks. The default is true.
accessibleOnly
If true, the query will return only tasks which are accessible to a particular principal. The default is true. If the principal parameter is set, accessibility will be checked against the specified directory principal; otherwise, accessibility will be checked against the current user.
principal
The DirectoryPrincipal (which may represent a user, role, group, or organization) whose access rights will determine the tasks' accessibility. If not specified, accessibility will be checked against the current user. This parameter only takes effect if the accessibleOnly parameter is set to true.
accessRight
The access right which will determine the tasks' accessibility. This parameter only takes effect if the accessibleOnly parameter is set to true. Its value must be one of the following: For example, if accessRight is set to "execute," only those tasks which can be executed by the current user/principal will be returned.
ownership
Specifies whether/how tasks should be filtered by ownership. This parameter only takes effect if the accessibleOnly parameter is set to true. Its value must be one of the following; the default is "any":
subjectId
Repository id of the workflow subject whose tasks should be returned. If not set, tasks for all workflow subjects will be 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 only be returned relative to a particular workflow subject.
processName
Name of the workflow process whose tasks should be returned. If not set, tasks for all workflow processes will be returned.
segmentName
Name of the workflow process segment whose tasks should be returned. This parameter only takes effect if the processName parameter is set. If not set, tasks for all segments of the specified workflow process will be returned.
taskElementId
Process element id of the workflow task which should be returned. This parameter only takes effect if both the processName and segmentName parameters are set. If not set, and if taskElementIds, taskName, and taskNames are also not set, all tasks for the specified workflow segment will be returned.
taskElementIds
Process element ids of the workflow tasks which should be returned. This parameter only takes effect if both the processName and segmentName parameters are set, and if taskElementId is not set. If not set, and if taskName and taskNames are also not set, all tasks for the specified workflow segment will be returned.
taskName
Name of the workflow task which should be returned. This parameter only takes effect if both the processName and segmentName parameters are set, and if taskElementId and taskElementIds are not set. If not set, and if taskNames is also not set, all tasks for the specified workflow segment will be returned.
taskNames
Names of the workflow tasks which should be returned. This parameter only takes effect if both the processName and segmentName parameters are set, and if taskElementId, taskElementIds, and taskName are not set. If not set, all tasks for the specified workflow segment will be returned.
sorter
The Comparator which should be used to sort the tasks returned by the query. If not set, the tasks will be returned sorted first by the workflow process/segment names and subject ids, then by their order of appearance in the workflow definition.
output
Rendered after the task query has been completed, and the results have been 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 corresponding error message will be placed into the errorMessage parameter.
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.

The following properties of WorkflowTaskQueryDroplet should be set in the properties file for this component:

workflowManager
WorkflowManager used to find the tasks
workflowViewPath
Nucleus path of the session-scoped WorkflowView component used to find the tasks accessible to the current user
userDirectoryUserAuthority
UserDirectoryUserAuthority used to resolve directory principals

See Also:
TaskInfo, TaskAccessRights, DirectoryPrincipal, Comparator, ForEach, Range

Field Summary
static ParameterName ACCESS_RIGHT
           
static ParameterName ACCESSIBLE_ONLY
           
static ParameterName ACTIVE_ONLY
           
static java.lang.String CLASS_VERSION
          Class version string
static ParameterName EMPTY
           
static ParameterName ERROR
           
static java.lang.String ERROR_MESSAGE
           
static ParameterName OUTPUT
           
static ParameterName OWNERSHIP
           
static ParameterName PRINCIPAL
           
static ParameterName PROCESS_NAME
           
static ParameterName SEGMENT_NAME
           
static ParameterName SORTER
           
static ParameterName SUBJECT_ID
           
static ParameterName TASK_ELEMENT_ID
           
static ParameterName TASK_ELEMENT_IDS
           
static ParameterName TASK_NAME
           
static ParameterName TASK_NAMES
           
static java.lang.String TASKS
           
 
Fields inherited from class atg.servlet.DynamoServlet
mAllowCleanupRequest, mParameters
 
Fields inherited from class atg.nucleus.servlet.ServletService
SERVLET_INFO_KEY
 
Fields inherited from class atg.nucleus.GenericService
SERVICE_INFO_KEY
 
Fields inherited from interface atg.nucleus.logging.TraceApplicationLogging
DEFAULT_LOG_TRACE_STATUS
 
Fields inherited from interface atg.nucleus.logging.ApplicationLogging
DEFAULT_LOG_DEBUG_STATUS, DEFAULT_LOG_ERROR_STATUS, DEFAULT_LOG_INFO_STATUS, DEFAULT_LOG_WARNING_STATUS
 
Constructor Summary
WorkflowTaskQueryDroplet()
           
 
Method Summary
 void doStartService()
          Called after the service has been created, placed into the naming hierarchy, and initialized with its configured property values.
protected  java.util.Collection getTasks(DynamoHttpServletRequest pRequest)
          Performs the task query, and returns a Collection of TaskInfo objects which satisfy the given criteria.
 UserDirectoryUserAuthority getUserDirectoryUserAuthority()
          Returns the UserDirectoryUserAuthority which will be used to resolve directory principals.
 WorkflowManager getWorkflowManager()
          Returns the WorkflowManager which will be used to find tasks.
 java.lang.String getWorkflowViewPath()
          Returns the Nucleus path of the WorkflowView which will be used to find tasks accessible to the current user.
 void service(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse)
          Called when a request needs to be processed.
 void setUserDirectoryUserAuthority(UserDirectoryUserAuthority pUserAuthority)
          Sets the UserDirectoryUserAuthority which will be used to resolve directory principals.
 void setWorkflowManager(WorkflowManager pWorkflowManager)
          Sets the WorkflowManager which will be used to find tasks.
 void setWorkflowViewPath(java.lang.String pWorkflowViewPath)
          Sets the Nucleus path of the WorkflowView which will be used to find tasks accessible to the current user.
 
Methods inherited from class atg.servlet.DynamoServlet
doDelete, doGet, doPost, doPut, getParameter, getParameters, getServletContext, init, service, service, setParameter
 
Methods inherited from class atg.nucleus.servlet.ServletService
destroy, getServletConfig, getServletInfo, setServletInfo
 
Methods inherited from class atg.nucleus.TimedOperationService
getAverageRequestHandlingTime, getHandledRequestCount, getRequestStartTime, getTotalRequestHandlingTime, isKeepingStatistics, notifyHandledRequest, resetStatistics, setKeepingStatistics
 
Methods inherited from class atg.nucleus.GenericService
addLogListener, createAdminServlet, doStopService, getAbsoluteName, getAdminServlet, getAdminServletOutputStreamEncoding, getLoggingForVlogging, getLogListenerCount, getLogListeners, getName, getNameContext, getNucleus, getRoot, getServiceConfiguration, getServiceInfo, isAdminServletUseServletOutputStream, isLoggingDebug, isLoggingError, isLoggingInfo, isLoggingTrace, isLoggingWarning, isRunning, logDebug, logDebug, logDebug, logError, logError, logError, logInfo, logInfo, logInfo, logTrace, logTrace, logTrace, logWarning, logWarning, logWarning, nameContextElementBound, nameContextElementUnbound, removeLogListener, reResolveThis, resolveName, resolveName, resolveName, resolveName, sendLogEvent, setAdminServletOutputStreamEncoding, setAdminServletUseServletOutputStream, setLoggingDebug, setLoggingError, setLoggingInfo, setLoggingTrace, setLoggingWarning, setNucleus, setServiceInfo, startService, stopService
 
Methods inherited from class atg.nucleus.logging.VariableArgumentApplicationLoggingImpl
vlogDebug, vlogDebug, vlogDebug, vlogDebug, vlogDebugTrace, vlogError, vlogError, vlogError, vlogError, vlogInfo, vlogInfo, vlogInfo, vlogInfo, vlogTrace, vlogTrace, vlogTrace, vlogTrace, vlogWarning, vlogWarning, vlogWarning, vlogWarning
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CLASS_VERSION

public static java.lang.String CLASS_VERSION
Class version string


ACTIVE_ONLY

public static final ParameterName ACTIVE_ONLY

ACCESSIBLE_ONLY

public static final ParameterName ACCESSIBLE_ONLY

PRINCIPAL

public static final ParameterName PRINCIPAL

ACCESS_RIGHT

public static final ParameterName ACCESS_RIGHT

OWNERSHIP

public static final ParameterName OWNERSHIP

SUBJECT_ID

public static final ParameterName SUBJECT_ID

PROCESS_NAME

public static final ParameterName PROCESS_NAME

SEGMENT_NAME

public static final ParameterName SEGMENT_NAME

TASK_ELEMENT_ID

public static final ParameterName TASK_ELEMENT_ID

TASK_ELEMENT_IDS

public static final ParameterName TASK_ELEMENT_IDS

TASK_NAME

public static final ParameterName TASK_NAME

TASK_NAMES

public static final ParameterName TASK_NAMES

SORTER

public static final ParameterName SORTER

OUTPUT

public static final ParameterName OUTPUT

EMPTY

public static final ParameterName EMPTY

ERROR

public static final ParameterName ERROR

TASKS

public static final java.lang.String TASKS
See Also:
Constant Field Values

ERROR_MESSAGE

public static final java.lang.String ERROR_MESSAGE
See Also:
Constant Field Values
Constructor Detail

WorkflowTaskQueryDroplet

public WorkflowTaskQueryDroplet()
Method Detail

getWorkflowManager

public WorkflowManager getWorkflowManager()
Returns the WorkflowManager which will be used to find tasks.


setWorkflowManager

public void setWorkflowManager(WorkflowManager pWorkflowManager)
Sets the WorkflowManager which will be used to find tasks.


getWorkflowViewPath

public java.lang.String getWorkflowViewPath()
Returns the Nucleus path of the WorkflowView which will be used to find tasks accessible to the current user.


setWorkflowViewPath

public void setWorkflowViewPath(java.lang.String pWorkflowViewPath)
Sets the Nucleus path of the WorkflowView which will be used to find tasks accessible to the current user.


getUserDirectoryUserAuthority

public UserDirectoryUserAuthority getUserDirectoryUserAuthority()
Returns the UserDirectoryUserAuthority which will be used to resolve directory principals.


setUserDirectoryUserAuthority

public void setUserDirectoryUserAuthority(UserDirectoryUserAuthority pUserAuthority)
Sets the UserDirectoryUserAuthority which will be used to resolve directory principals.


getTasks

protected java.util.Collection getTasks(DynamoHttpServletRequest pRequest)
                                 throws javax.servlet.ServletException,
                                        WorkflowException
Performs the task query, and returns a Collection of TaskInfo objects which satisfy the given criteria.

Throws:
javax.servlet.ServletException - if missing or invalid parameters were encountered
WorkflowException - if there was a problem performing the task query
See Also:
TaskInfo

doStartService

public void doStartService()
                    throws ServiceException
Called after the service has been created, placed into the naming hierarchy, and initialized with its configured property values.

Overrides:
doStartService in class GenericService
Throws:
ServiceException - if the service had a problem starting up

service

public void service(DynamoHttpServletRequest pRequest,
                    DynamoHttpServletResponse pResponse)
             throws javax.servlet.ServletException,
                    java.io.IOException
Called when a request needs to be processed.

Overrides:
service in class DynamoServlet
Parameters:
pRequest - the request to be processed
pResponse - the response object for this request
Throws:
javax.servlet.ServletException - if an application specific error occurred processing this request
java.io.IOException - if an error occurred reading data from the request or writing data to the response