Integrating JSF Applications

The interactive application type JSF Application provides the possibility to integrate JSF panels implemented activities to be executed in the Infinity Process Platform Workflow Execution Perspective.

There are limitations when using JSF based backing beans. Refer to section Limitation on Using JSF Based Backing Beans for details and for a workaround to bypass these JSF based limitations.

Creating a JSF Application

To specify a JSF application in the Process Workbench:

Creating a JSF Application
Figure: Creating a JSF Application

Please refer to the chapter Specifying Applications for general questions about working with applications in the Process Workbench.

Setting the Properties

Double-click the application to open its properties dialog. On the right side of the panel click Interactive > JSF Application. Now set the properties for your JSF application:

Setting the JSF Applications Properties
Figure: Setting the JSF Applications Properties

URL

This property is the URL of the JSF page as generated based on your XML layout specification. The URL is specified relative to the Web context and depending on the faces servlet, which leads to the following base URL structure:

http://host:port/webcontext/faces

That means, that if you would specify a URL /xhtml/test.xhtml in the JSF application properties dialog, the resource will be expected to be located at the following URL:

http://host:port/webcontext/faces/xhtml/test.xhtml

Managed Bean Name

The name of the managed bean to be used for this JSF page, as it can be defined in the faces-config.xml file, residing in the WEB-INF/config/ipp/jsf folder of your Web application.

The specified bean will be newly created in the JSF context, when the activity panel is opened. Henceforth the life cycle will depend on the scope defined in the faces configuration file. The bean usually will not be destroyed when the complete() method is called.

Managed Bean Class

The fully qualified name of the bean implementation class.

Completion Method

The method to be called upon completion of the application. If, for example due to incorrect values, etc., an error occurs, it can be handled in the following ways:

  1. If a javax.faces.validator.ValidatorException is thrown, the error message derived from the ValidatorException will be displayed in the activity panel.
  2. If a different type of exception is thrown, a general message "Failed invoking completion method" will be displayed. The corresponding message test is internationalized.

Limitation on Using JSF Based Backing Beans

In case pure JSF-based backing beans are used for JSF activities, backing beans and state are in session scope and stored in the same. This means that two activity panels displaying process data of activity instances of the same type sharing one backing bean and therefore the state. The last opened activity panel overwrites the state in the backing bean set by the activity panel open prior. Due to this behavior, not more than one activity panel for an activity instance of the same type at the same time should be opened.

To bypass this JSF limitation, the Infinity Process Platform provides means to define a more fine grained scope for JSF backing beans, which assures that each activity panel uses a backing bean with its own state. To use this, it is required to expose the JSF-based backing beans as Spring beans and define the "portalTab" scope explicitly for each.

Spring Example

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
      xmlns:aop="http://www.springframework.org/schema/aop" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xmlns:ippui="http://infinity.com/bpm/ui/common/uiDefinition"
      xsi:schemaLocation="
      http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
      http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.5.xsd">
      <bean name="DisplayDataBean" class="org.eclipse.stardust.engine.api.web.jsf.beans.DisplayDataBean" scope="portalTab" />
</beans>