Class_: Integer;
The Class_ property determines the class of the task that is executed in task scheduler.
An individual queue is formed for each task class in the scheduler. The number of streams is distributed by "equal parts" between the task classes.
Executing the example requires that the repository contains a scheduled tasks container with the TASK_CONTAINER identifier.
Sub UserProc;
Var
MB: IMetabase;
CrInfo: IMetabaseObjectCreateInfo;
MObj: IMetabaseObject;
Exe: IExecuteSubScheduledTask;
Per: IScheduledTaskPeriodDaily;
Prop: IScheduledTaskProperties;
Date: DateTime;
Begin
MB := MetabaseClass.Active;
CrInfo := MB.CreateCreateInfo;
CrInfo.ClassID := MetabaseObjectClass.KE_CLASS_TASK_EXECUTESUB;
CrInfo.Id := "MODULE_EXECUTOR";
CrInfo.Name := "Unit execution";
CrInfo.Parent := MB.ItemById("TASK_CONTAINER");
MObj := MB.CreateObject(CrInfo).Edit;
Exe := MObj As IExecuteSubScheduledTask;
Exe.Assembly := (MB.ItemById("Module_1").Bind As IModule).Assembly;
Exe.SubName := "Main";
Prop := Exe.Properties;
Per := Prop.CreatePeriod(ScheduledTaskPeriodType.Daily) As IScheduledTaskPeriodDaily;
Per.EveryDays := 3;
Date := DateTime.Now;
Per.StartDateTime := Date.Compose(Date.Year, Date.Month, Date.Day, 12, 0, 0, 0);
Per.StopDateTime := DateTime.AddMonths(Per.StartDateTime, 2);
Prop.Period := Per;
Prop.Class_:=2;
MObj.Save;
End Sub UserProc;
After executing the example the unit execution task named Unit Execution is created and is given class 2.
See also: