Developing user interface artifacts
Every screen flow needs a starting point from which it can be triggered. The user interface components that you develop and their functions enable the screen flow to be triggered and processed. Independent of the type of user interface artifact you develop, it must send and receive JSR-286 events to enable a screen flow. Therefore, you must implement or reuse JSR-286 compliant portlets that send and receive such events.
- The Passenger information portlet portlet1 must be able to receive an event with the QName e0 and to send an event with the QName e1.
- The Calendar portlet portlet2 must be able to receive an event with the QName e1 and to send an event with the QName e2.
To enable the Passenger information portlet portlet1 to receive and send the mentioned events, you need to do the following two things:
- Specify the events in the portlet.xml file of the portlet.
<portlet id="portlet1">
...
<supported-processing-event>
<qname>e0</qname>
</supported-processing-event>
<supported-publishing-event>
<qname>e1</qname>
</supported-publishing-event>
</portlet>
<event-definition>
<qname>e0</qname>
<value-type>java.lang.String</value-type>
</event-definition>
<event-definition>
<qname>e1</qname>
<value-type>java.lang.String</value-type>
</event-definition>
- Include code in the portlet that can handle an incoming event and another code that can send an event.
@Override
public void processAction(ActionRequest request, ActionResponse response)
throws PortletException, IOException {
// ...
response.setEvent(new QName("e1", "xyz"), new String());
}
@Override
public void processEvent(EventRequest request, EventResponse response)
throws PortletException, IOException {
final Event event = request.getEvent();
// ...
Make similar changes to the Calendar portlet portlet 2.
<portlet id="portlet2">
...
<supported-processing-event>
<qname>e1</qname>
</supported-processing-event>
<supported-publishing-event>
<qname>e2</qname>
</supported-publishing-event>
</portlet>
<event-definition>
<qname>e1</qname>
<value-type>java.lang.String</value-type>
</event-definition>
<event-definition>
<qname>e2</qname>
<value-type>java.lang.String</value-type>
</event-definition>
@Override
public void processAction(ActionRequest request, ActionResponse response)
throws PortletException, IOException {
// ...
response.setEvent(new QName("e2", "xyz"), new String());
}
@Override
public void processEvent(EventRequest request, EventResponse response)
throws PortletException, IOException {
final Event event = request.getEvent();
// ...
If you want to integrate forms such as passenger information form or widgets such as calendar, you can use such a portlet as a wrapper for these artifacts. For more information about developing portlets, go to Developing portlets in the WebSphere® Portal Version 8.0 product documentation.
- One type of DIIP triggers a new dialog instance by sending a well-defined start-event.
- The other type of DIIP triggers a new dialog that is based on the fact that a specific portlet emits a specific custom event.
With the Screen Flow Manager, different teams or even third-party vendors can develop different types of user interface (UI) artifacts. These artifacts are usually portlets, but can also be widgets or forms. For more details, go to iWidgets Development in the IBM® Rational® Application Developer documentation.