Scheduler#

NAME#

Kernel::System::Scheduler - Scheduler lib

DESCRIPTION#

Includes the functions to add a new task to the scheduler daemon.

PUBLIC INTERFACE#

new()#

create a scheduler object. Do not use it directly, instead use:

my $SchedulerObject = $Kernel::OM->Get('Kernel::System::Scheduler');

TaskAdd()#

add a task to scheduler

my $Success = $SchedulerObject->TaskAdd(
    ExecutionTime            => '2015-01-01 00:00:00',  # task will be executed immediately if no execution
                                                        #   time is given
    Type                     => 'GenericInterface',     # e. g. GenericInterface, Test
    Name                     => 'any name',             # optional
    Attempts                 => 5,                      # optional (default 1)
    MaximumParallelInstances => 2,                      # optional, number of tasks with the same type
                                                        #   (and name if provided) that can exists at
                                                        #   the same time, value of 0 means unlimited
    Data => {                                           # data payload
        # ...
    },
);

FutureTaskList()#

get the list of scheduler future tasks

my @List = $SchedulerObject->FutureTaskList(
    Type => 'some type',  # optional
);

Returns:

@List = (
    {
        TaskID        => 123,
        ExecutionTime => '2015-01-01 00:00:00',
        Name          => 'any name',
        Type          => 'GenericInterface',
    },
    {
        TaskID        => 456,
        ExecutionTime => '2015-01-01 00:00:00',
        Name          => 'any other name',
        Type          => 'GenericInterface',
    },
    # ...
);

TaskList()#

get the list of scheduler tasks

my @List = $SchedulerObject->TaskList(
    Type => 'some type',  # optional
);

Returns:

@List = (
    {
        TaskID => 123,
        Name   => 'any name',
        Type   => 'GenericInterface',
    },
    {
        TaskID => 456,
        Name   => 'any other name',
        Type   => 'GenericInterface',
    },
    # ...
);

FutureTaskDelete()#

delete a task from scheduler future task list

my $Success = $Schedulerbject->FutureTaskDelete(
    TaskID => 123,
);