Saturday, May 2, 2020

Job Scheduler

In Pega Platform, an Agent is a background process that can be scheduled to run at almost any time. Starting with Pega Platform version 8.1, however, the Job Scheduler and the Queue Processor replace Agents and improve background processing. More to the point, the Job Scheduler replaces Advanced Agents for recurring or scheduled tasks




As illustrated in the screenshot above, the main settings of a Job Scheduler instance are:
·       Enable job scheduler: you can use this toggle to disable or suspend the Job Scheduler instance as needed.
·       Associated with node types: As illustrated in the screenshot, the default setting is to run the Job Scheduler instance on nodes of type BackgroundProcessing. Alternatively, we can select all nodes regardless of their type, a different node type, or multiple node types. Refer to the section Node Classification below for more information on the different node types.
·       Runs on: By default, the Job Scheduler instance runs on all nodes in a cluster of the type
BackgroundProcessing. Alternatively, you can select to run the job on only one node in a cluster.
·       Schedule: As the name implies, this setting specifies when the Job Scheduler instance will run. By default, the Job Scheduler instance runs upon startup of the selected nodes. Alternatively, you can select to run the Job Scheduler instance multiple times a day, daily, weekly, monthly, or yearly. Refer to the section Schedule Options below for more information.
·       Context: As the name implies, this setting specifies the context when the Job Scheduler instance runs. You can select to use an access group as an example, which sets the security context when running the Job Scheduler instance.

·       Class: This setting specifies the class that contains the activity the Job Scheduler instance runs. Also, the Job Scheduler instance will be associated with this class
·       Activity: This setting specifies the Activity the Job Scheduler instance job runs.

Node Classification

Introduced in Pega Platform version 7.2.2, node classification is the process of separating nodes in a cluster, segregating them by purpose, and predefining their behavior. By configuring a Pega Platform node with a type, you dedicate this node to perform particular actions. For example, you can have a set of nodes dedicated to user requests, while other perform background processing to avoid performance issues for users.
In the context of the Job Scheduler, the node types include:
·       ADM: This type is specific to Pega Decision Strategy Manager (DSM) and it specifies that the node is assigned to the Adaptive Decision Manager (ADM) service.
·       BackgroundProcessing: This type specifies that the node is assigned to run background processes such as agents, listeners, job schedulers, and queue processors.
·       Batch: This type is specific to Pega Decision Strategy Manager (DSM) and specifies that the node is assigned to run DSM background processes.
·       BIX: This type specifies that the node is assigned to the Business Intelligence Exchange (BIX) service.
·       Custom1, Custom2, Custom3, Custom4, Custom5: This type specifies that the node is used for other purposes or to support further classification or separation of nodes in a cluster.
·       DDS: This type is specific to Pega Decision Strategy Manager (DSM) and it specifies that the node is assigned to the Decision Data Store (DDS) service.
·       RealTime: This type is specific to Pega Decision Strategy Manager (DSM) and it specifies that the node is assigned to run realtime processes such as processing user requests in the context of DSM.
·       RTDG: This type is specific to Pega Decision Strategy Manager (DSM) and it specifies that the node is assigned to the Real Time Data Grid (RTDG) service.
·       Search: This type specifies that the node is assigned to the Search service.
·       Stream: This type specifies that the node runs the Streaming service, which is required by Pega Decision Strategy Manager (DSM) and Pega Platform Queue Processors.
·       Universal: This type specifies that the node is assigned all node types (i.e., ADM, BackgroundProcessing, Batch, BIX, etc.).
·       WebUser: This type specifies that the node is dedicated to the user requests.
Note that it is possible to configure a node with multiple node types. For example, you could classify a node with both the types BackgroundProcessing and BIX to run not only agents, listeners, job schedulers, and queue processors, but also BIX jobs.

Schedule Options

As stated above, the Schedule options are Startup, Multiple times a day, Daily, Weekly, Monthly, and Yearly. Following are additional details about these options.

Startup

When selected, the Job Scheduler instance runs upon every startup of the selected node or nodes.

Multiple times a day

When selected, you have the option to run the Job Scheduler instance After every N minute(s) or After every N hour(s), where N is an integer that specifies the delay before starting the next run.


After every N minute(s)
When selected, the Job Scheduler instance runs as follows:
·       Immediately after creation,
·       Upon startup of the selected node or nodes, and
·       N minute(s) following the completion of the previous run.
After every N hour(s)
Similarly, when selected, the Job Scheduler instance runs as follows:
·       Immediately after creation,
·       Upon startup of the selected node or nodes, and
·       N hour(s) following the completion of the previous run.

Daily

When selected, you have the option to run the Job Scheduler instance Every N day(s) or Every weekday, where N is an integer that specifies the frequency in days. You must also specify the start time of the run, including the timezone.


Every N day(s)
When selected, the Job Scheduler instance runs as follows:
·       After creation: it will run at the specified start time if it is created before. Otherwise, it will run at the specified start time in N day(s).
·       Upon startup of the selected node or nodes: it will run at the specified start time if the node is started before. Otherwise, it will run at the specified start time in N day(s).
·       Every N day(s) after that and at the specified start time.
Every weekday
When selected, the Job Scheduler instance runs as follows:
·       After creation: it will run at the specified start time if 1) it is created before, and 2) it is created on a weekday. Otherwise, it will run at the specified start time on the next weekday.
·       Upon startup of the selected node or nodes: it will run at the specified start time if 1) the node is started before, and 2) it is started on a weekday. Otherwise, it will run at the specified start time on the next weekday.
·       Every weekday after that and at the specified start time.

Weekly

When selected, you have the options to run the Job Scheduler instance Every N week(s), where N is an integer that specifies the frequency in weeks. You must also specify 1) the days of the week to run the Job Scheduler instance and 2) the start time of the run, including the timezone.



More specifically, the Job Scheduler instance runs as follows:
·       After creation: it will run at the specified start time if 1) it is created before, and 2) it is created on one of the specified days. Otherwise, it will run at the specified start time on the next specified days, or in N week(s) on the specified days.
·       Upon startup of the selected node or nodes: it will run at the specified start time if 1) the node is started before, and 2) it is started on one of the specified days. Otherwise, it will run at the specified start time on the next specified days, or in N week(s) on the specified days.
·       Every N week(s) after that and 1) on the specified day(s) and 2) at the specified start time.

Monthly

When selected, you have the following options:
·       Day X of every N month(s), where X is the day of the month, and N is an integer that specifies the frequency in months (e.g., Day 1 of every 1 month, Day 15 of every 3 months).
·       The <qualifier> <day> of every N month(s), where:
·       <qualifier> is first, second, third, fourth, or last,
·       <day> is Day, weekday, weekend day, Sunday, Monday, Tuesday, Wednesday, Thursday, Friday, or Saturday, and
·       N is an integer that specifies the frequency in months.
You must also specify the start time of the run, including the timezone.


Day X of every N month(s)
When selected, the Job Scheduler instance runs as follows:
·       After creation: it will run at the specified start time if it is created 1) before the specified start time and
2) on or before the specified day of the month. Otherwise, it will run at the specified start time on the specified day of the month in N month(s).
·       Upon startup of the selected node or nodes: it will run at the specified start time if the node is started
1)  before the specified start time and 2) on or before the specified day of the month. Otherwise, it will run at the specified start time in N month(s).
·       Every N month(s) after that and 1) at the specified start time and 2) on the specified day of the month.
The <qualifier> <day> of every N month(s)
Similarly, when selected, the Job Scheduler instance runs as follows:
·       After creation: it will run at the specified start time if it is created 1) before the specified start time and
2)  on or before the specified day of the month (e.g., The first Monday of every 1 month, The last weekend day of every 3 months). Otherwise, it will run at the specified start time on the specified day of the month in N month(s).
·       Upon startup of the selected node or nodes: it will run at the specified start time if the node is started
1)  before the specified start time and 2) on or before the specified day of the month. Otherwise, it will run at the specified start time in N month(s).
·       Every N month(s) after that and 1) at the specified start time and 2) on the specified day of the month.

Yearly

When selected, you have the following options:
·       Every <month> <day>, which enables you to specify a specific month and day of the month (e.g., January 1, June 30).
·       The <qualifier> <day> of every <month>, where:
·       <qualifier> is first, second, third, fourth, or last,
·       <day> is Day, weekday, weekend day, Sunday, Monday, Tuesday, Wednesday, Thursday, Friday, or Saturday, and
·       <month> is January, February, March, etc.

You must also specify the start time of the run, including the timezone.

Every <month> <day>
When selected, the Job Scheduler instance runs as follows:
·       After creation: it will run at the specified start time if it is created 1) before the specified start time and
1)  on or before the specified date. Otherwise, it will run at the specified start time on the specified date.
·       Upon startup of the selected node or nodes: it will run at the specified start time if the node is started
1)  before the specified start time and 2) on or before the specified date. Otherwise, it will run at the specified start time on the specified date.
·       On the specified date after that and at the specified start time.
The <qualifier> <day> of every <month>
Similarly, when selected, the Job Scheduler instance runs as follows:
·       After creation: it will run at the specified start time if it is created 1) before the specified start time and
1)  on or before the specified day and month (e.g., The first Monday of every January, The last weekend day of June). Otherwise, it will run at the specified start time on the specified day and month.
·       Upon startup of the selected node or nodes: it will run at the specified start time if the node is started
1) before the specified start time and 2) on or before the specified day and month. Otherwise, it will run at the specified start time on the specified day and month.
·       On the specified day and month after that and at the specified start time.







No comments:

Post a Comment

CSV format string from a Pagelist

In our business logic often we have the requirement to convert PageList to string CSV values. From -  PageList.pxResults(1).pyLabel  = P1 Pa...