IMetabaseObjectDescriptor.GetChangesHistory

Syntax

GetChangesHistory(Start: DateTime; End_: DateTime): IAuditOperations;

GetChangesHistory(Start: DateTime; @End: DateTime): Prognoz.Platform.Interop.Metabase.IAuditOperations;

Parameters

Start. Start date.

End. End date.

Description

The GetChangesHistory method returns collection of access protocol records containing information about actions made with objects during specified period of time.

Example

Executing the example requires that the repository contains an object with the Obj_1 identifier.

Add a link to the Metabase system assembly.

Sub UserProc;
Var
    MB: IMetabase;
    MDesc: IMetabaseObjectDescriptor;
    Operations: IAuditOperations;
    Start, End_: DateTime;
Begin
    MB := MetabaseClass.Active;
    MDesc := MB.ItemById("Obj_1");
    End_ := DateTime.Now;
    Start := DateTime.AddDays(End_, -10);
    Operations := MDesc.GetChangesHistory(Start, End_);
    While Not Operations.Eof Do
        Debug.WriteLine(Operations.Name + " " + Operations.Logon.UserName);
        Operations.Next;
    End While;
End Sub UserProc;

Public Shared Sub Main(Params: StartParams);
Var
    MB: IMetabase;
    MDesc: IMetabaseObjectDescriptor;
    Operations: IAuditOperations;
    Start, @End: DateTime;
Begin
    MB := Params.Metabase;
    MDesc := MB.ItemById["Obj_1"];
    @End := DateTime.Now;
    Start := @End.AddDays(-10);
    Operations := MDesc.GetChangesHistory(Start, @End);
    While Not Operations.Eof() Do
        System.Diagnostics.Debug.WriteLine(Operations.Name + " " + Operations.Logon.UserName);
        Operations.Next();
    End While;
End Sub;

Executing the example returns access protocol records containing list of actions with the specified object for the last ten days. The name of actions and users who made them are displayed to the development environment console.

See also:

IMetabaseObjectDescriptor