Skip to Content
Technical Articles

Using Job Scheduler in SAP Cloud Platform [0]: Intro and Prep

This series of blogs intends to show in an easy way how to use the Job Scheduler service in SAP Cloud Platform

In this first blog, we’re going to prepare ourselves before we start with a first example

Overview


What’s that: Job Scheduler?

It is a tool.
It allows to define jobs in SAP Cloud Platform
A job can be configured to run regularly, or just once
A job triggers an action

What is it not?

Job Scheduler is not a framework
It doesn’t help to create the actions which should be executed
It’s just a tool to trigger anything which already exists

How does it work?

Job Scheduler is a cloud service in SAP Cloud Platform
There’s a Dashboard which allows to define jobs
A job is configured with a URL
This means your job would invoke that URL e.g. every night
A job can as well be configured with a CloudFoundry-Task

How does it work technically?

You have an application in SAP Cloud Platform
You add a REST endpoint to your app, which can be invoked and which does something
You bind your app to an instance of Job Scheduler service
Now you can configure Job Scheduler to call this endpoint every night (or whatever)
The result of the HTTP call is evaluated by Job Scheduler

More details please?

Job Scheduler requires that you bind your app also to an instance of xsuaa service (Authorization and Trust Management)
Note: the order of binding is relevant !

Which Features does it have ?

Job Scheduler functionality of triggering actions (It doesn’t help to define such actions)
User Interface to create jobs and define schedules, to view results, etc
Interface to manage jobs/schedules via API (REST, node.js, Java)
Details:
Support for Cloud Foundry tasks
Schedules can be defined with cron or human readable format
Jobs can run synchronously or asynchronously
2 Service plans: ‘lite’ and ‘standard’

Preparation

If you want to use Job Scheduler in SAP Cloud Platform, you need to create 2 service instances

Create instance of Job Scheduler service

Creating an instance of the Job Scheduler service is anyways the first step do do
It can be reused by all required applications

IN SAP Cloud Platform, Cloud Foundry Environment, go to your Space and open the Service Marketplace
Find the tile “Job Scheduler”

Note: if you don’t see the Job Scheduler in the Service Marketplace, you need to configure Entitlements. See Appendix

Click the tile Job Scheduler -> Instances -> New instance
Choose Service Plan as ‘lite’ (anyways, in Trial, only ‘lite’ is supported)
Parameters: fill in the following into the text field :

{
   "enable-xsuaa-support": true 
}

It looks like this:

Step through the wizard and provide an instance name of your choice, e.g.  jobschedulerinstance

Note:
The configuration parameter enable-xsuaa-support is always required, unless you want to trigger only CF Tasks (no REST endpoints)

 

Create instance of xsuaa service

After creating the service instance of Job Scheduler, the next task to do is creating an instance of Authorization and Trust Management (XSUAA)

However, this instance requires configuration which is a bit specific to the use case.
As such, it will be described later

Summary

In this blog, we’ve learned that Job Scheduler is a tool which can trigger actions,
e.g. invoke REST endpoints.
It can be configured to do that on e.g. regular basis

To use Job Scheduler, you need and application (with endpoint) and you have to bind it to service instances of JobScheduler and XSUAA
And remember that the order is important (order of creation and binding)

Next Steps

Part 1: First simple use case in Trial account
Part 2: Simple use case with security (authentication only)
Part 3: Simple use case with authentication and authorization
Part 4: Using App Router in between Job and endpoint

More to come, e.g.
– Using MTA
– Using CAP
– Using Remote ABAP service

SAP Help Portal: Job Scheduler documentation

Product page: Job Scheduler section with nice intro video
https://www.sap.com/products/cloud-platform/capabilities/foundation.job-scheduler.html

Appendix: How to Configure Entitlements

Go to your global account, e.g. P123456789trial
Click on Entitlements in the left menu pane
Click Subaccount Assignments, then select the desired subaccount and press “Go”
Next click is on “Configure Entitlements”


Afterwards one click on “Add Service Plans”
In the dialog you can search for Job Scheduler, then assign and save
If the allowed service plan is grayed-out, then you might need to remove from other subaccount or, in productive environment, purchase quota

 

1 Comment
You must be Logged on to comment or reply to a post.