atg.workflow.servlet
Class WorkflowTaskFormHandler

java.lang.Object
  extended by atg.nucleus.logging.VariableArgumentApplicationLoggingImpl
      extended by atg.nucleus.GenericService
          extended by atg.droplet.EmptyFormHandler
              extended by atg.droplet.GenericFormHandler
                  extended by atg.droplet.TransactionalFormHandler
                      extended by atg.workflow.servlet.WorkflowTaskFormHandler
All Implemented Interfaces:
DropletFormHandler, NameContextBindingListener, NameContextElement, NameResolver, AdminableService, ApplicationLogging, atg.nucleus.logging.ApplicationLoggingSender, atg.nucleus.logging.TraceApplicationLogging, VariableArgumentApplicationLogging, ComponentNameResolver, Service, ServiceListener, java.util.EventListener

public class WorkflowTaskFormHandler
extends TransactionalFormHandler

A form handler for operating on workflow tasks.

This bean has four properties which 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 which can be accessed once the task's identifying information has been specified:

taskDescriptor
TaskDescriptor object which describes the task
outcomeDescriptors
list of OutcomeDescriptor objects which describe all the possible outcomes of the task
taskInfo
TaskInfo object which 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 the newPriority property
setTaskOwner
sets the task's owner to the value corresponding to the newOwnerName 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 the outcomeElementId 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-scoped WorkflowView on behalf of which the task is to be manipulated
subjectRepository
repository which stores workflow subjects
subjectType
workflow subject item type
subjectClassName
name of the class to use when instantiating the object to be returned by the subject property; the default is "atg.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 the setTaskPriority submit method
newOwnerName
unique Persona name of the new owner to be set by the setTaskOwner submit method
outcomeElementId
id of the outcome element to be fired by the fireOutcome submit method
updateSubjectOnSubmit
flag indicating whether the workflow subject should be updated when the submit methods are executed (see below for details)

When operating on tasks, it is common to want to update the workflow subject as it gets advanced through the workflow. For example, a manager in an expense report workflow may be required to submit a comment as part of approving or rejecting an expense report. The comment field is typically a property of the workflow subject (the expense report).

To facilitate subject updates without the need for custom code, WorkflowTaskFormHandler exposes a special subject property of type WorkflowTaskFormSubject (or a subclass specified via the subjectClassName property). Using this property, one can set subject values as follows:

When the updateSubjectOnSubmit property is set to true, the values set via the subject property are copied over to the workflow subject when any of the submit methods are executed.

Finally, the WorkflowTaskFormHandler has a set of properties which are used to control navigation after a form operation has been completed. These properties specify the URLs to redirect 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 (i.e. no redirect takes place). Each operation has its own successURL and errorURL properties. These properties can be specified either in the properties file of the form handler, or in the jsp page via hidden tags.

Instances of this form handler should be request-scoped.

See Also:
WorkflowTaskFormSubject

Field Summary
static java.lang.String CLASS_VERSION
          Class version string
 
Fields inherited from class atg.droplet.GenericFormHandler
PARAM_DEFER_FORWARD_OR_REDIRECT, PARAM_USE_FORWARDS
 
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
WorkflowTaskFormHandler()
           
 
Method Summary
protected  void addFormException(java.lang.String pErrorKey, DynamoHttpServletRequest pRequest)
          Adds a new exception to the list of form exceptions.
protected  void addFormException(java.lang.String pErrorKey, java.lang.Object[] pArgs, DynamoHttpServletRequest pRequest)
          Adds a new exception to the list of form exceptions.
protected  void addFormException(java.lang.String pErrorKey, java.lang.Object[] pArgs, java.lang.Throwable pException, DynamoHttpServletRequest pRequest)
          Adds a new exception to the list of form exceptions.
protected  void addFormException(java.lang.String pErrorKey, java.lang.Throwable pException, DynamoHttpServletRequest pRequest)
          Adds a new exception to the list of form exceptions.
protected  void claimTask(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse)
          This method is called by handleClaimTask to actually claim the task.
protected  WorkflowTaskFormSubject createSubject()
          Creates a WorkflowTaskFormSubject object to be returned as the value of the subject property, by instantiating an object of the type specified via the subjectClassName property.
 void doStartService()
          Called after the service has been created, placed into the naming hierarchy, and initialized with its configured property values.
