Versions Compared

Key

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

NAME

Add-JobSchedulerEvent

SYNOPSIS

Adds an event to a JobScheduler instance.

SYNTAX

Add-JobSchedulerEvent [-EventClass <String>] -EventId <String> [-ExitCode <Int32>] [-AllowedExitCodes <Int32[]>
] [-Job <String>] [-JobChain <String>] [-Order <String>] [-MasterUrl <Uri>] [-SupervisorUrl <Uri>] [[-Supervi
sorJobChain] <String>] [-ExpirationDate <DateTime>] [-ExpirationCycle <String>] [-ExpirationPeriod <String>] [-No
Expiration] [-Parameters <Hashtable>] <CommonParameters>

DESCRIPTION

Events can be added to a JobScheduler Master or Supervisor instance that implements event handling.

Should the JobScheduler Master or Supervisor not be accessible then events are stored in
the local file %TEMP%\jobscheduler_events.xml for later dequeueing. Subsequent calls to this
cmdlet will dequeue any previously stored events.

PARAMETERS

EventClass

-EventClass <String>
Specifies a common name for a set of events that enable event handlers to process multiple events of the
same class. For example, "daily_closing" could be an event class for jobs that should start once day-time
business processes have drawn to a close.

Specifies a unique identifier when used together with the -EventId parameter.

Required? false
Position? 1
Default value
Accept pipeline input? true (ByPropertyName)
Accept wildcard characters?

EventId

-EventId <String>
An identifier for an event. Allows event handlers to react to events having a particular ID.

Specifies a unique identifier when used together with the -EventClass parameter. An event id is required to be uniq
ue
for the same event class.

Required? true
Position? 2
Default value
Accept pipeline input? true (ByPropertyName)
Accept wildcard characters?

ExitCode

-ExitCode <Int32>
Specifies the exit code that is added to the event. Usually this signals the execution status of a job,
however, you can assign a specific numeric exit code.

Without this parameter being used the $LastExitCode is implicitely assumed, i.e. the last exit code
that was provided from a command or program.

Consider that exit codes other than 0 signal failed execution. You can specify allowed exit codes
with the -AllowedExitCodes parameter.

Default: last script exit code or failed execution of previous command.

Required? false
Position? 3
Default value
Accept pipeline input? true (ByPropertyName)
Accept wildcard characters?

AllowedExitCodes

-AllowedExitCodes <Int32[]>
Specifies a list of exit codes that signal that a job is considered as having run successfully.
This is useful if job scripts provide return values in the form of exit codes and these codes
should not be considered as errors. When adding an event then any exit codes that match one of the
allowed exit codes are set to 0.

A range of allowed exit codes is specified by e.g -AllowedExitCodes 1..4 or -AllowedExitCodes 1,2,3,4.

Required? false
Position? 4
Default value
Accept pipeline input? true (ByPropertyName)
Accept wildcard characters?

Job

-Job <String>
Specifies the name of the job that is assigned to the event.

Default: the current job name if the cmdlet is used by a job.

Required? false
Position? 5
Default value
Accept pipeline input? true (ByPropertyName)
Accept wildcard characters?

JobChain

-JobChain <String>
Specifies the name of the job chain that is assigned to the event.

Default: the current job chain name if the cmdlet is used by a job chain.

Required? false
Position? 6
Default value
Accept pipeline input? true (ByPropertyName)
Accept wildcard characters?

Order

-Order <String>
Specifies the identifier of the order assigned to the event.

Default: the current order identification (order id) if the cmdlet is used by a job chain.

Required? false
Position? 7
Default value
Accept pipeline input? true (ByPropertyName)
Accept wildcard characters?

MasterUrl

-MasterUrl <Uri>
Specifies the Job Scheduler Master instance URL.

The URL consists of the protocol, host name and port, e.g. http://localhost:4454.

Default: If used with a job then the CLI will assign by default the JobScheduler Master that the job is running for
otherwise the JobScheduler Master as specified with the Use-JobSchedulerMaster cmdlet will be used.

Required? false
Position? 8
Default value
Accept pipeline input? true (ByPropertyName)
Accept wildcard characters?

SupervisorUrl

-SupervisorUrl <Uri>
Specifies a Job Scheduler Supervisor instance URL.

Job Scheduler Master instances register with a JobScheduler Supervisor (if configured to do so)
in order to synchronize job configurations. The Supervisor instance receives events, executes the
event handler and starts jobs and job chains for registered JobScheduler Master instances.

The URL consists of the protocol, host name and port, e.g. http://localhost:4454.

