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 class atg.workflow.servlet.WorkflowTaskFormSubject (or a subclass specified via the subjectClassName property). WorkflowTaskFormSubject is a subclass of atg.repository.RepositoryFormHandler and, like its parent class, exposes the subject’s properties via a value dictionary. Using the subject property, you can set workflow 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.

For maximum flexibility, the WorkflowTaskFormHandler class can also be overridden to perform operations before and after the work done by the submit methods. Each submit method has a pair of corresponding pre and post operations. Thus the following protected methods can be overridden:

In the default implementation, each pre method checks to see if the updateSubjectOnSubmit property is set to true, and if so, updates the subject by calling handleUpdate on the WorkflowTaskFormSubject object. The post methods do nothing by default.