protected  void fireOutcome(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse)
          This method is called by handleFireOutcome to actually fire the task outcome.
 java.lang.String getClaimTaskErrorURL()
          Returns the URL to redirect to if the task was not claimed successfully.
 java.lang.String getClaimTaskSuccessURL()
          Returns the URL to redirect to if the task was claimed successfully.
 java.lang.String getFireOutcomeErrorURL()
          Returns the URL to redirect to if the task outcome was not fired successfully.
 java.lang.String getFireOutcomeSuccessURL()
          Returns the URL to redirect to if the task outcome was fired successfully.
 java.lang.String getNewOwnerName()
          Returns the unique Persona name of the new task owner which should be set, or null if the task's ownership should be cleared.
 int getNewPriority()
          Returns the new task priority which should be set.
 java.util.List getOutcomeDescriptors()
          Returns the List of OucomeDescriptor objects which describe all the possible outcomes of the task.
 java.lang.String getOutcomeElementId()
          Returns the id of the workflow element corresponding to the outcome which should be fired.
 java.lang.String getProcessName()
          Returns the name of the workflow process that the task belongs to.
 java.lang.String getReleaseTaskErrorURL()
          Returns the URL to redirect to if the task was not released successfully.
 java.lang.String getReleaseTaskSuccessURL()
          Returns the URL to redirect to if the task was released successfully.
 java.lang.String getSegmentName()
          Returns the name of the workflow process segment that the task belongs to.
 java.lang.String getSetTaskOwnerErrorURL()
          Returns the URL to redirect to if the task owner was not set successfully.
 java.lang.String getSetTaskOwnerSuccessURL()
          Returns the URL to redirect to if the task owner was set successfully.
 java.lang.String getSetTaskPriorityErrorURL()
          Returns the URL to redirect to if the task priority was not set successfully.
 java.lang.String getSetTaskPrioritySuccessURL()
          Returns the URL to redirect to if the task priority was set successfully.
protected  java.lang.String getStringResource(java.lang.String pResource, java.util.Locale pLocale)
          Obtains a string resource for the given key.
 WorkflowTaskFormSubject getSubject()
          Returns the WorkflowTaskFormSubject item which can be used to access and modify properties of the workflow subject specified via the subjectId property.
 java.lang.String getSubjectClassName()
          Returns the name of the class to use when instantiating the object to be returned by the subject property.
 java.lang.String getSubjectId()
          Returns the repository id of the workflow subject corresponding to the task instance.
 MutableRepository getSubjectRepository()
          Returns the MutableRepository used to store workflow subjects.
 java.lang.String getSubjectType()
          Returns the name of the item descriptor describing workflow subjects.
 TaskDescriptor getTaskDescriptor()
          Returns the TaskDescriptor object which describes the task.
 java.lang.String getTaskElementId()
          Returns the id of the workflow element corresponding to the task.
 TaskInfo getTaskInfo()
          Returns the TaskInfo object corresponding to the task instance.
 boolean getUpdateSubjectOnSubmit()
          Returns true if the workflow subject should be updated when submit methods are executed, false otherwise.
protected  java.util.Locale getUserLocale(DynamoHttpServletRequest pRequest)
          Returns the locale associated with the request.
 WorkflowManager getWorkflowManager()
          Returns the WorkflowManager which provides access to the workflow system.
 WorkflowView getWorkflowView()
          Returns the WorkflowView on behalf of which the task is to be manipulated.
 boolean handleClaimTask(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse)
          Claims the task identified by the processName, segmentName, subjectId, and taskElementId properties, on behalf of the WorkflowView associated with this form.
 boolean handleFireOutcome(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse)
          Fires the task outcome identified by the processName, segmentName, subjectId, and outcomeElementId properties, on behalf of the WorkflowView associated with this form.
 boolean handleReleaseTask(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse)
          Releases the task identified by the processName, segmentName, subjectId, and taskElementId properties, on behalf of the WorkflowView associated with this form.
 boolean handleSetTaskOwner(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse)
          Sets the owner of the task identified by the processName, segmentName, subjectId, and taskElementId properties, on behalf of the WorkflowView associated with this form.
 boolean handleSetTaskPriority(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse)
          Sets the priority of the task identified by the processName, segmentName, subjectId, and taskElementId properties, on behalf of the WorkflowView associated with this form.
protected  void initializeSubject(WorkflowTaskFormSubject pSubject)
          Initializes the given WorkflowTaskFormSubject object.
protected  void postClaimTask(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse)
          This method is called by handleClaimTask just after the task is claimed.
protected  void postFireOutcome(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse)
          This method is called by handleFireOutcome just after the task outcome is fired.
protected  void postReleaseTask(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse)
          This method is called by handleReleaseTask just after the task is released.
protected  void postSetTaskOwner(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse)
          This method is called by handleSetTaskOwner just after the task's owner is set.
protected  void postSetTaskPriority(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse)
          This method is called by handleSetTaskPriority just after the task's priority is set.
protected  void preClaimTask(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse)
          This method is called by handleClaimTask just before the task is claimed.
protected  void preFireOutcome(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse)
          This method is called by handleFireOutcome just before the task outcome is fired.
protected  void preReleaseTask(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse)
          This method is called by handleReleaseTask just before the task is released.
protected  void preSetTaskOwner(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse)
          This method is called by handleSetTaskOwner just before the task's owner is set.
protected  void preSetTaskPriority(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse)
          This method is called by handleSetTaskPriority just before the task's priority is set.
protected  void releaseTask(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse)
          This method is called by handleReleaseTask to actually release the task.
 void setClaimTaskErrorURL(java.lang.String pURL)
          Sets the URL to redirect to if the task was not claimed successfully.
 void setClaimTaskSuccessURL(java.lang.String pURL)
          Sets the URL to redirect to if the task was claimed successfully.
 void setFireOutcome(java.lang.String pOutcomeElementId)
          This method is called prior to handleFireOutcome when the form is submitted.
 void setFireOutcomeErrorURL(java.lang.String pURL)
          Sets the URL to redirect to if the task outcome was not fired successfully.
 void setFireOutcomeSuccessURL(java.lang.String pURL)
          Sets the URL to redirect to if the task outcome was fired successfully.
 void setNewOwnerName(java.lang.String pNewOwnerName)
          Sets the unique Persona name of the new task owner which should be set.
 void setNewPriority(int pNewPriority)
          Sets the new task priority which should be set.
 void setOutcomeElementId(java.lang.String pOutcomeElementId)
          Sets the id of the workflow element corresponding to the outcome which should be fired.
 void setProcessName(java.lang.String pProcessName)
          Sets the name of the workflow process that the task belongs to.
 void setReleaseTaskErrorURL(java.lang.String pURL)
          Sets the URL to redirect to if the task was not released successfully.
 void setReleaseTaskSuccessURL(java.lang.String pURL)
          Sets the URL to redirect to if the task was released successfully.
 void setSegmentName(java.lang.String pSegmentName)
          Sets the name of the workflow process segment that the task belongs to.
 void setSetTaskOwnerErrorURL(java.lang.String pURL)
          Sets the URL to redirect to if the task owner was not set successfully.
 void setSetTaskOwnerSuccessURL(java.lang.String pURL)
          Sets the URL to redirect to if the task owner was set successfully.
 void setSetTaskPriorityErrorURL(java.lang.String pURL)
          Sets the URL to redirect to if the task priority was not set successfully.
 void setSetTaskPrioritySuccessURL(java.lang.String pURL)
          Sets the URL to redirect to if the task priority was set successfully.
 void setSubjectClassName(java.lang.String pSubjectClassName)
          Sets the name of the class to use when instantiating the object to be returned by the subject property.
 void setSubjectId(java.lang.String pSubjectId)
          Sets the repository id of the workflow subject corresponding to the task instance.
 void setSubjectRepository(MutableRepository pSubjectRepository)
          Sets the MutableRepository used to store workflow subjects.
 void setSubjectType(java.lang.String pSubjectType)
          Sets the name of the item descriptor describing workflow subjects.
 void setTaskElementId(java.lang.String pTaskElementId)
          Sets the id of the workflow element corresponding to the task.
protected  void setTaskOwner(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse)
          This method is called by handleSetTaskOwner to actually set the task's owner.
protected  void setTaskPriority(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse)
          This method is called by handleSetTaskPriority to actually set the task's priority.
 void setUpdateSubjectOnSubmit(boolean pUpdateSubjectOnSubmit)
          Sets the flag indicating whether the workflow subject should be updated when submit methods are executed.
 void setWorkflowManager(WorkflowManager pWorkflowManager)
          Sets the WorkflowManager which provides access to the workflow system.
 void setWorkflowView(WorkflowView pWorkflowView)
          Sets the WorkflowView on behalf of which the task is to be manipulated.
protected  void updateSubject(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse)
          This method is called by all the pre methods if the updateSubjectOnSubmit property is set to true.
 
Methods inherited from class atg.droplet.TransactionalFormHandler
afterSet, beforeSet, checkFormRedirect, commitTransaction, getTransactionDemarcation, getTransactionStatus, isEnsureTransaction, isRollbackTransaction, isRollbackTransactionOnUnhandledException, isTransactionMarkedAsRollback, setEnsureTransaction, setRollbackTransaction, setRollbackTransactionOnUnhandledException, setTransactionDemarcation
 
Methods inherited from class atg.droplet.GenericFormHandler
addFormException, addUncheckedFormException, createFormSubmissionMessage, getCancelURL, getCheckForValidSession, getFormError, getFormExceptions, getFormName, getMessagePort, getMessageSource, getMessageType, getPropertyExceptions, getSendMessages, getUncheckedFormExceptions, handleCancel, handleFormException, handleUncheckedFormException, hasUncheckedFormExceptions, isDeferForwardsAndRedirects, isRestorableForm, isUseForwards, isValidSession, redirectOrForward, resetFormExceptions, setCancelURL, setCheckForValidSession, setDeferForwardsAndRedirects, setFormName, setMessagePort, setMessageSource, setMessageType, setRestorableForm, setSendMessages, setUseForwards
 
Methods inherited from class atg.droplet.EmptyFormHandler
afterGet, beforeGet
 
Methods inherited from class atg.nucleus.GenericService
addLogListener, createAdminServlet, doStopService, getAbsoluteName, getAdminServlet, getLoggingForVlogging, getLogListenerCount, getLogListeners, getName, getNameContext, getNucleus, getRoot, getServiceConfiguration, getServiceInfo, 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, setLoggingDebug, setLoggingError, setLoggingInfo, setLoggingTrace, setLoggingWarning, setNucleus, setServiceInfo, startService, stopService
 
Methods inherited from class atg.nucleus.logging.VariableArgumentApplicationLoggingImpl
vlogDebug, vlogDebug, vlogDebug, vlogDebug, 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

Constructor Detail

WorkflowTaskFormHandler

public WorkflowTaskFormHandler()
Method Detail

getWorkflowManager

public WorkflowManager getWorkflowManager()
Returns the WorkflowManager which provides access to the workflow system.


setWorkflowManager

public void setWorkflowManager(WorkflowManager pWorkflowManager)
Sets the WorkflowManager which provides access to the workflow system.


getWorkflowView

public WorkflowView getWorkflowView()
Returns the WorkflowView on behalf of which the task is to be manipulated.


setWorkflowView

public void setWorkflowView(WorkflowView pWorkflowView)
Sets the WorkflowView on behalf of which the task is to be manipulated.


getSubjectRepository

public MutableRepository getSubjectRepository()
Returns the MutableRepository used to store workflow subjects.


setSubjectRepository

public void setSubjectRepository(MutableRepository pSubjectRepository)
Sets the MutableRepository used to store workflow subjects.


getSubjectType

public java.lang.String getSubjectType()
Returns the name of the item descriptor describing workflow subjects.


setSubjectType

public void setSubjectType(java.lang.String pSubjectType)
Sets the name of the item descriptor describing workflow subjects.


getProcessName

public java.lang.String getProcessName()
Returns the name of the workflow process that the task belongs to.


setProcessName

public void setProcessName(java.lang.String pProcessName)
Sets the name of the workflow process that the task belongs to.


getSegmentName

public java.lang.String getSegmentName()
Returns the name of the workflow process segment that the task belongs to.


setSegmentName

public void setSegmentName(java.lang.String pSegmentName)
Sets the name of the workflow process segment that the task belongs to.


getSubjectId

public java.lang.String getSubjectId()
Returns the repository id of the workflow subject corresponding to the task instance.


setSubjectId

public void setSubjectId(java.lang.String pSubjectId)
Sets the repository id of the workflow subject corresponding to the task instance.


getTaskElementId

public java.lang.String getTaskElementId()
Returns the id of the workflow element corresponding to the task.


setTaskElementId

public void setTaskElementId(java.lang.String pTaskElementId)
Sets the id of the workflow element corresponding to the task.


getTaskDescriptor

public TaskDescriptor getTaskDescriptor()
Returns the TaskDescriptor object which describes the task. Returns null if any of processName, segmentName, or taskElementId properties have not been set.


getOutcomeDescriptors

public java.util.List getOutcomeDescriptors()
Returns the List of OucomeDescriptor objects which describe all the possible outcomes of the task. Returns null if any of processName, segmentName, or taskElementId properties have not been set.


getTaskInfo

public TaskInfo getTaskInfo()
Returns the TaskInfo object corresponding to the task instance. Returns null if any of processName, segmentName, subjectId, or taskElementId properties have not been set.


getSubjectClassName

public java.lang.String getSubjectClassName()
Returns the name of the class to use when instantiating the object to be returned by the subject property. The default is "atg.workflow.servlet.WorkflowTaskFormSubject." If a different class name is specified, it must name a subclass of WorkflowTaskFormSubject.


setSubjectClassName

public void setSubjectClassName(java.lang.String pSubjectClassName)
Sets the name of the class to use when instantiating the object to be returned by the subject property.


getSubject

public WorkflowTaskFormSubject getSubject()
Returns the WorkflowTaskFormSubject item which can be used to access and modify properties of the workflow subject specified via the subjectId property. Returns null if the subjectId property has not been set.


getUpdateSubjectOnSubmit

public boolean getUpdateSubjectOnSubmit()
Returns true if the workflow subject should be updated when submit methods are executed, false otherwise.


setUpdateSubjectOnSubmit

public void setUpdateSubjectOnSubmit(boolean pUpdateSubjectOnSubmit)
Sets the flag indicating whether the workflow subject should be updated when submit methods are executed.


getNewPriority

public int getNewPriority()
Returns the new task priority which should be set.


setNewPriority

public void setNewPriority(int pNewPriority)
Sets the new task priority which should be set.


getNewOwnerName

public java.lang.String getNewOwnerName()
Returns the unique Persona name of the new task owner which should be set, or null if the task's ownership should be cleared.

See Also:
Persona.getName()

setNewOwnerName

public void setNewOwnerName(java.lang.String pNewOwnerName)
Sets the unique Persona name of the new task owner which should be set.

Note that one can obtain the Persona name corresponding to a given DirectoryPrincipal by calling UserDirectoryUserAuthority.getPersonaForPrincipal to obtain the Persona, then calling Persona.getName to find its name.

See Also:
Persona.getName(), UserDirectoryUserAuthority.getPersonaForPrincipal(java.security.Principal)

getOutcomeElementId

public java.lang.String getOutcomeElementId()
Returns the id of the workflow element corresponding to the outcome which should be fired.


setOutcomeElementId

public void setOutcomeElementId(java.lang.String pOutcomeElementId)
Sets the id of the workflow element corresponding to the outcome which should be fired.

See Also:
setFireOutcome(java.lang.String)

getSetTaskPrioritySuccessURL

public java.lang.String getSetTaskPrioritySuccessURL()
Returns the URL to redirect to if the task priority was set successfully.


setSetTaskPrioritySuccessURL

public void setSetTaskPrioritySuccessURL(java.lang.String pURL)
Sets the URL to redirect to if the task priority was set successfully.


getSetTaskPriorityErrorURL

public java.lang.String getSetTaskPriorityErrorURL()
Returns the URL to redirect to if the task priority was not set successfully.


setSetTaskPriorityErrorURL

public void setSetTaskPriorityErrorURL(java.lang.String pURL)
Sets the URL to redirect to if the task priority was not set successfully.


getSetTaskOwnerSuccessURL

public java.lang.String getSetTaskOwnerSuccessURL()
Returns the URL to redirect to if the task owner was set successfully.


setSetTaskOwnerSuccessURL

public void setSetTaskOwnerSuccessURL(java.lang.String pURL)
Sets the URL to redirect to if the task owner was set successfully.


getSetTaskOwnerErrorURL

public java.lang.String getSetTaskOwnerErrorURL()
Returns the URL to redirect to if the task owner was not set successfully.


setSetTaskOwnerErrorURL

public void setSetTaskOwnerErrorURL(java.lang.String pURL)
Sets the URL to redirect to if the task owner was not set successfully.


getClaimTaskSuccessURL

public java.lang.String getClaimTaskSuccessURL()
Returns the URL to redirect to if the task was claimed successfully.


setClaimTaskSuccessURL

public void setClaimTaskSuccessURL(java.lang.String pURL)
Sets the URL to redirect to if the task was claimed successfully.


getClaimTaskErrorURL

public java.lang.String getClaimTaskErrorURL()
Returns the URL to redirect to if the task was not claimed successfully.


setClaimTaskErrorURL

public void setClaimTaskErrorURL(java.lang.String pURL)
Sets the URL to redirect to if the task was not claimed successfully.


getReleaseTaskSuccessURL

public java.lang.String getReleaseTaskSuccessURL()
Returns the URL to redirect to if the task was released successfully.


setReleaseTaskSuccessURL

public void setReleaseTaskSuccessURL(java.lang.String pURL)
Sets the URL to redirect to if the task was released successfully.


getReleaseTaskErrorURL

public java.lang.String getReleaseTaskErrorURL()
Returns the URL to redirect to if the task was not released successfully.


setReleaseTaskErrorURL

public void setReleaseTaskErrorURL(java.lang.String pURL)
Sets the URL to redirect to if the task was not released successfully.


getFireOutcomeSuccessURL

public java.lang.String getFireOutcomeSuccessURL()
Returns the URL to redirect to if the task outcome was fired successfully.


setFireOutcomeSuccessURL

public void setFireOutcomeSuccessURL(java.lang.String pURL)
Sets the URL to redirect to if the task outcome was fired successfully.


getFireOutcomeErrorURL

public java.lang.String getFireOutcomeErrorURL()
Returns the URL to redirect to if the task outcome was not fired successfully.


setFireOutcomeErrorURL

public void setFireOutcomeErrorURL(java.lang.String pURL)
Sets the URL to redirect to if the task outcome was not fired successfully.


handleSetTaskPriority

public boolean handleSetTaskPriority(DynamoHttpServletRequest pRequest,
                                     DynamoHttpServletResponse pResponse)
                              throws javax.servlet.ServletException,
                                     java.io.IOException
Sets the priority of the task identified by the processName, segmentName, subjectId, and taskElementId properties, on behalf of the WorkflowView associated with this form. Priority is set to the value of the newPriority property; if the property has not been explicitly set, the priority is set to 0.

If any errors occur, adds them to the form, and optionally redirects to the value of the property setTaskPriorityErrorURL. Otherwise, optionally redirects to setTaskPrioritySuccessURL.

Throws:
javax.servlet.ServletException
java.io.IOException

setTaskPriority

protected void setTaskPriority(DynamoHttpServletRequest pRequest,
                               DynamoHttpServletResponse pResponse)
                        throws javax.servlet.ServletException,
                               java.io.IOException
This method is called by handleSetTaskPriority to actually set the task's priority. If any errors are encountered, the transaction is marked for rollback so as to rollback any repository changes made in preSetTaskPriority.

Throws:
javax.servlet.ServletException
java.io.IOException

preSetTaskPriority

protected void preSetTaskPriority(DynamoHttpServletRequest pRequest,
                                  DynamoHttpServletResponse pResponse)
                           throws javax.servlet.ServletException,
                                  java.io.IOException
This method is called by handleSetTaskPriority just before the task's priority is set. The default implementation checks to see if the updateSubjectOnSubmit property is set to true, and if so, calls updateSubject.

Throws:
javax.servlet.ServletException
java.io.IOException

postSetTaskPriority

protected void postSetTaskPriority(DynamoHttpServletRequest pRequest,
                                   DynamoHttpServletResponse pResponse)
                            throws javax.servlet.ServletException,
                                   java.io.IOException
This method is called by handleSetTaskPriority just after the task's priority is set. The default implementation does nothing. When overriding this method, subclasses should mark the transaction for rollback in case of a fatal error, so as to rollback any repository changes made in preSetTaskPriority and setTaskPriority.

Throws:
javax.servlet.ServletException
java.io.IOException

handleSetTaskOwner

public boolean handleSetTaskOwner(DynamoHttpServletRequest pRequest,
                                  DynamoHttpServletResponse pResponse)
                           throws javax.servlet.ServletException,
                                  java.io.IOException
Sets the owner of the task identified by the processName, segmentName, subjectId, and taskElementId properties, on behalf of the WorkflowView associated with this form. The owner is set to the DirectoryPrincipal value corresponding to the newOwnerName property; if the property has not been explicitly set, the task's ownership is cleared.

If any errors occur, adds them to the form, and optionally redirects to the value of the property setTaskOwnerErrorURL. Otherwise, optionally redirects to setTaskOwnerSuccessURL.

Throws:
javax.servlet.ServletException
java.io.IOException

setTaskOwner

protected void setTaskOwner(DynamoHttpServletRequest pRequest,
                            DynamoHttpServletResponse pResponse)
                     throws javax.servlet.ServletException,
                            java.io.IOException
This method is called by handleSetTaskOwner to actually set the task's owner. If any errors are encountered, the transaction is marked for rollback so as to rollback any repository changes made in preSetTaskOwner.

Throws:
javax.servlet.ServletException
java.io.IOException

preSetTaskOwner

protected void preSetTaskOwner(DynamoHttpServletRequest pRequest,
                               DynamoHttpServletResponse pResponse)
                        throws javax.servlet.ServletException,
                               java.io.IOException
This method is called by handleSetTaskOwner just before the task's owner is set. The default implementation checks to see if the updateSubjectOnSubmit property is set to true, and if so, calls updateSubject.

Throws:
javax.servlet.ServletException
java.io.IOException

postSetTaskOwner

protected void postSetTaskOwner(DynamoHttpServletRequest pRequest,
                                DynamoHttpServletResponse pResponse)
                         throws javax.servlet.ServletException,
                                java.io.IOException
This method is called by handleSetTaskOwner just after the task's owner is set. The default implementation does nothing. When overriding this method, subclasses should mark the transaction for rollback in case of a fatal error, so as to rollback any repository changes made in preSetTaskOwner and setTaskOwner.

Throws:
javax.servlet.ServletException
java.io.IOException

handleClaimTask

public boolean handleClaimTask(DynamoHttpServletRequest pRequest,
                               DynamoHttpServletResponse pResponse)
                        throws javax.servlet.ServletException,
                               java.io.IOException
Claims the task identified by the processName, segmentName, subjectId, and taskElementId properties, on behalf of the WorkflowView associated with this form.

If any errors occur, adds them to the form, and optionally redirects to the value of the property claimTaskErrorURL. Otherwise, optionally redirects to claimTaskSuccessURL.

Throws:
javax.servlet.ServletException
java.io.IOException

claimTask

protected void claimTask(DynamoHttpServletRequest pRequest,
                         DynamoHttpServletResponse pResponse)
                  throws javax.servlet.ServletException,
                         java.io.IOException
This method is called by handleClaimTask to actually claim the task. If any errors are encountered, the transaction is marked for rollback so as to rollback any repository changes made in preClaimTask.

Throws:
javax.servlet.ServletException
java.io.IOException

preClaimTask

protected void preClaimTask(DynamoHttpServletRequest pRequest,
                            DynamoHttpServletResponse pResponse)
                     throws javax.servlet.ServletException,
                            java.io.IOException
This method is called by handleClaimTask just before the task is claimed. The default implementation checks to see if the updateSubjectOnSubmit property is set to true, and if so, calls updateSubject.

Throws:
javax.servlet.ServletException
java.io.IOException

postClaimTask

protected void postClaimTask(DynamoHttpServletRequest pRequest,
                             DynamoHttpServletResponse pResponse)
                      throws javax.servlet.ServletException,
                             java.io.IOException
This method is called by handleClaimTask just after the task is claimed. The default implementation does nothing. When overriding this method, subclasses should mark the transaction for rollback in case of a fatal error, so as to rollback any repository changes made in preClaimTask and claimTask.

Throws:
javax.servlet.ServletException
java.io.IOException

handleReleaseTask

public boolean handleReleaseTask(DynamoHttpServletRequest pRequest,
                                 DynamoHttpServletResponse pResponse)
                          throws javax.servlet.ServletException,
                                 java.io.IOException
Releases the task identified by the processName, segmentName, subjectId, and taskElementId properties, on behalf of the WorkflowView associated with this form.

If any errors occur, adds them to the form, and optionally redirects to the value of the property releaseTaskErrorURL. Otherwise, optionally redirects to releaseTaskSuccessURL.

Throws:
javax.servlet.ServletException
java.io.IOException

releaseTask

protected void releaseTask(DynamoHttpServletRequest pRequest,
                           DynamoHttpServletResponse pResponse)
                    throws javax.servlet.ServletException,
                           java.io.IOException
This method is called by handleReleaseTask to actually release the task. If any errors are encountered, the transaction is marked for rollback so as to rollback any repository changes made in preReleaseTask.

Throws:
javax.servlet.ServletException
java.io.IOException

preReleaseTask

protected void preReleaseTask(DynamoHttpServletRequest pRequest,
                              DynamoHttpServletResponse pResponse)
                       throws javax.servlet.ServletException,
                              java.io.IOException
This method is called by handleReleaseTask just before the task is released. The default implementation checks to see if the updateSubjectOnSubmit property is set to true, and if so, calls updateSubject.

Throws:
javax.servlet.ServletException
java.io.IOException

postReleaseTask

protected void postReleaseTask(DynamoHttpServletRequest pRequest,
                               DynamoHttpServletResponse pResponse)
                        throws javax.servlet.ServletException,
                               java.io.IOException
This method is called by handleReleaseTask just after the task is released. The default implementation does nothing. When overriding this method, subclasses should mark the transaction for rollback in case of a fatal error, so as to rollback any repository changes made in preReleaseTask and releaseTask.

Throws:
javax.servlet.ServletException
java.io.IOException

setFireOutcome

public void setFireOutcome(java.lang.String pOutcomeElementId)
This method is called prior to handleFireOutcome when the form is submitted. Because a task typically has multiple possible outcomes, a single form with multiple submit buttons is typically used to fire those outcomes. The outcomeElementId property thus cannot be set via a hidden tag, but must instead be passed in as the submitvalue. For example, here is how one might display multiple submit buttons using a ForEach droplet:
<dsp:droplet name="/atg/dynamo/droplet/ForEach">
  <dsp:param name="array" bean="WorkflowTaskFormHandler.outcomeDescriptors"/>
  <dsp:oparam name="output">
    <dsp:getvalueof id="locale" bean="/OriginatingRequest.requestLocale.locale" 
                    idtype="java.util.Locale">
      <dsp:getvalueof id="outcomeDescriptor" param="element" 
                      idtype="atg.workflow.OutcomeDescriptor">
        <dsp:input type="submit" bean="WorkflowTaskFormHandler.fireOutcome" 
                   value="<%= outcomeDescriptor.getDisplayName(locale) %>"
                   submitvalue="<%= outcomeDescriptor.getOutcomeElementId() %>"
                   name="<%= outcomeDescriptor.getName() %>"/>
      </dsp:getvalueof>
    </dsp:getvalueof>
  </dsp:oparam>
</dsp:droplet>

