You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 2 Next »

Introduction

FEATURE AVAILABILITY STARTING FROM RELEASE 2.5.6

FEATURE AVAILABILITY STARTING FROM RELEASE 2.6.3

The JITL CheckLicenseJob template can be used to automate monitoring of the JS7 - License expiration.

Usage

When defining the job either:

  • invoke the Wizard that is available from the Job Properties tab in the Configuration view and select the JITL CheckLicenseJob and relevant arguments from the Wizard

or

  • specify the JITL job class and com.sos.jitl.jobs.checklicense.CheckLicenseJob Java class name and add arguments specifying what order states to transition..

Example

Download (upload .json): pduCheckLicenseJITL.workflow.json

You can use the job wizard like this:


Explanation:

  • Add an empty job from the instruction panel.
  • Specify a name and a label for the job.
  • Select an Agent.

In a next step invoke the job wizard that you find in the upper right corner of the job property editor. The wizard brings up the following popup window:


Explanation:

  • From the list of available job templates select the CheckLicenseJob.

Then hit the Next button to make the job wizard display available arguments:



Explanation:

  • Optional Arguments
    • validity_days : Specifies the number of days for which the license should be valid.
      • The job will terminate with return code 3 if the license will expire within the given number of days.
      • The job will terminate with return code 2 if the license is expired.
  • Note that the the check box provided with each argument has to be selected the argument is to be added to the arguments of the CheckHistoryJob template.

When hitting the Submit button the wizard adds the required arguments to the job which should look like this:


The job arguments can be specified:

Documentation

The Job Documentation including the full list of arguments can be found from: https://www.sos-berlin.com/doc/JS7-JITL/CheckLicenseJob.xml

Arguments

The CheckLicenseJob template accepts the following arguments:

NameRequiredDefault ValuePurpose
validity_dateno60

Specifies the number of days for which the license should be valid. 

Return Variables

The CheckHistoryJob template returns the following variables:

Return VariableData TypePurposeExample
returnCodenumber

Signals the license check result:

  • Return code 3 signals that the license will expire within the given number of days.
  • Return code 2 signals that the license is expired.


subjectstring

The subject for an e-mail that can be send from a subsequent job:

  • For return code 3 the subject variable  holds the following value:
    • JS7 JobScheduler Notification: license expiration warning
  • For return code 2 the subject variable  holds the following value:
  • JS7 JobScheduler Notification: license expired


bodystring

The body for an e-mail that can be send from a subsequent job. The body return variable holds the output of the CheckHistoryJob  job.

.. Licence tpye: COMMERCIAL_VALID
.. license valid: true
.. License valid from: Wed May 05 12:22:41 GMT 2021
.. License valid to: Mon May 04 12:22:41 GMT 2026

Alert Workflow

The CheckLicenseJob template can be used to implement a workflow to alert about license expiration:

  • Jobs based on the CheckHistoryJob template do not fail if the underlying query does not return results.
  • Instead, the CheckHistoryJob template provides Return Variables that can be inspected to determine further execution of jobs in a workflow.
  • JS7 offers the JS7 - If Instruction to check the values of Return Variables and to decide what instructions to execute next.

Download (upload .json): pdwCheckHistory.workflow.json


Explanation:

  • Arguments of the CheckHistoryJob template include to specify the query and workflow that is looked up in the execution history.
  • The query isCompletedSuccessful checks if the indicated workflow was successfully executed during the current day.


Explanation:

  • The JS7 - If Instruction is used to check the $returnValue return variable that carries
    • the value 0 if the query of the CheckHistoryJob template returns one or more hits.
    • the value 1 if the query of the CheckHistoryJob template returns no hits.
    • Alternative solutions include to check the value of the $js7CheckHistoryResult return variable for a Boolean value that indicates if the query did return any hits:
      • $js7CheckHistoryResult == true
      • $js7CheckHistoryResult == false
  • The above example executes a successor job based on the result of the CheckHistoryJob. Such jobs have access to any Return Variables:
    • If the successor job is a Shell job then
      • Return Variables can be mapped to environment variables like this:



      • the job script can make use of environment variables like this:



    • If the successor job is a JVM job then Return Variables can be accessed directly.

Further Resources



  • No labels