Job Scheduling

Print Friendly, PDF & Email

◷ Reading Time: 7 minutes

Introduction

Use jobs to run your services seamlessly and concurrently using different agents.

For example, you can create jobs if you want to automatically do a few tasks concurrently such as:

  • Check an exchange rate every day at 8 AM and save it to an Excel file.
  • Check stock market rates every day at 8 AM and save it to an Excel file.

To schedule a job successfully it requires three components:

  1. Service – this is where the business logic is handled.
  2. Job – the definition of when to run the service.
  3. Agent – the node that hosts the service and job.

Set up the Service

1. Available services can be viewed at Execution Server > Services

Service List

2. Click on Edit under Actions

3. Service details can be viewed.

From this window,

  • Tile
  • Key

are required to create a job. And also, the service should be Enabled

Set up the Job

1. Once you know which service you want to run, the next step is to create a job. For that, go to, Create New --> Job

Create a new job, General tab

2. Change setting under General tab

Information

  • Name: Name of the job
  • Description: A brief description to describe the job

Activity

  • Enables: Make the job available to run or disable
  • Reetrant:
  • Tags: Assign tags to the job
  • Effective From and Expires At: Starting and ending time of the job

Recurring

  • Cron: If it is an ongoing job, how often it should run (See [Cron] for more information on how to assign Cron.

The Cron supports below specification:

Field name Allowed values Allowed special characters
Minutes 0-59 * , – /
Hours 0-23 * , – /
Day of month 1-31 * , – / ? L W
Month 1-12 or JAN-DEC * , – /
Day of week 0-6 or SUN-SAT * , – / ? L #
Year 0001–9999 * , – /

3. Change setting under Service tab

Package

  • Identifier: Package Identifier
  • Version: Package version

Service

  • Name: Name of the service
  • Version: Version of the service
  • Key: Key of the service
  • Version Strategy: Use Latest/ Earliest

Inputs

  • Parameters: If there is an input JSON object, add it here

View Job Logs

Job information including job executing times, running services, requests, responses and exceptions of the job can be viewed under Logs.

1. Go to Execution Server --> Jobs and click on Logs. You will see the logs of the job.

Logs icon to view job logs
Job logs

2. Click on Job Information to view the information.

Job information

3. To see the request, response and the exceptions logs of each execution, click on View Results.

Job Results
Request of the service FlexRule Server
Request of the service FlexRule Server
Exceptions of the execution

Set up an Agent

  • To view the existing agents, go to,
Administration --> Agents
Agent List
  • Click Edit under Action to assign the agents to jobs
  • An agent connects to a service/ services according to the tags which should be defined in this window.

Address

  • Name: Name of the agent
  • Is Active: Enable or disable the agent
  • Description: Role description
  • Host Url: Agent’s hosted URL

Distributed Scheduled Jobs

  • Allow Agent to Run a Job: Change the ability of the agent to run a job
  • Tags: Tags of the service/ services to run
  • Capacity: How many jobs the agent should run concurrently
Edit Agents

Troubleshooting

If your jobs are not starting or running correctly, ensure the following.

1. Both Master and Agent should run.

2. Master and Agent should run as an Administrator.

3. Tags in Agent and Jobs should match.

4. Both Agent and Job should be enabled

Agent
Job

Video Tutorial

Updated on August 9, 2019

Was this article helpful?

Related Articles