This is a developer-level activity.
FileNet P8 eForms is an electronic forms management application, an add-on product integrated into Workplace, that supplies developers with out-of-the-box components that may be modified to create custom forms or workflows for use in custom web applications. In Workplace, you can create custom eForms that are rendered and processed with a document processor defined in the document policy. You can also create a workflow in Workplace to use your custom-designed eForms for the workflow UI. FileNet P8 eForms provides a launch processor and step processor for authoring your eForms-based workflows. (If you have installed the FileNet P8 eForms help, you'll find more information about working with forms at this topic: Get Started with Form Policies.)
The recommended method for modifying the out-of-the-box processor components is to follow the procedures outlined in the Application Engine Administration Guide. However, because it is possible to programmatically customize the components as well, this topic describes the necessary steps for completing a programmatic customization of processor components, such as would be necessary after modifying the out-of-the-box toolbar.
To implement programmatic customization of a document, launch, or step processor component, perform the following:
NOTE This task requires the Workplace source code, which is available upon request.
To develop, deploy, and test processor components, your development environment must include:
These JARs are located in Workplace/WEB-INF/lib.
Programmatically customizing default form or workflow UI elements involves modifying the out-of-the-box FileNet P8 eForms document, launch, and step processor components. The following sections describe the modification procedures for each component type:
The event JSP, UI JSP, and UI modules are component types in the underlying framework of the FileNet P8 Workplace application. For detailed information on the framework and its component types, see the Web Application Toolkit Developer's Guide.
Most of the work associated with customizing out-of-the-box processors is completed in the UI module component. The UI module for a customized document form processor creates, renders, and handles events for the form. In a customized FileNet P8 eForms workflow, the UI module for the launch processor creates the workflow and renders the launch step to the user, and the UI module for the step processor retrieves the workflow from a specified queue and renders the data for a specified step.
To modify a UI module processor component, perform the following:
Component | UI Module File | Workplace Directory |
---|---|---|
Document Processor | DocumentProcessor.java | FileNet/Workplace/Source/ com/filenet/eforms/apps/server/ui/info/form |
Launch Processor | LaunchProcessor.java | same |
Step Processor | StepProcessor.java | same |
NOTE Some parameters are of type WcmString, which is a utility class used to retrieve a localized string from a resource file using a specified key. If you want to localize your custom module, you'll have to add your locale strings to a resource file, as described in the Web Application Toolkit Developer's Guide. If you have no localization requirement, you can simply pass a nonexistent key value to WcmString.
NOTE For events that require user action, use a popup window (controller.openPopup(
)
).
To create custom event JSP components, perform the following:
Component | Event JSP File | Workplace Directory |
---|---|---|
Document Processor | DocumentForm.jsp | FileNet/Workplace/properties |
Launch Processor | LaunchForm.jsp | FileNet/Workplace/eprocess/launchers/html/form |
Step Processor | StepForm.jsp | FileNet/Workplace/eprocess/stepprocs/html/form |
<%@ page errorPage="/WcmError.jsp" autoFlush="false" %>
<%-- UI Beans --%>
<jsp:useBean
id="myDocumentProcessor"
class="com.filenet.eforms.apps.server.ui.info.form.MyDocumentProcessor"
scope="request">
<jsp:setProperty name="myDocumentProcessor" property="name"
value="myDocumentProcessor" />
</jsp:useBean>
<jsp:useBean
id="myLaunchProcessor"
class="com.filenet.eforms.apps.server.ui.info.form.MyLaunchProcessor"
scope="request">
<jsp:setProperty name="myLaunchProcessor" property="name" value="myLaunchProcessor" />
</jsp:useBean>
<%-- Data Provider Beans --%>
<jsp:useBean
id="authoringDataProvider"
class="com.filenet.wcm.toolkit.server.dp.WcmAuthoringDataProvider"
scope="request">
<jsp:setProperty name="authoringDataProvider" property="name"
value="authoringDataProvider" />
</jsp:useBean>
<jsp:useBean
id="searchDataProvider"
class="com.filenet.wcm.toolkit.server.dp.WcmSearchDataProvider"
scope="request">
<jsp:setProperty name="searchDataProvider" property="name"
value="searchDataProvider" />
</jsp:useBean>
<jsp:useBean
id="eProcessDataProvider"
class="com.filenet.wcm.toolkit.server.dp.WcmEProcessDataProvider"
scope="request">
<jsp:setProperty name="eProcessDataProvider" property="name"
value="eProcessDataProvider" />
</jsp:useBean>
<%-- WcmController CONTROLLER --%>
<jsp:useBean
id="controller"
class="com.filenet.wcm.apps.server.controller.WcmWorkplaceController"
scope="request">
</jsp:useBean>
<%
myDocumentProcessor.addDataProvider(authoringDataProvider);
myDocumentProcessor.addDataProvider(searchDataProvider);
myLaunchProcessor.addDataProvider(eProcessDataProvider);
...
To create custom UI JSP components, perform the following:
Component | UI JSP File | Workplace Directory |
---|---|---|
Document Processor | DocumentForm.jsp | FileNet/Workplace/UI-INF/jsp/ui/properties |
Launch Processor | LaunchForm.jsp | FileNet/Workplace/UI-INF/jsp/ui/ eprocess/launchers/html/form |
Step Processor | StepForm.jsp | FileNet/Workplace/UI-INF/jsp/ui/ eprocess/stepprocs/html/form |
<% WcmUi.render(request, "myDocumentProcessor", out); %>
<% WcmUi.render(request, "myLaunchProcessor", out); %>
Using the Process Configuration Console, you must register your new launch and step processors with the Process Engine. For details on using the Process Configuration Console, see the Process Configuration Console Help.
To register the custom processors:
My Form Launch HTML
.html/custom/MyLaunchForm.jsp
.My Form Step HTML
.html/form/MyStepForm.jsp
.This procedure configures the Workplace application to recognize custom processors when creating document and workflow policies. It requires modifying an XML file, then redeploying Workplace.
To modify the XML file:
<object key="processor">
<setting key="name">Form (Custom)</setting>
<setting key="type">Document</setting>
<setting key="style">Form</setting>
<setting key="url">properties/MyDocumentForm.jsp</setting>
</object>
<object key="processor">
<setting key="name">My Form Launch HTML</setting>
<setting key="type">Launch</setting>
<setting key="style">Form</setting>
</object>
<object key="processor">
<setting key="name">My Form Step HTML</setting>
<setting key="type">Step</setting>
<setting key="style">Form</setting>
</object>
To use your new document processor, you must assign it to an existing document policy or to a new document policy that you create. This section covers both the update and create procedures.
To update a document policy with your new processor:
To create a document policy with your new processor:
For details on each wizard step, see the topic FileNet P8 Documentation > Expansion Products > FileNet P8 eForms > Form Policies > Document Policies > Create a Document Policy in the Help for Form Policies. Note that to access this topic, you must have the FileNet P8 eForms help installed on your FileNet P8 Platform Documentation server.
The updated policies are now ready for use.
You must update any existing workflow definitions, specified in workflow policies, that will use your custom step processors. If you won't be using your new custom processors with the existing workflow definitions, skip this procedure.
To update the workflow definitions:
You must update workflow policies that specify any workflow definitions that you have modified for custom step processors, as described in the Update the Workflow Definitions section. If you did not modify any workflow definitions to use your custom step processors, skip this procedure.
To update the workflow policies:
The updated policies are now ready for use.