Creating JSP files for processing user input

Why and when to perform this task

User input fields often require additional information to enable users to understand the purpose of these fields. You can use user-defined JavaServer Pages (JSP) files to provide additional information about message parts in the standard Web client. A typical user-defined JSP file for displaying user input data can provide a detailed description for each type of input field including entry fields, check boxes, and radio buttons. General information about the process or the activity to which the input data is related can also be displayed.

Steps for this task

  1. Make the BusinessProcess bean available to the JSP file.
    BusinessProcessService process = MessageUtilities.getBusinessProcessService(request);
    You can use the BusinessProcessService interface to develop applications that work with both the remote and the local object of the bean.
  2. Display additional information about the process or activity.
    The following code snippet is part of a user-defined JSP file that uses information about the current activity to display the activity output message. Depending on the state of the activity, the JSP file displays the information in different ways:
    • When the activity is in the ready state, general text about the purpose of the activity is displayed.
    • When the activity is claimed, two radio buttons that correspond to true and false, respectively, are also displayed.
    • After the activity finishes, the chosen option is presented as text.
    The highlighted text shows the lines of code that provide this functionality:
    <%
    String aiid = request.getParameter("WF_AIID");
    BusinessProcessService process = MessageUtilities.getBusinessProcessService(request);
    ActivityInstanceData activity = process.getActivityInstance(aiid);
    %>
    <p>
          A user has placed a stock order with a total estimated purchase price 
          of more than $100000.
    </p>
    <%}if(activity.getExecutionState() == ActivityInstanceData.STATE_READY){%>
    <p>
          This order must be approved. 
    </p>
    <%}if(activity.getExecutionState() == ActivityInstanceData.STATE_CLAIMED){%>
    <p>
    	This order must be approved. What do you want to do?
    	<label> 
    		<input type="radio" name="Approved" value="true">
    		Approve the order.
    	</label>
    	<label> 
    		<input type="radio" name="Approved" value="false" checked>
    		Reject the order.
    	</label>
    </p>
    <%}if(activity.getExecutionState() == ActivityInstanceData.STATE_FINISHED){>
    		if (outMsg.getBooleanPart("approved")){%>
    <p>
          This order has been approved.
    </p>
    <%      } else {%>
    <p>
          This order has not been approved.
    </p>
    <%      }
      } %>

What to do next

Create a message-mapping JSP file for each user-defined JSP file that processes user input.

Related concepts
Message-mapping JSP files



Searchable topic ID:   t7jspinput
Last updated: Jun 21, 2007 8:07:48 PM CDT    WebSphere Business Integration Server Foundation, Version 5.0.2
http://publib.boulder.ibm.com/infocenter/wasinfo/index.jsp?topic=/com.ibm.wasee.doc/info/ee/wfclient/tasks/t7jspinput.html

Library | Support | Terms of Use | Feedback