Default: If used with a job then the CLI will assign by default the JobScheduler Supervisor that the
current JobScheduler Master is registered for and otherwise assign the JobScheduler Master.

Required? false
Position? 9
Default value
Accept pipeline input? true (ByPropertyName)
Accept wildcard characters?

SupervisorJobChain

-SupervisorJobChain <String>
Specifies the path of the job chain in the JobScheduler Master or Supervisor instance that implements the event
processor.

Default: /sos/events/scheduler_event_service

Required? false
Position? 10
Default value
Accept pipeline input? true (ByPropertyName)
Accept wildcard characters?

ExpirationDate

-ExpirationDate <DateTime>
Specifies the point in time for which an event automatically expires: this parameter is considered by the
Event Processor. A specific point in time can be specified by use of the ISO date format, i.e. yyyy-MM-dd HH:mm:ss.
The value 'never' ensures that the event does not ever expire.

The parameters -ExpirationDate, -ExpirationCycle, -ExpirationPeriod, -NoExpiration may not be used at the same time
.

Default: 00:00 on the following day.

Required? false
Position? 11
Default value
Accept pipeline input? true (ByPropertyName)
Accept wildcard characters?

ExpirationCycle

-ExpirationCycle <String>
Specifies the time for which the event will expire in the current period.
Periods start at 00:00 and end at 24:00. An expiration cycle of 21:00
specifies 9pm of the current cycle for event expiration.

Values are specified by use of the format HH:mm:ss.

The parameters -ExpirationDate, -ExpirationCycle, -ExpirationPeriod, -NoExpiration may not be used at the same time
.

Required? false
Position? 12
Default value
Accept pipeline input? true (ByPropertyName)
Accept wildcard characters?

ExpirationPeriod

-ExpirationPeriod <String>
Specifies the duration after which the event will expire in the current period.
Periods start at 00:00 and end at 24:00. An expiration period of 04:00
specifies that the event will expire 4 hours starting from the current point in time.

Values are specified by use of the format HH:mm:ss.

The parameters -ExpirationDate, -ExpirationCycle, -ExpirationPeriod, -NoExpiration may not be used at the same time
.

Required? false
Position? 13
Default value
Accept pipeline input? true (ByPropertyName)
Accept wildcard characters?

NoExpiration

-NoExpiration <SwitchParameter>
Specifies that an event will not expire. Such events have to be removed by event action scripts.

Required? false
Position? named
Default value
Accept pipeline input? true (ByPropertyName)
Accept wildcard characters?

Parameters

-Parameters <Hashtable>
Allows additional parameters for event handlers to be specified. Parameters are created using name-value
pairs from a hashmap as e.g. @{'name1'='value1'; 'name2'='value2'}.

Parameter names can be freely chosen and event handlers configured to
take account of values handed over. Any number of parameters can be added.

Required? false
Position? 14
Default value
Accept pipeline input? true (ByPropertyName)
Accept wildcard characters?

about_jobscheduler

EXAMPLES

-------------------------- EXAMPLE 1 --------------------------

C:\PS>Add-JobSchedulerEvent -EventClass daily_closing -EventId 12345678

Creates an event with the specified event class and event id.

-------------------------- EXAMPLE 2 --------------------------

C:\PS>Add-JobSchedulerEvent -EventClass daily_closing -EventId 12345678 -AllowedExitCodes 1..4

Creates an event with the specified event class and event id. The exit code is implicitely added
from the global $LastExitCode value. Should the exit code be contained in the list of
allowed exit codes then its value is set to 0.

-------------------------- EXAMPLE 3 --------------------------

C:\PS>Add-JobSchedulerEvent -EventClass daily_closing -EventId 12345678 -ExpirationPeriod 04:00

Creates an event that will expire 4 hrs. from now.

-------------------------- EXAMPLE 4 --------------------------

C:\PS>Add-JobSchedulerEvent -EventClass daily_closing -EventId 12345678 -ExpirationCycle 21:00

Creates an event that will expire at 9pm of the current day.

-------------------------- EXAMPLE 5 --------------------------

C:\PS>Add-JobSchedulerEvent -EventClass daily_closing -EventId 12345678 -ExpirationDate (Get-Date).AddDays(2)

Creates an event that will expire two days later.

-------------------------- EXAMPLE 6 --------------------------

C:\PS>Add-JobSchedulerEvent -EventClass daily_closing -EventId 12345678 -Parameters @
{'name1'='value1'; 'name2'='value2
'}

Creates an event with two additional parameters from a hashtable.