Using an ADF Form to Create an Account in Siebel Using BPEL and Web Services

Purpose

In this tutorial, you use Oracle JDeveloper 10.1.3.2 to build a Web application based on a Web service. In a previous OBE, you have created the Web service for a Siebel Application using BPEL and deployed it to Oracle SOA Suite. In this OBE, you use the running Web service as a basis for a data control for your JSF page.

Time to Complete

20 minutes

Topics

The tutorial covers the following topics:

 Overview
 Scenario
 Prerequisites
 Accessing the Running BPEL Web Service

Building the Data Model Based on a WSDL File

Creating a New Project for the User Interface

Creating the Insert Page

 Running the JSF Pages
 Summary

Viewing Screenshots

 Place the cursor over this icon to load and view all the screenshots for this tutorial. (Caution: This action loads all screenshots simultaneously, so response time may be slow depending on your Internet connection.)

Note: Alternatively, you can place the cursor over an individual icon in the following steps to load and view only the screenshot associated with that step. You can hide an individual screenshot by clicking it.

Overview

This application uses a running Web service deployed in the SOA Suite. You must have created the Web service previously created using BPEL for a Siebel Application. Please refer to the Prerequisites for details.

Oracle JDeveloper enables developers to model, create, discover, assemble, orchestrate, test, deploy, and maintain composite applications based on services. Oracle JDeveloper supports SOA principles and XML Web services standards, as well as traditional Java, J2EE, and PL/SQL component and modular code mechanisms.

Oracle ADF is a model-driven SOA framework that automates and manages business and data services and provides a standard data-and-service binding layer based on the JSR 227 specification. This binding layer can be used with process flows, page flows, and service invocations. Oracle ADF also implements SOA design practices, and makes user interfaces as loosely coupled as the services themselves.

Oracle SOA Suite is a standards-based, best-of-breed suite that enables you to build service-oriented applications and deploy them to your choice of middleware platform. Part of the Oracle SOA Suite, Oracle BPEL Process Manager enables business processes to be modeled, automated, and monitored.

If you use Web services as your business service technology, the model information will be exposed to the view and controller layers through ADF data control interfaces implemented by thin, Oracle-provided adapter classes.

Back to Topic List

Scenario

A Web service is already deployed and running in Oracle SOA Suite. You want to create a data control based on the running Web service and create a JSF page using this data control. The Web service allows you to create a new customer and returns the Customer ID provided for this new customer.

Back to Topic List

Prerequisites

Before starting the tutorial, you should:

1.

Have access to or have installed Oracle JDeveloper 10.1.3.2. You can download it from Oracle Technology Network.

 

2.

Have access to SOA with the BPEL Web service deployed and running. To set up this mandatory prerequisite environment, you need to perform this required OBE: Create, Deploy, and Test a BPEL Process to Create a Customer in Siebel Application .

 

3.

Start JDeveloper. Double-click the JDeveloper executable jdeveloper.exe found in the root directory ( <jdev_home> ) where you unzipped it.

If the Migrate User Settings dialog box opens, click NO.

Close the Tip of the Day window.

 

4.

The JDeveloper IDE should now be displayed.

5.

Perform the steps provided in the tutorial Create an Inbound Web Service for Siebel Account Business Service

Back to Topic List

Accessing the BPEL Running Web Service

These steps allow you to confirm that you have a ready-to-use BPEL environment and to collect the URL of the Web service to use as data control. If you fail in performing these steps, refer to step 2 of the prerequisite section.

1.

