IAuditLog.OpenOperationTree

Syntax

OpenOperationTree(Session: Integer; Operation: Integer): IAuditOperations;

Parameters

Session. Key of the session, for which it is required to get a list of operations with objects.

Operation. Number of operation, for which it is required to get a list of operations with dependent objects.

Description

The OpenOperationTree method returns the list of operations that were performed in the repository, represented in the tree-like form.

Comment

For details about repository connections see the IAuditLog.OpenLogons property. To get the current session key, use the ILogonSession.Key property.

If 0 is sent as a value of the Operation parameter, the method returns the list of operations executed during the session. If value of the IAuditOperations.Operation property is sent as a value for any operation, the method returns the list of operations with dependent objects of the object, to which the operation corresponds.

Example

To execute the example, add a link to the Metabase system assembly.

Sub UserProc;
Var
    MB: IMetabase;
    MS: IMetabaseSecurity;
    AL: IAuditLog;
    ALogon: IAuditLogons;
    OperatTree, OperatTreeChild: IAuditOperations;
    Lic: Object;
Begin
    MB := MetabaseClass.Active;
    
// Check out license to work with security manager
    Lic := MB.RequestLicense(UiLicenseFeatureType.Adm);
    MS := MB.Security;
    
// Open access protocol
    Al := MS.OpenAuditLog;
    ALogon := AL.OpenLogons(
False);
    
// Display a list of operations executed during the last connection to repository in the console
    OperatTree := Al.OpenOperationTree(ALogon.Session, 0);
    
While Not OperatTree.Eof Do
        Debug.WriteLine(OperatTree.ObjectId + 
" " + OperatTree.Name);
        OperatTreeChild := Al.OpenOperationTree(ALogon.Session, OperatTree.Operation);
        
While Not OperatTreeChild.Eof Do
            
If OperatTreeChild.Succeeded Then
                Debug.Indent;
                Debug.WriteLine(OperatTreeChild.ObjectId + 
" " + OperatTreeChild.Name + " " + OperatTreeChild.Level.ToString);
                Debug.Unindent;
                OperatTreeChild.Next;
            
End If;
        
End While;
        OperatTreeChild.Close;
        OperatTree.Next;
    
End While;
    OperatTree.Close;
    
// Check in license
    Lic := Null;
End Sub UserProc;

After executing the example the list of operations that were performed during the last connection to the repository, is displayed in the console. The list of operations will be presented as a tree. An identifier of the relevant object and an operation name are displayed for each operation. If there are operations that are connected to the objects on which any other object depends, the level of nesting is found for these operations.

See also:

IAuditLog