Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

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.

...

Queries are specified from a function and optional arguments.

SyntaxExplanation
<function>Functions can be used without arguments by stating exclusively the name of the function.
<function>( argument[, argument] )Functions can optionally be specified with one or more arguments that are separated by commas.

Functions

FunctionArgumentsDefaultExplanation
isStartedstartedFrom,
startedTo, count
startedFrom=0d, startedTo=0d,  count=1
  • Scope: specifies that the workflow or job started without consideration if it completed or is still running.
  • Default Period: start on the same day.
isCompletedstartedFrom,
startedTo, completedFrom, completedTo, count
completedFrom=0d, completedTo=0d,  count=1
  • Scope: specifies that the workflow or job completed without consideration of success of failure.
  • Arguments: if the argument startedFrom is specified, then the default value of the startedTo argument is 0d.
  • Default Period: start and completion on the same day.
isCompletedSuccessfulstartedFrom,
startedTo, completedFrom, completedTo, count
completedFrom=0d, completedTo=0d,  count=1
  • Scope: specifies that the workflow or job completed successfully.
  • Arguments: if the argument startedFrom is specified, then the default value of the startedTo argument is 0d.
  • Default Period: start and completion on the same day.
isCompletedFailedstartedFrom,
startedTo, completedFrom, completedTo, count
completedFrom=0d,  completedTo=0d, count=1
  • Scope: specifies that the workflow or job failed.
  • Arguments: if the argument startedFrom is specified, then the default value of the startedTo argument is 0d.
  • Default Period: start and completion on the same day.
lastCompletedSuccessfulstartedFrom,
startedTo, completedFrom, completedTo, count
completedFrom=0d,  completedTo=0d, count=1
  • Scope: specifies that the last run of the job completed successfully.
  • Arguments: if the argument startedFrom is specified, then the default value of the startedTo argument is 0d.
  • Default Period: start and completion on the same day.
lastCompletedFailedstartedFrom,
startedTo, completedFrom, completedTo, count
completedFrom=0d,  completedTo=0d, count=1
  • Scope: specifies that the last run of the workflow or job failed.
  • Arguments: if the argument startedFrom is specified, then the default value of the startedTo argument is 0d.
  • Default Period: start and completion on the same day.
lastCompletedSuccessful

startedFrom,
startedTo, completedFrom, completedTo, count

completedFrom=0d,  completedTo=0d, count=1
  • Scope: specifies that the last run of the workflow or job completed successfully.
  • Arguments: if the argument startedFrom is specified, then the default value of the startedTo argument is 0d.
  • Default Period: start and completion on the same day.

...

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

Anchor
arguments
arguments
Arguments

The CheckHistoryJob template accepts the following arguments:

NameRequiredDefault ValuePurpose
queryyesn/a

Specifies the expression that is used to look up the execution history, for example isCompleted, isCompletedSuccessful etc., for the full list see Queries.

workflow

non/a

Specifies the name of a workflow for which the execution history is looked up. A workflow name or job name has to be specified.

jobnon/aSpecifies the name of a job for which the execution history is looked up. A workflow name or job name has to be specified.
controller_idnon/aThe identifier of a Controller can be specified to limit results to workflows and jobs executed with the indicated Controller.

Anchor
return_variables
return_variables
Return Variables

The CheckHistoryJob template returns the following variables:

...

The CheckHistoryJob template can be used to implement job dependencies backward job dependencies:

  • 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

Image Added


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:

        Image Added

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

        Image Added

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