Most workflow tasks have several possible outcomes. Typically, a single form with multiple submit buttons is used to fire one of those outcomes. In these situations, the outcomeElementId property cannot be set via a hidden tag, since each submit button needs to specify its own outcome element ID.

Instead, the outcome element ID must be passed in as the submit value. For example, here is how you might display multiple submit buttons using a ForEach servlet bean:

<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"
      <dsp:getvalueof id="outcomeDescriptor" param="element"
        <dsp:input type="submit" bean="WorkflowTaskFormHandler.fireOutcome"
                   value="<%= outcomeDescriptor.getDisplayName(locale) %>"
                   submitvalue="<%= outcomeDescriptor.getOutcomeElementId() %>"
                   name="<%= outcomeDescriptor.getName() %>"/>

To support this functionality, the WorkflowTaskFormHandler class defines a setFireOutcome method, which is called immediately before handleFireOutcome when the form is submitted. This method simply sets the outcomeElementId property using the submitted value.

loading table of contents...