IAuditOperations.Position

Syntax

Position: Integer;

Position: uinteger;

Description

The Position property returns the number of operation execution relatively to the operation that is connected with the dependent object.

Comments

It is relevant for the operation that was executed on some object as a result of executing operations on the object that depends on it. Operations list has to have a tree view.

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: IAuditOperations;
    Lic: Object;
Begin
    MB := MetabaseClass.Active;
    
// Get license to work with security manager
    Lic := MB.RequestLicense(UiLicenseFeatureType.Adm);
    MS := MB.Security;
    
// Open access protocol
    Al := MS.OpenAuditLog;
    ALogon := AL.OpenLogons(
False);
    OperatTree := Al.OpenOperationTree(ALogon.Session, 
0);
    
// Display to the console description of the operation executed under object
    While Not OperatTree.Eof Do
        Debug.WriteLine(OperatTree.ObjectId + 
" " + OperatTree.Name);
        Debug.Indent;
            Debug.WriteLine(
"Session number: " + OperatTree.Session.ToString);
            Debug.WriteLine(
"Object name: " + OperatTree.ObjectName);
            Debug.WriteLine(
"Object class: " + OperatTree.ObjectClass.ToString);
            Debug.WriteLine(
"Object key: " + OperatTree.ObjectKey.ToString);
            Debug.WriteLine(
"Operation number: " + OperatTree.Operation.ToString);
            Debug.WriteLine(
"Comment to operation: " + OperatTree.Comment);
            Debug.WriteLine(
"Operation mask: " + OperatTree.Mask.ToString);
            Debug.WriteLine(
"Operation number towards operation linked to depending object: " + OperatTree.Position.ToString);
            Debug.WriteLine(
"Nesting level: " + OperatTree.Level.ToString);
        Debug.Unindent;
        OperatTree.Next;
    
End While;
    OperatTree.Close;
    
// Check in license
    Lic := Null;
End Sub UserProc;

Imports Prognoz.Platform.Interop.ForeSystem;

Public Shared Sub Main(Params: StartParams);
Var
    MB: IMetabase;
    MS: IMetabaseSecurity;
    AL: IAuditLog;
    ALogon: IAuditLogons;
    OperatTree: IAuditOperations;
    Lic: Object;
Begin
    MB := Params.Metabase;
    
// Get license to work with security manager
    Lic := MB.RequestLicense(UiLicenseFeatureType.lftAdm);
    MS := MB.Security;
    
// Open access protocol
    Al := MS.OpenAuditLog();
    ALogon := AL.OpenLogons(
False);
    OperatTree := Al.OpenOperationTree(ALogon.Session, 
0);
    
// Display to the console description of the operation executed under object
    While Not OperatTree.Eof() Do
        System.Diagnostics.Debug.WriteLine(OperatTree.ObjectId + 
" " + OperatTree.Name);
        System.Diagnostics.Debug.Indent();
            System.Diagnostics.Debug.WriteLine(
"Session number: " + OperatTree.Session.ToString());
            System.Diagnostics.Debug.WriteLine(
"Object name: " + OperatTree.ObjectName);
            System.Diagnostics.Debug.WriteLine(
"Object class: " + OperatTree.ObjectClass.ToString());
            System.Diagnostics.Debug.WriteLine(
"Object key: " + OperatTree.ObjectKey.ToString());
            System.Diagnostics.Debug.WriteLine(
"Operation number: " + OperatTree.Operation.ToString());
            System.Diagnostics.Debug.WriteLine(
"Comment to operation: " + OperatTree.Comment);
            System.Diagnostics.Debug.WriteLine(
"Operation mask: " + OperatTree.Mask.ToString());
            System.Diagnostics.Debug.WriteLine(
"Operation number towards operation linked to dependent object: " + OperatTree.Position.ToString());
            System.Diagnostics.Debug.WriteLine(
"Nesting level: " + OperatTree.Level.ToString());
        System.Diagnostics.Debug.Unindent();
        OperatTree.Next();
    
End While;
    OperatTree.Close();
    
// Check in license
    Lic := Null;
End Sub;

After executing the example the list of operations of the access protocol that were performed during the last connection to the platform, is displayed in the development environment console. The list of operations will be presented as a tree. An identifier of the relevant object, an operation name and other parameters are displayed for each operation.

See also:

IAuditOperations