8 Scheduling Composite Execution

This chapter describes how Oracle SOA Suite addresses the business challenge of maintaining sufficient inventory levels. Overviews of how key SOA composite application components are created and address this challenge are provided, including Oracle Enterprise Scheduler.

This chapter includes the following sections:

8.1 Business Challenge

Company X faces the business challenge of maintaining sufficient inventory. As orders are processed, the stock of items in the warehouse is reduced and inventory must be restocked. For each category of products ordered, Company X has a different supplier. At the end of each day, a separate report must be run for each supplier to identify the number of items for each product to be ordered to return the inventory to its original level.

8.2 Business Solution

To address these business challenges, Company X designs a business solution that uses the components described in Table 8-1.

Table 8-1 Components That Provide the Business Solution

Component How This Component Addresses The Business Challenge Component Description

SOA composite application

A query inventory composite identifies the total number of items of each product ordered for the day for a given category. This query identifies how much inventory has been reduced during the day.

See Table 3-1 for a description of SOA composite applications.

Oracle Enterprise Scheduler job

Oracle Enterprise Scheduler is used to define a web service job for the query inventory composite and then submit the job with a schedule to run at a specified time.

Oracle Enterprise Scheduler enables you to manage job requests, define metadata, and schedule jobs in Oracle Enterprise Manager Fusion Middleware Control.

Oracle Enterprise Scheduler adapter activation and deactivation

Oracle Enterprise Scheduler activates and deactivates the database adapter in the fulfillment service created in Fulfilling Orders using recurring schedules for the activation and deactivation.

Oracle Enterprise Scheduler enables you to schedule adapters in composites to activate and deactivate at specified times.

Subsequent sections of this chapter provide more specific details about how the components in Table 8-1 are used to address the credit validation business challenge.

8.2.1 Creating a Web Service Job Definition

To address the requirement for identifying and maintaining sufficient inventory levels, Company X uses Oracle Enterprise Scheduler.

Oracle Enterprise Scheduler enables you to defer larger transactions to run as jobs at a later time or automate the running of application maintenance work based on a defined schedule. Oracle Enterprise Scheduler enables you to run different job types such as Java, PL/SQL, binary scripts, web services, and EJBs distributed across the nodes in an Oracle WebLogic Server cluster. Oracle Enterprise Scheduler runs jobs securely, providing for high availability, scalability, and load balancing. Oracle Enterprise Scheduler provides monitoring and management through Oracle Enterprise Manager Fusion Middleware Control.

Company X creates a job definition for the queryInventory composite that queries their inventory. The composite includes a synchronous BPEL process and a web service as the service binding component. You associate request-specific metadata as job definitions.

Company X creates the job definition by selecting ESSAPP in the Oracle Enterprise Manager Fusion Middleware Control navigator, then selecting Job Metadata > Job Definitions from the Scheduling Service menu. Figure 8-1 provides details.

Figure 8-1 Job Definition Creation

Description of Figure 8-1 follows
Description of "Figure 8-1 Job Definition Creation"

Company X configures a job definition with the following details:

  • Job name and display name of QueryInventory

  • Package value of soa

  • Job type of syncWebServiceJobType

When complete, configuration looks as shown in Figure 8-2.

Figure 8-2 Job Definition Configuration

Description of Figure 8-2 follows
Description of "Figure 8-2 Job Definition Configuration"

8.2.2 Submitting a Job Request on a Schedule

Company X creates a schedule for running the job definition created in Creating a Web Service Job Definition. A schedule determines when the job runs.

From the Scheduling Services menu in the Oracle Enterprise Manager Fusion Middleware Control navigator, Company X selects Job Requests > Submit Job Request. Company X selects the QueryInventory job definition and defines a schedule for running the job. Figure 8-3 provides details.

Figure 8-3 Job Request Submittal

Description of Figure 8-3 follows
Description of "Figure 8-3 Job Request Submittal"

After the job runs, you can review the output. Company X selects Job Requests > Search Job Request from the Scheduling Services menu and navigates to the Request Details page. In the Log and Output section at the bottom of the page, details about the web service response are available in an XML file. Figure 8-4 provides details.

Figure 8-4 Output Results of Web Service Response

Description of Figure 8-4 follows
Description of "Figure 8-4 Output Results of Web Service Response"

8.2.3 Applying Schedules to Adapters

Oracle Enterprise Scheduler also enables you to schedule adapters in composites to be activated and deactivated at specified times. You can schedule to activate an adapter during periods when load on the system is minimal. The fulfillment composite designed in Fulfilling Orders includes a database adapter as a service input.

Company X uses Oracle Enterprise Scheduler to activate and deactivate the database adapter using recurring schedules. Company X selects Job Requests > Define Schedules from the Scheduling Services list. Company X configures activation and deactivation job definitions for the database adapter with the details shown in Table 8-2. The database adapter is configured to active every ten minutes, and then deactivate every ten minutes.

Table 8-2 Configuration of Activation and Deactivation of Adapters

Element Activation of Adapter Deactivation of Adapter

Name

activateSched

deactivateSched

Display Name

activateSched

deactivateSched

Package

soa

soa

Frequency

Hourly/Minute

Hourly/Minute

Every

10 minutes

10 minutes

Deactivation occurs at 5 minutes, 15 minutes, 25 minutes, and so on. Activation occurs at 10 minutes, 20 minutes, 30 minutes, and so on.

Start Date

Ten minutes from now

Five minutes from now

Use End Date

Unchecked

Unchecked

When complete, adapter activation and deactivation configuration looks as shown in Figure 8-5.

Figure 8-5 Activate and Deactivate Adapter Jobs

Description of Figure 8-5 follows
Description of "Figure 8-5 Activate and Deactivate Adapter Jobs"

Company X goes to the home page of the database adapter in Oracle Enterprise Manager Fusion Middleware Control and selects to activate and deactivate the database adapter. Figure 8-6 provides details.

Figure 8-6 Database Adapter Activation and Deactivation on Database Adapter Home Page

Description of Figure 8-6 follows
Description of "Figure 8-6 Database Adapter Activation and Deactivation on Database Adapter Home Page"

Company X selects to activate and deactivate the database adapter at the specified times. Figure 8-7 provides details.

Figure 8-7 Adapter Activation Schedule

Description of Figure 8-7 follows
Description of "Figure 8-7 Adapter Activation Schedule"

8.3 Related Documentation

Table 8-3 provides references to documentation that more specifically describes the components and features described in this chapter.

Table 8-3 Related Documentation

For Information About... See...

Creating a job definition and schedule

"Managing Oracle Enterprise Scheduler Requests" of Administering Oracle Enterprise Scheduler

Activating and deactivating adapters

"Scheduling JCA Adapter Endpoint Activation and Deactivation using Oracle Enterprise Scheduler" of Administering Oracle SOA Suite and Oracle Business Process Management Suite