Open a Web Browser window and enter the URL corresponding to your BPEL console (for example, http://localhost:8888/BPELConsole).

The page prompts you for the Username and Password. The default username is oc4jadmin and the default password is welcome1.

Click Login.

 

2.

In the BPEL Console, with the Dashboard tab selected, click the InsertAccount process link, which is the process that will be the basis of the data control.

 

3.

In the BPEL Processes tab for the InsertAccount process, click the WSDL link.

 

4.

Click the WSDL location link to review the code of the Web service.

 

5.

The Web service xml code is displayed in the browser window.

In the address bar, select the URL, right-click, and select copy from the context menu.

Back to Topic List

 

Building the Data Model Based on a Running Web Service

The data model provides data access and validation for an application. The data is always validated by the model, regardless of the client implementation. This cleanly separates the validation and business rules from the user interface.

In the next few steps, you create an application in JDeveloper and create a data model for your application.

 Create a New Application and Project
 Create a WSDL-Based Data Control

Back to Topic List

Create a New Application and Project

In JDeveloper, you always work with projects contained in an application. The application is the highest point in the control structure.

A JDeveloper project is an organization structure used to logically group related files. You can add multiple projects to your application to easily organize, access, modify, and reuse your source code. In the Applications Navigator, projects are displayed as the second level in the hierarchy, under the application.

It is considered best practice to use projects to separate the model code from the code written for the view. In this tutorial, you create one project for the data control, and later create a second one for the JSF views.

Before you create any component, you must first create the application and project. To do this, perform the following steps:

1.

Right click the Applications node in the Applications Navigator and select New Application from the context menu.

 

2.

In the Create Application dialog box, enter ADF_BPEL_Siebel for the Application Name. As you enter the application name, the directory name changes automatically.

Enter oracle as the Application Package Prefix.

Select No Template [All Technologies] from the Application Template drop-down list.

Click OK.

 

3.

In the Create Project dialog, set the Project Name to DataModel and click OK.

 

4.

The Applications Navigator should look like this:

Back to Topic

Back to Topic List

Creating a Web Service-Based Data Control

In this section of the tutorial, you create a data control based on a Web service. This Web service was created out of BPEL for a Siebel Application.

To create the data control, perform the following steps:

1.

In the Applications Navigator, right-click the DataModel node and select New from the context menu.

 

2.

In the New Gallery select Business Tier | Web Services as the category and double-click the Web Service Data Control item.

 

3.

In the Create Web Service Data Control wizard, click Next to skip the Welcome page.

 

4.

In Step 1, type InsertAccountToSiebel as the name for this data control.

Paste the URL you previously copied in the URL field. For the Service, select InsertAccount from the drop-down list.

Click Next.

 

5.

Step 2 shows the operations available from this Web service; select InsertAccount and use the Add button to shuttle the selection in the Selected pane.

Click Next.

 

6.

On step 3, click Finish to create the data control.

 

7.

In the Applications Navigator, expand the nodes that now exist and review the new entries that have been created. The Applications Navigator should look like this:

 

8.

Click the save all  icon to save your work.

 

Back to Topic

Back to Topic List

Because it is considered best practice to use different projects to separate the model from the UI, you now create a second proje t for the JSF views.

To do this, perform the following steps:

1.

In the Applications Navigator, right-click the ADF_BPEL_Siebel node and select New Project from the context menu.

 

2.

In the New Gallery, select the Empty Project item.

Click OK.

 

3.

In the Create Project dialog, set the Project Name to UserInterface and click OK.

 

4.

The Applications Navigator should now look like this:

 

5.

Click the save all  icon to save your work.

 

Back to Topic List

 

Creating the Insert Page

In the next few steps, you create an ADF Faces for the create page.

1.

In the Applications Navigator, right-click the UserInterface node and select New from the context menu.

 

2.

 

In the New Gallery, expand the Web Tier node and select JSF. In the Items pane, select JSF JSP.

 

3.

Click Next to skip the Welcome page of the Create JSF JSP Wizard.

 

4.

In Step 1 of the wizard, select the JSP Document (*.jspx) option.

Click Next.

 

5.

In Step 2, make sure Do Not Automatically Expose UI Components in a Managed Bean is selected.

Click Next.

 

6.

In Step 3, make sure the following libraries are selected:

ADF Faces Components 10_1_3_2_0
ADF Faces HTML 10_1_3_2_0
JSF Core 1.0
JSF HTML 1.0

Click Next, then Next again. Then click Finish to create the page.

 

7.

An empty Design JSF page opens up in the editor.

 

8.

From the Component palette for the ADF Faces Core library, drag a Panel Page component onto the page.


9.

In the Property Inspector pane, change the Title from Title 1 to Insert Account.

 

10.

From the Component palette, drag a Panel Border component just after the title you just changed.

The page should now look like this:

 

11.

Open the Data Controls palette and expand the InsertAccountToSiebel node. Then drag and drop the process(String, String, String) node onto the top facet on the page.

In the popup menu, select Create | Parameters | ADF Parameter Form.

 

12.

The Edit Form Fields dialog box allows you to delete, add, and reorder the fields. You will change the display label for each field.

In the Display Label column, replace the existing values by typing the following ones:

Competitor Flag
Currency
Location
Main Phone Number
Name
Partner Flag
Organization
Skip Credit Check
Type

Click OK.

 

13.

The page should now look like this:

 

14.

Select the Process button at the bottom of the page, and in the Property Inspector, change the Text property to Submit.

 

15.

From the DataControl palette, expand InsertAccountToSiebel | process | Parameters and select String. Drag and drop the component on the bottom facet of the page.

In the pop-up menu, select Create | Texts | ADF Output Text w/Label.


16.

In the Property pane, update the Label property for the new Output Text to Account Id.

 

17.

From the Components Palette, open the ADF Faces Core library, select the Object Separator component, and drop it on the start facet.

 

18.

Your page should now look like this:

 

19. Click the save all  icon to save your work.

Back to Topic List

 

Running the JSF Page

Now that you have built your application, you need to test it. JDeveloper makes it easy to test JSF pages by using a built-in application server. The server is automatically launched when you test a page from within JDeveloper.

The next few steps take you through the testing process.

1.

Right-click the page in the Visual Editor and select Run from the context menu.


2.

Your page is loaded into your default browser and should look like the following:


3.

Enter values in the Insert Account form according to the example below:

Competitor Flag N
Currency USD
Location Miami
Main Phone Number (650) 111-1212
Name STUDENT508
Partner Flag N
Organization Default Organization
Skip Credit Check N
Type Customer

Click Submit.

 

 
4.

The Insert Account page returns the assigned Account ID.

 

5.

Test any other value.

 

6.

You have successfully completed this OBE. You can close the browser window.

 

Back to Topic List

Summary

In this tutorial, you created an end-to-end application by using a deployed WSDL Web service as a data control. Then you created a JSF page that uses operations provided by the Web service. You learned how to:

 Access a BPEL Web Service
 Build the Data Model
 Create an Insert Page
 Run the JSF Page

Back to Topic List

Related Information

To learn more about Oracle ADF and JDeveloper, you can refer to:

The Oracle Application Developer Framework home page on the OTN Web site.
ADF is a rich framework to create user interfaces.

The JDeveloper home page on the OTN Web site.
Oracle JDeveloper is a free integrated development environment with end-to-end support for modeling, developing, debugging, optimizing, and deploying Java applications and Web services.

 

 Place the cursor over this icon to hide all screenshots.