Scheduling a concurrent program
There are two ways in which a concurrent program can be executed; it can be launched manually by a user or it can be scheduled to run automatically either on a one off basis or on a regular basis. In the next recipe, we are going to schedule the concurrent program we have created. It is important to note that when we schedule a concurrent program there is no user there to select the values for the parameters that are defined. Therefore, any required parameters we have added must have a default value. This can be done when entering the concurrent program but we are going to default a value for the organization.
We are going to complete the following tasks in this recipe:
Add default values for any required parameters
Schedule the concurrent program
Add default values for any required parameters
We are now going to add default values for the parameters in our concurrent program that are required.
Getting ready
In our concurrent program XXHR First Concurrent Program we have three parameters:
P_RUN_DATE
P_ORG_ID
P_PERSON_ID
The first parameter P_RUN_DATE
is not required and is already defaulted to the current date. The second parameter P_ORG_ID
is required and so we are going to default this to Vision Corporation.
How to do it...
To add default values to our concurrent program parameters complete the following steps:
1. Log in to Oracle with the Application Developer responsibility.
2. Navigate to Concurrent | Program and the Concurrent Programs window will open.
3. Press the F11 key to enter a query.
4. Query back the XXHR First Concurrent Program concurrent program and click the parameters button.
5. Click on the
P_ORG_ID
parameter and enter the following details to set the default parameter:Item name
Item value
Default Type
SQL Statement
Default Value
SELECT organization_id FROM hr_all_organization_units WHERE name = 'Vision Corporation'
6. Click the Save button in the toolbar (or Ctrl + S) to save the record.
How it works...
We have set a default value for the Organization
parameter in the concurrent program so that it can be scheduled.
Schedule the concurrent program
Now we are going to schedule the concurrent program to run on a daily basis for two days.
How to do it...
To schedule the concurrent program do the following:
1. Log in to Oracle with the XXEBS Extending e-Business Suite responsibility.
2. Navigate to Submit Requests and submit a single request.
3. Select the XXHR First Concurrent Program concurrent program and leave the
Run Date
andOrganization
parameters set to their default values and click on OK:4. Now click on the Schedule button. The screen dynamically changes when you click on each item of the Run the Job radio group.
5. Click Periodically.
6. Set Re-Run to every 1 Day(s).
7. Enter an End At value 2 days from the current date.
8. Check the Increment date parameters each run.
The steps are shown in the following screenshot:
1. Click on OK and the window will close.
2. Click on the Submit button and when prompted to submit a new request select No and the form will close down.
3. Navigate to View Requests and click on the Find button (to find all requests).
4. You should see that the concurrent program we just submitted has submitted two requests. The first will be set to run immediately and the second concurrent program is Pending with a status of Scheduled, as shown in the following screenshot:
Note
You will notice that the date in the Parameters field has automatically been incremented because we checked the Increment date parameters each run checkbox.
How it works...
We have now scheduled our concurrent program for two days and the program will run automatically unless it is cancelled before the last run has completed.