Kernel::System::Scheduler - Scheduler lib
Includes the functions to add a new task to the scheduler daemon.
create a scheduler object. Do not use it directly, instead use:
my $SchedulerObject = $Kernel::OM->Get('Kernel::System::Scheduler');
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 ... }, );
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', }, # ... );
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', }, # ... );
delete a task from scheduler future task list
my $Success = $Schedulerbject->FutureTaskDelete( TaskID => 123, );
This software is part of the OTRS project (https://otrs.org/).
This software comes with ABSOLUTELY NO WARRANTY. For details, see the enclosed file COPYING for license information (GPL). If you did not receive this file, see https://www.gnu.org/licenses/gpl-3.0.txt.