OpenOperationTree(Session: Integer; Operation: Integer): IAuditOperations;
Session is a number of session for which the list of operations on objects should be received. A value of the Session property should be passed as a value of the parameter.
Operation is a number of operation for which the list of operations on dependent objects should be received. If "0" is passed as a value, the method returns the list of operations that were performed within the session. If the value of the Operation property is passed as a value for any operation, the method returns the list of operations on dependent objects of the object to which this operations corresponds.
The OpenOperationTree method returns the list of operations that were performed in the repository, represented in the tree-like form.
Sub Main;
Var
MB: IMetabase;
MS: IMetabaseSecurity;
AL: IAuditLog;
ALogon: IAuditLogons;
OperatTree, OperatTreeChild: IAuditOperations;
Begin
MB := MetabaseClass.Active;
MS := MB.Security;
Al := MS.OpenAuditLog;
ALogon := AL.OpenLogons(False);
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;
End Sub Main;
After executing the example the list of operations that were performed during the last connection to the repository, is displayed in the development environment console. The list of operations is viewed 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: