IScheduledTaskAuditAlert.ClassId

Fore Syntax

ClassId: Integer;

Fore.NET Syntax

ClassId: integer;

Description

The ClassId property determines identifier of repository object type.

Comments

To check value of this property, use the MetabaseObjectClass.

To determine identifier of repository object, use the IScheduledTaskAuditAlert.ObjectId property.

Fore Example

Executing the example requires:

Task settings must be determined on the Schedule tab:

Add links to the Metabase, Fore system assemblies.

Sub UserProc;
Var
    MB: IMetabase;
    cont: IScheduledTasksContainer;
    task: IScheduledTask;
    prop: IScheduledTaskProperties;
    alerts: IScheduledTaskAlerts;
    alert: IScheduledTaskAlert;
    AuditAlert: IScheduledTaskAuditAlert;
Begin
    MB := metabaseClass.Active;
    cont := MB.ItemById("TASK_CONTAINER").Edit As IScheduledTasksContainer;
    task := cont.Tasks.Item(0).Edit As IScheduledTask;
    prop := task.Properties;
    alerts := prop.Alerts;
    alerts.Clear;
    alert := alerts.Add(ScheduledTaskAlertType.Audit);
    AuditAlert := alert As IScheduledTaskAuditAlert;
    AuditAlert.ClassId := 1281// Standard cube
    AuditAlert.Operation := 2097152// Save data
    AuditAlert.Result := ScheduledAlertAuditResult.Succeeded;
    AuditAlert.UserName := "UserName";
    AuditAlert.Station := "Station";
    AuditAlert.UserNameOS := "UserNameOS";
    (task As IMetabaseObject).Save;
End Sub UserProc;

After executing the example the After System Event task performing frequency option is set, and the following parameters are set:

Fore.NET Example

The requirements and result of the Fore.NET Example execution match with those in the Fore Example. Connect the KeFore system assembly instead of the Fore system assembly.

Imports Prognoz.Platform.Interop.Metabase;
Imports Prognoz.Platform.Interop.KeFore;

Public Shared Sub Main(Params: StartParams);
Var
    MB: IMetabase;
    cont: IScheduledTasksContainer;
    task: IScheduledTask;
    prop: IScheduledTaskProperties;
    alerts: IScheduledTaskAlerts;
    alert: IScheduledTaskAlert;
    AuditAlert: IScheduledTaskAuditAlert;
Begin
    MB := Params.Metabase;
    cont := MB.ItemById["TASK_CONTAINER"].Edit() As IScheduledTasksContainer;
    task := cont.Tasks.Item[0].Edit() As IScheduledTask;
    prop := task.Properties;
    alerts := prop.Alerts;
    alerts.Clear();
    alert := alerts.Add(ScheduledTaskAlertType.statAudit);
    AuditAlert := alert As IScheduledTaskAuditAlert;
    AuditAlert.ClassId := 1281// Standard cube
    AuditAlert.Operation := 2097152// Save data
    AuditAlert.Result := ScheduledAlertAuditResult.staarSucceeded;
    AuditAlert.UserName := "UserName";
    AuditAlert.Station := "Station";
    AuditAlert.UserNameOS := "UserNameOS";
    (task As IMetabaseObject).Save();
End Sub;

See also:

IScheduledTaskAuditAlert