Expand my Community achievements bar.

Process + Servlet to invoke process + form + database

Avatar

Level 2
GetMortgageForm process

The following illustration shows the GetMortgageForm process (see Figure 2).



Figure 2. A LiveCycle ES process that returns an interactive form.

Note: This document does not describe how to create a process by using Adobe LiveCycle Workbench ES. (For information, see Workbench ES Help.)

The following table describes the steps in this diagram.

Operation Description

1 The user submits a custom identifier value and the operation to perform. In this situation, assume that the user is applying for a mortgage. The input parameters for this process are a string value that specifies the form name (named formName) and another string value that represents the custom identifier value (named custId).

Note: In the Java application logic located in the Java servlet, the formName and custId process variables are referenced.

2 The process uses the customer identifier value to perform a relational database look-up for additional customer information by using the JdbcService service's Execute SQL Statement operation. The custom identifier value acts as the primary key value.

3 Merges customer data into an XML data source that is used to prepopulate the form. (See "Prepopulating Dynamic Forms" in Programming with LiveCycle ES.)



4 The mortgage form is rendered with customer data located in some of the fields, such as the address field. This action is based on the Forms service's renderPDFForm operation.

The Java servlet receives the form (return value for the process) and writes the form to a client web browser. The name of the output parameter is RenderedForm. This parameter is a process variable and its data type is FormsResult.

Note: In the Java application logic located in the Java servlet that invokes this process, the RenderedForm process variable is referenced.

This interactive loan form is rendered by the GetMortgageForm process (see Figure 3).



Figure 3. An interactive form.

Note: This document describes how to use the Invocation API to invoke a LiveCycle ES process. It is recommended that you are familiar with the Invocation API before you follow along with this document. (See "Invoking LiveCycle ES Processes" in Programming with LiveCycle ES.)

Summary of steps

To create a Java servlet that invokes a LiveCycle ES process, perform the following steps:

1. Create a new web project.

2. Create Java application logic that represents the Java servlet.

3. Create the web page for the web application.

4. Package the web application to a WAR file.

5. Deploy the WAR file to the J2EE application server.

6. Test your web application.

Note: Some of these steps depend on the J2EE application on which LiveCycle ES is deployed. For example, the method you use to deploy a WAR file depends on the J2EE application server that you are using. This document assumes that LiveCycle ES is deployed on JBoss®.

Creating a web project

The first step to create a Java servlet that can invoke a LiveCycle ES process is to create a new web project. The Java IDE that this document is based on is Eclipse 3.3. Using the Eclipse IDE, create a web project and add the required JAR files to your project. Finally, add an HTML page named index.html and a Java servlet to your project.

The following list specifies the JAR files that you must add to your web project:

adobe-forms-client.jar

adobe-livecycle-client.jar

adobe-usermanager-client.jar

adobe-utilities.jar

For the location of these JAR files, see "Including LiveCycle ES Java library files" in Programming with LiveCycle ES.

Note: The adobe-forms-client.jar file is required because the process returns a FormsResult object, which is defined in this JAR file.

To create a web project:

1. Start Eclipse and click File > New Project.

2. In the New Project dialog box, select Web > Dynamic Web Project.

3. Type InvokeMortgageProcess for the name of your project and then click Finish.

To add required JAR files to your project:

1. From the Project
0 Replies