Teaching how to use the Oracle Enterprise Scheduler Service

Enterprise Scheduler Service (ESS) is a scheduler that is part of SOA Suite 12c. ESS has an EM component to manage job requests, define metadata and schedule jobs, and APIs to define metadata and schedule jobs. ESS can also be used to send notification alerts. In this section we are going to use it to demonstrate how simple it is to trigger a job, which can be invoking a composite using a scheduler.

I am using the pre-built virtual image that Oracle provides as a public VM in OTN (http://www.oracle.com/technetwork/middleware/soasuite/learnmore/soa-vm-2870913.html). If you don’t have an existing environment, you can download this VM and use it as part of the following exercises.

Trigger a Composite Using a Scheduler

In this example we are going to build a new very simple composite that doesn’t do anything apart from echoing the message that receives. Then we are going to create a job in ESS pointing to this composite and sending a simple input string. Finally, we are going to create a scheduling configuration to run the job every 2 minutes. As a result we should see a new composite being created in the console every 2 minutes.

  • Create a new SOA Project as we have done in the previous sections.
  • Either use a predefined template with a composite with one BPEL or create an empty composite and drag and drop a BPEL service. Make the BPEL synchronous and leave the default input/output variable types of the BPEL.

  • Open the BPEL and simply assign the input to the output using an Assign activity.

  • At the end your BPEL and composite should look like this:

  • Save All and deploy your composite.
  • Test you composite by sending any input message and make sure that it replies back with the same message.

Let’s create a Job definition

Oracle Scheduler (ESS) is not part of your development activities. It is more considered a runtime configuration. This basically means that at runtime you can decide to create new jobs and apply scheduling configuration without having to re-deploy your services. This is convenient as you don’t have to re-open development and testing cycles just because you want to schedule jobs.

  • Log in into EM Fusion Middleware Control if you are not already there.
  • Click on the Echo service that we did in the past exercise and grab its WSDL location. We are going to need it later on, when configuring our job. You can grab the WSDL form the same page that you used to test it in the previous section.

  • In the left pane, click on your ESS for your Admin server

  • In the right panel, click on the Scheduling Service and click on Job metadata -> Job definitions

  • Select create

  • In the create job definition screen, set the following fields, leaving the others with their default values:
    • Name: MyEchoService
    • Display Name: MyEchoService
    • Package: soa
    • Job Type: syncWebserviceJobType

  • Click the Plus sign on the application defined properties and add an application defined property
    • Type : String
    • Name : input (note, this is the name of the parameter that we want to send)
    • Initial Value: Leave it empty
    • Then click OK
  • Now click on the Select Web Service button.
    • Paste the WSDL URL and click Go
    • Select Web Service Type as SOA
    • Select the available Service
    • Port Type : MyEchoService_pt
    • Operation : process
    • Modify the sample xml by setting the value of the input xml element and add any string you want.

  • Click the OK button. All the WSDL and payload related information is added as a set of properties to the job definition automatically

  • The Job configuration should look this:

  • Important: Now click the OK button to create the job definition. Otherwise you will lose all configurations made.
  • At the end the result should be a made Job definition like this

Schedule the Job

So far we have created a job that points to our Echo service. Now we need to submit the job with a scheduling configuration.

  • Once again, click on the Scheduling Service -> Job requests -> Submit Job Request

  • Click the magnifying glass on job definition, click on go to do a search, and select MyEchoService job definition and click OK

  • Enter a value for input, define a schedule as shown (startTime must be a future time) and click OK to submit the job. Make sure to specify end time.
    • input – Hello World
    • Schedule – Tick on: Specify Schedule
    • Frequency – Hourly/Minute
    • Every – 0 Hours 2 Minutes
    • Start Date – Enter todays date with a future time
    • End Date – Future Date/Time, for example tomorrow

  • Click on Ok to create and submit the job

Look at job output

Now, let’s analyse our Scheduled job.

  • In the Schedule Services dropdown, select job requests/search job requests.

  • Then hit the search button. This will list all the job requests. Look for a completed request for MyEchoService.

  • Click on the request ID hyperlink for the Succeeded instance. This brings up the request detail page.

  • Notice at the end of the page that you can see the output of the service

  • Open it up and see what the output was. It should be the echo to whatever you set as input

  • Wait a few minutes and come back to search for your job again, you should see a few more that have succeeded, as well as the parent one and the one that is still pending to run.

  • Now go to MyEchoService composite and search for all Flow instances in the past few hours, you should see one completed composite instance for each of the completed jobs.

Cancel the job request

Finally, before you realise that you inundated your stack with thousands of new instances, let’s cancel the job.

  • In the Schedule Services dropdown, select job requests/search job requests. Then hit the search button.
  • This will list all the job requests. Locate the parent job request for MyEchoService (will have N/A for scheduled time and a WAIT state).

  • Click on the request ID hyperlink. This brings up the request detail page. In the dropdown, select cancel and confirm cancel to cancel the recurring job.
  • Go back to the running jobs and make sure that there is no new one still to be provisioned. Even the pending job gets cancelled.

Congratulations, you built your first Scheduled job. It is a very simple, but yet a very powerful way to automate jobs in SOA.


Author: Carlos Rodriguez Iturria

I am extremely passionate about people, technology and the most effective ways to connect the two by sharing my knowledge and experience. Working collaboratively with customers and partners inspires and excites me, especially when the outcome is noticeable valuable to a business and results in true innovation. I enjoy learning and teaching, as I recognise that this is a critical aspect of remaining at the forefront of technology in the modern era. Over the past 10+ years, I have developed and defined solutions that are reliable, secure and scalable, working closely with a diverse range of stakeholders. I enjoy leading engagements and am very active in the technical communities – both internal and external. I have stood out as a noticeable mentor running technology events across major cities in Australia and New Zealand, including various technology areas such as, Enterprise Integrations, API Management, Cloud Integration, IaaS and PaaS adoption, DevOps, Continuous Integration, Continuous Automation among others. In recent years, I have shaped my role and directed my capabilities towards educating and architecting benefits for customers using Oracle and AWS Cloud technologies. I get especially excited when I am able to position both as a way to exceed my customers’ expectations. I hold a bachelor degree in Computer Science and certifications in Oracle and AWS Solutions Architecture.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: