Add data access (in the form of business process messages) to the
Page Data view for process initiation and task processing portlets.
After creating business process portlets and importing business process
message classes into a separate project, you can incorporate input and output
messages for process initiation and task processing into the portlets.
To incorporate business process messages into business process portlets,
follow these steps
- With the appropriate portlet page (JSP file) open, select from the Page Data view pop up menu. The Business
Process Messages wizard will open.
- Specify whether the message will be used to initiate a business
process, or handle a task in the business process. Then, Browse to
locate the message schema file (WSDL document) that contains the desired business
process message. Click Next.
- The next page displays the defined port types, the operations inside
each port type, and, finally, input/output messages for each operation. You
can select any of the following data:
- A message
- Two messages (input and output) defined for the same operation. Two
Page Data nodes are created.
- An operation. Page Data node(s) are created for each message defined
for the operation.
For example, in the figure below, the TravelRequestProcessStaff process
has two operations defined (ApproveRequest and BookFlight), and each operation
has an input and an output message. The input message for the ApproveRequest
operation is selected. Details of that message are displayed in the tree to
the right.

- After making selections, click Finish. The wizard generates the necessary codebehind methods and Javadoc
annotations based on the schema information, by referencing the WSDL file
associated with the selected message. You must ensure that the WSDL file is
not moved or deleted after the message page data has been created, because
the reference would become invalid, and the message page data will not be
properly visualized.
- If the input message (for process initiation) or the output message
(for task processing) includes complex types (in the example below, FlightReservation and Requestor),
they must be initialized in the getter method generated in the page code.
Select Edit Page Code from the portlet JSP file's pop-up
menu, and type the initialization code in the corresponding getter method
for the message. For example, the following highlighted code must
be added:
public Object getTravelRequestInput() {
if (travelRequestInput == null) {
travelRequestInput = getSessionScope().get(
ProcessInitiationHelper.PROCESS_INPUT_MESSAGE);
((Map)travelRequestInput).put("Requestor", new Employee());
((Map)travelRequestInput).put("FlightReservation", new FlightReservation());
}
return travelRequestInput;
}
Note: This is not required for task processing input messages,
as they are already initialized.
The message schema is displayed in the Page Data view, and is ready
to be bound to a Face user interface component.