Parameters:
pOutcomeElementId - the id of the workflow element corresponding to the outcome which should be fired
See Also:
setOutcomeElementId(java.lang.String)

handleFireOutcome

public boolean handleFireOutcome(DynamoHttpServletRequest pRequest,
                                 DynamoHttpServletResponse pResponse)
                          throws javax.servlet.ServletException,
                                 java.io.IOException
Fires the task outcome identified by the processName, segmentName, subjectId, and outcomeElementId properties, on behalf of the WorkflowView associated with this form.

If any errors occur, adds them to the form, and optionally redirects to the value of the property fireOutcomeErrorURL. Otherwise, optionally redirects to fireOutcomeSuccessURL.

Throws:
javax.servlet.ServletException
java.io.IOException

fireOutcome

protected void fireOutcome(DynamoHttpServletRequest pRequest,
                           DynamoHttpServletResponse pResponse)
                    throws javax.servlet.ServletException,
                           java.io.IOException
This method is called by handleFireOutcome to actually fire the task outcome. If any errors are encountered, the transaction is marked for rollback so as to rollback any repository changes made in preFireOutcome.

Throws:
javax.servlet.ServletException
java.io.IOException

preFireOutcome

protected void preFireOutcome(DynamoHttpServletRequest pRequest,
                              DynamoHttpServletResponse pResponse)
                       throws javax.servlet.ServletException,
                              java.io.IOException
This method is called by handleFireOutcome just before the task outcome is fired. The default implementation checks to see if the updateSubjectOnSubmit property is set to true, and if so, calls updateSubject.

Throws:
javax.servlet.ServletException
java.io.IOException

postFireOutcome

protected void postFireOutcome(DynamoHttpServletRequest pRequest,
                               DynamoHttpServletResponse pResponse)
                        throws javax.servlet.ServletException,
                               java.io.IOException
This method is called by handleFireOutcome just after the task outcome is fired. The default implementation does nothing. When overriding this method, subclasses should mark the transaction for rollback in case of a fatal error, so as to rollback any repository changes made in preFireOutcome and fireOutcome.

Throws:
javax.servlet.ServletException
java.io.IOException

createSubject

protected WorkflowTaskFormSubject createSubject()
                                         throws java.lang.ClassNotFoundException,
                                                java.lang.InstantiationException,
                                                java.lang.IllegalAccessException
Creates a WorkflowTaskFormSubject object to be returned as the value of the subject property, by instantiating an object of the type specified via the subjectClassName property.

Throws:
java.lang.ClassNotFoundException - if the subject class cannot be found
java.lang.InstantiationException - if the instantiation fails
java.lang.IllegalAccessException - if the class or initializer is not accessible

initializeSubject

protected void initializeSubject(WorkflowTaskFormSubject pSubject)
Initializes the given WorkflowTaskFormSubject object. Specifically, sets the subject's repository, itemDescriptorName, and repositoryId properties to the values specified via this form's subjectRepository, subjectType, and subjectId properties, respectively. Also sets the subject's formHandler property to this form handler.


updateSubject

protected void updateSubject(DynamoHttpServletRequest pRequest,
                             DynamoHttpServletResponse pResponse)
                      throws javax.servlet.ServletException,
                             java.io.IOException
This method is called by all the pre methods if the updateSubjectOnSubmit property is set to true. It updates the subject specified via the subjectId property, by calling handleUpdate on the corresponding WorkflowTaskFormSubject object. If any errors are encountered, they are copied over to this form handler, and the transaction is marked for rollback.

Throws:
javax.servlet.ServletException
java.io.IOException
See Also:
WorkflowTaskFormSubject

addFormException

protected void addFormException(java.lang.String pErrorKey,
                                DynamoHttpServletRequest pRequest)
Adds a new exception to the list of form exceptions.


addFormException

protected void addFormException(java.lang.String pErrorKey,
                                java.lang.Throwable pException,
                                DynamoHttpServletRequest pRequest)
Adds a new exception to the list of form exceptions.


addFormException

protected void addFormException(java.lang.String pErrorKey,
                                java.lang.Object[] pArgs,
                                DynamoHttpServletRequest pRequest)
Adds a new exception to the list of form exceptions.


addFormException

protected void addFormException(java.lang.String pErrorKey,
                                java.lang.Object[] pArgs,
                                java.lang.Throwable pException,
                                DynamoHttpServletRequest pRequest)
Adds a new exception to the list of form exceptions.


getUserLocale

protected java.util.Locale getUserLocale(DynamoHttpServletRequest pRequest)
Returns the locale associated with the request.


getStringResource

protected java.lang.String getStringResource(java.lang.String pResource,
                                             java.util.Locale pLocale)
Obtains a string resource for the given key.


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