public class WorkflowTaskFormHandler extends TransactionalFormHandler
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:
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:
newPriority
property
newOwnerName
property
outcomeElementId
property
The following properties of the WorkflowTaskFormHandler will typically be set in the properties file for this component:
subject
property; the default is
"atg.workflow.servlet.WorkflowTaskFormSubject" (see below for
details)
The following properties will typically be set in the jsp page:
setTaskPriority
submit method
setTaskOwner
submit method
fireOutcome
submit method
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:
<dsp:textarea bean="WorkflowTaskFormHandler.subject.value.comment" cols="35" rows="5" default=""></dsp:textarea>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.
WorkflowTaskFormSubject
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
CLASS_VERSION
Class version string
|
PARAM_DEFER_FORWARD_OR_REDIRECT, PARAM_USE_FORWARDS
SERVICE_INFO_KEY
DEFAULT_LOG_TRACE_STATUS
DEFAULT_LOG_DEBUG_STATUS, DEFAULT_LOG_ERROR_STATUS, DEFAULT_LOG_INFO_STATUS, DEFAULT_LOG_WARNING_STATUS
Constructor and Description |
---|
WorkflowTaskFormHandler() |
Modifier and Type | Method and Description |
---|---|
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. |
afterSet, beforeSet, checkFormRedirect, commitTransaction, getTransactionDemarcation, getTransactionStatus, isEnsureTransaction, isRollbackTransaction, isRollbackTransactionOnUnhandledException, isTransactionMarkedAsRollback, setEnsureTransaction, setRollbackTransaction, setRollbackTransactionOnUnhandledException, setTransactionDemarcation
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
afterGet, beforeGet
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
vlogDebug, vlogDebug, vlogDebug, vlogDebug, vlogDebugTrace, vlogError, vlogError, vlogError, vlogError, vlogInfo, vlogInfo, vlogInfo, vlogInfo, vlogTrace, vlogTrace, vlogTrace, vlogTrace, vlogWarning, vlogWarning, vlogWarning, vlogWarning
public WorkflowManager getWorkflowManager()
public void setWorkflowManager(WorkflowManager pWorkflowManager)
public WorkflowView getWorkflowView()
public void setWorkflowView(WorkflowView pWorkflowView)
public MutableRepository getSubjectRepository()
public void setSubjectRepository(MutableRepository pSubjectRepository)
public java.lang.String getSubjectType()
public void setSubjectType(java.lang.String pSubjectType)
public java.lang.String getProcessName()
public void setProcessName(java.lang.String pProcessName)
public java.lang.String getSegmentName()
public void setSegmentName(java.lang.String pSegmentName)
public java.lang.String getSubjectId()
public void setSubjectId(java.lang.String pSubjectId)
public java.lang.String getTaskElementId()
public void setTaskElementId(java.lang.String pTaskElementId)
public TaskDescriptor getTaskDescriptor()
processName
,
segmentName
, or taskElementId
properties have not been set.public java.util.List getOutcomeDescriptors()
processName
, segmentName
, or
taskElementId
properties have not been set.public TaskInfo getTaskInfo()
processName
,
segmentName
, subjectId
, or
taskElementId
properties have not been set.public java.lang.String getSubjectClassName()
subject
property. The
default is "atg.workflow.servlet.WorkflowTaskFormSubject." If a
different class name is specified, it must name a subclass of
WorkflowTaskFormSubject.public void setSubjectClassName(java.lang.String pSubjectClassName)
subject
property.public WorkflowTaskFormSubject getSubject()
subjectId
property. Returns null if the
subjectId
property has not been set.public boolean getUpdateSubjectOnSubmit()
public void setUpdateSubjectOnSubmit(boolean pUpdateSubjectOnSubmit)
public int getNewPriority()
public void setNewPriority(int pNewPriority)
public java.lang.String getNewOwnerName()
Persona.getName()
public void setNewOwnerName(java.lang.String pNewOwnerName)
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.
public java.lang.String getOutcomeElementId()
public void setOutcomeElementId(java.lang.String pOutcomeElementId)
setFireOutcome(java.lang.String)
public java.lang.String getSetTaskPrioritySuccessURL()
public void setSetTaskPrioritySuccessURL(java.lang.String pURL)
public java.lang.String getSetTaskPriorityErrorURL()
public void setSetTaskPriorityErrorURL(java.lang.String pURL)
public java.lang.String getSetTaskOwnerSuccessURL()
public void setSetTaskOwnerSuccessURL(java.lang.String pURL)
public java.lang.String getSetTaskOwnerErrorURL()
public void setSetTaskOwnerErrorURL(java.lang.String pURL)
public java.lang.String getClaimTaskSuccessURL()
public void setClaimTaskSuccessURL(java.lang.String pURL)
public java.lang.String getClaimTaskErrorURL()
public void setClaimTaskErrorURL(java.lang.String pURL)
public java.lang.String getReleaseTaskSuccessURL()
public void setReleaseTaskSuccessURL(java.lang.String pURL)
public java.lang.String getReleaseTaskErrorURL()
public void setReleaseTaskErrorURL(java.lang.String pURL)
public java.lang.String getFireOutcomeSuccessURL()
public void setFireOutcomeSuccessURL(java.lang.String pURL)
public java.lang.String getFireOutcomeErrorURL()
public void setFireOutcomeErrorURL(java.lang.String pURL)
public boolean handleSetTaskPriority(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse) throws javax.servlet.ServletException, java.io.IOException
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
.
javax.servlet.ServletException
java.io.IOException
protected void setTaskPriority(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse) throws javax.servlet.ServletException, java.io.IOException
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
.javax.servlet.ServletException
java.io.IOException
protected void preSetTaskPriority(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse) throws javax.servlet.ServletException, java.io.IOException
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
.javax.servlet.ServletException
java.io.IOException
protected void postSetTaskPriority(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse) throws javax.servlet.ServletException, java.io.IOException
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
.javax.servlet.ServletException
java.io.IOException
public boolean handleSetTaskOwner(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse) throws javax.servlet.ServletException, java.io.IOException
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
.
javax.servlet.ServletException
java.io.IOException
protected void setTaskOwner(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse) throws javax.servlet.ServletException, java.io.IOException
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
.javax.servlet.ServletException
java.io.IOException
protected void preSetTaskOwner(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse) throws javax.servlet.ServletException, java.io.IOException
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
.javax.servlet.ServletException
java.io.IOException
protected void postSetTaskOwner(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse) throws javax.servlet.ServletException, java.io.IOException
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
.javax.servlet.ServletException
java.io.IOException
public boolean handleClaimTask(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse) throws javax.servlet.ServletException, java.io.IOException
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
.
javax.servlet.ServletException
java.io.IOException
protected void claimTask(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse) throws javax.servlet.ServletException, java.io.IOException
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
.javax.servlet.ServletException
java.io.IOException
protected void preClaimTask(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse) throws javax.servlet.ServletException, java.io.IOException
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
.javax.servlet.ServletException
java.io.IOException
protected void postClaimTask(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse) throws javax.servlet.ServletException, java.io.IOException
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
.javax.servlet.ServletException
java.io.IOException
public boolean handleReleaseTask(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse) throws javax.servlet.ServletException, java.io.IOException
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
.
javax.servlet.ServletException
java.io.IOException
protected void releaseTask(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse) throws javax.servlet.ServletException, java.io.IOException
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
.javax.servlet.ServletException
java.io.IOException
protected void preReleaseTask(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse) throws javax.servlet.ServletException, java.io.IOException
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
.javax.servlet.ServletException
java.io.IOException
protected void postReleaseTask(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse) throws javax.servlet.ServletException, java.io.IOException
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
.javax.servlet.ServletException
java.io.IOException
public void setFireOutcome(java.lang.String pOutcomeElementId)
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>
pOutcomeElementId
- the id of the workflow element
corresponding to the outcome which should be firedsetOutcomeElementId(java.lang.String)
public boolean handleFireOutcome(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse) throws javax.servlet.ServletException, java.io.IOException
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
.
javax.servlet.ServletException
java.io.IOException
protected void fireOutcome(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse) throws javax.servlet.ServletException, java.io.IOException
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
.javax.servlet.ServletException
java.io.IOException
protected void preFireOutcome(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse) throws javax.servlet.ServletException, java.io.IOException
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
.javax.servlet.ServletException
java.io.IOException
protected void postFireOutcome(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse) throws javax.servlet.ServletException, java.io.IOException
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
.javax.servlet.ServletException
java.io.IOException
protected WorkflowTaskFormSubject createSubject() throws java.lang.ClassNotFoundException, java.lang.InstantiationException, java.lang.IllegalAccessException
subject
property, by instantiating an
object of the type specified via the
subjectClassName
property.java.lang.ClassNotFoundException
- if the subject class cannot be
foundjava.lang.InstantiationException
- if the instantiation failsjava.lang.IllegalAccessException
- if the class or initializer is
not accessibleprotected void initializeSubject(WorkflowTaskFormSubject pSubject)
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.protected void updateSubject(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse) throws javax.servlet.ServletException, java.io.IOException
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.javax.servlet.ServletException
java.io.IOException
WorkflowTaskFormSubject
protected void addFormException(java.lang.String pErrorKey, DynamoHttpServletRequest pRequest)
protected void addFormException(java.lang.String pErrorKey, java.lang.Throwable pException, DynamoHttpServletRequest pRequest)
protected void addFormException(java.lang.String pErrorKey, java.lang.Object[] pArgs, DynamoHttpServletRequest pRequest)
protected void addFormException(java.lang.String pErrorKey, java.lang.Object[] pArgs, java.lang.Throwable pException, DynamoHttpServletRequest pRequest)
protected java.util.Locale getUserLocale(DynamoHttpServletRequest pRequest)
protected java.lang.String getStringResource(java.lang.String pResource, java.util.Locale pLocale)
public void doStartService() throws ServiceException
doStartService
in class GenericService
ServiceException
- if the service had a problem starting
up