IScheduledEvents.Item

Syntax

Item(Index: Integer): IScheduledEvent;

Parameters

Index is an index of the task execution event.

Description

The Item property returns parameters of the task execution event, index of which is passed by the Index property.

Example

Executing the example requires that the repository contains a scheduled tasks container with the TASK_CONTAINTER identifier.

Sub Main;
Var
    MB: IMetabase;
    Cont: IScheduledTasksContainer;
    Tasks: IMetabaseObjectDescriptors;
    Invoke: IScheduledInvoke;
    Events: IScheduledEvents;
    TaskEvent: IScheduledEvent;
    i: Integer;
Begin
    MB := MetabaseClass.Active;
    Cont := MB.ItemById("TASK_CONTAINTER").Bind As IScheduledTasksContainer;
    Tasks := Cont.Tasks;
    Invoke := Cont.CreateInvokeEvent(DateTime.Now);
    Events := (Invoke As IScheduledEvents);
    For i := 0 To Events.Count - 1 Do
        TaskEvent := Events.Item(i);
        Debug.WriteLine(TaskEvent.StartDateTime.ToString + " " + Tasks.FindByKey(TaskEvent.TaskKey).Name);
    End For;
End Sub Main;

After executing the example the list of events execution of which is scheduled in the scheduled tasks container is displayed in the development environment console. The time of event execution start and name of executing task are displayed.

See also:

IScheduledEvents