In addition to workflow servlet beans, the configuration for each new workflow type will typically include a request-scoped component of class atg.workflow.servlet.WorkflowTaskFormHandler
. This form handler is used to perform workflow task operations such as setting a task’s owner and firing outcomes.
The WorkflowTaskFormHandler
class has four properties that together uniquely identify the task being operated on by the form handler: processName
, segmentName
, subjectId
, and taskElementId
. It also has the following read-only properties that can be accessed once the task’s identifying information has been specified:
taskDescriptor
—TaskDescriptor
object that describes the task
outcomeDescriptors
— list ofOutcomeDescriptor
objects that describe all the possible outcomes of the task
taskInfo
—TaskInfo
object that describes the given task instance
The form handler’s submit methods operate on the task on behalf of the WorkflowView
associated with the form. The following submit methods are supported:
setTaskPriority
— sets the task’s priority to the value of thenewPriority
property
setTaskOwner
— sets the task’s owner to theatg.userdirectory.DirectoryPrincipal
corresponding to theatg.security.Persona
name specified via thenewOwnerName
property
claimTask
— claims the task on behalf of the current user’s view
releaseTask
— releases the task on behalf of the current user’s view
fireOutcome
— fires the task outcome identified by theoutcomeElementId
property
The following properties of the WorkflowTaskFormHandler
will typically be set in the properties file for this component:
workflowManager
—WorkflowManager
providing access to the workflow system
workflowView
— session-scopedWorkflowView
on behalf of which the task is to be manipulated
subjectRepository
—MutableRepository
that stores workflow subjects
subjectType
— workflow subject item type
subjectClassName
— name of the class to use when instantiating the object to be returned by thesubject
property; the default isatg.workflow.servlet.WorkflowTaskFormSubject
(see below for details)
The following properties will typically be set in the JSP page:
processName
— name of the workflow process
segmentName
— name of the workflow process segment
subjectId
— repository ID of the workflow subject
taskElementId
— ID of the workflow element of the task
newPriority
— new priority value to be set by thesetTaskPriority
submit method
newOwnerName
— uniqueatg.security.Persona
name of new owner, to be set by thesetTaskOwner
submit method
outcomeElementId
— ID of the outcome element to be fired by thefireOutcome
submit method
updateSubjectOnSubmit
— flag indicating whether the workflow subject should be updated when the submit methods are executed (see below for details)
The WorkflowTaskFormHandler
also has a set of properties that are used to control navigation after a form operation has been completed. These properties specify the URLs to redirect to on certain error and success conditions. If the value for a particular condition is not set, the form is left on the page defined as the action for that form (in other words, no redirect takes place). Each operation has its own successURL
and errorURL
properties. Thus the following properties are available:
setTaskPrioritySuccessURL
setTaskPriorityErrorURL
setTaskOwnerSuccessURL
setTaskOwnerErrorURL
claimTaskSuccessURL
claimTaskErrorURL
releaseTaskSuccessURL
releaseTaskErrorURL
fireOutcomeSuccessURL
fireOutcomeErrorURL
These properties can be specified in the properties file of the form handler or via hidden tags in the JSP page.