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"
                    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>

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.


Copyright © 1997, 2012 Oracle and/or its affiliates. All rights reserved. Legal Notices