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 default interface provided by Business Process Choreographer
Explorer. 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
- Make the BusinessProcess bean available to the JSP file.
BusinessFlowManagerService process = MessageUtilities.getBusinessFlowManagerService(request);
You
can use the BusinessFlowManagerService interface to develop applications that
work with both the remote and the local object of the bean.
- 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");
BusinessFlowManagerService process = MessageUtilities.getBusinessFlowManagerService(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>
<% }
} %>
Integrate the JSP files in a process model.