Introducing CronJobs in SAP Commerce Cloud

Objective

After completing this lesson, you will be able to discuss the purpose and the main components of a CronJob

CronJobs: Overview

As one of SAP Commerce Cloud's most frequently used features, CronJobs can execute predefined business logic either once or on a regular schedule. 

Typical applications of this feature include:

  • Updating and synchronizing elements from different catalog versions, for example, Regular synchronization from staged to online versions of product catalogs.
  • Assisting data backups or data cleanups, for example, Backing up order placements.
  • Triggering data imports and exports, for example, Recalculating prices

The following three different components interact to support the concept of a CronJob:

This image outlines the three critical elements required for executing a CronJob, which are discussed in the following text.
  • Job: Defines what needs to be performed and is usually associated with the designated task. In SAP Commerce Cloud, it generally points to a Java Class that carries the logic to be executed.
  • CronJob: Contains the runtime information of a CronJob (a Job's single run). This includes elements such as execution logs, status, and CronJob outcomes.
  • Trigger: Sets a schedule to execute a CronJob. It may start manually or automatically, depending on the trigger's specific parameters. The activation can occur at a certain time (such as 12:00 or 16:05) or at regular intervals (daily, monthly, or every five minutes, and so on).

Demonstration: Out-of-the-box CronJob in Backoffice

A number of CronJobs are provided out-of-the-box to cover the most typical use cases.

Let’s look at the following demo to understand how to create and run a CronJob in BackOffice from a business user’s perspective.

Log in to track your progress & complete quizzes