IMetabaseUpdateProgress.OnResolve

Syntax

OnResolve(Node: IMetabaseUpdateNode; Resolver: IMetabaseUpdateResolver);

Parameters

Node. Update object.

Resolver. Collection of dependencies.

Description

The OnResolve method implements an event that occurs if there are dependencies of updating on the source repository objects that are not present in the destination repository.

Example

Executing the example requires that the repository contains an object with the CUBEMETAUPD identifier that contains settings for copying a time series database. The repository should also contain a time series database with the FC identifier.

Sub Main;
Var
    MB: IMetabase;
    RubUpdateEx: ICubeMetaUpdateEx;
    Progress: MyUpdateProgress;
Begin
    MB := MetabaseClass.Active;
    RubUpdateEx := MB.ItemById("CUBEMETAUPD").Bind As ICubeMetaUpdateEx;
    Progress := New MyUpdateProgress.Create;
    RubUpdateEx.Apply(Progress);
End Sub Main;
Class MyUpdateProgress: UpdateProgress
    Public Sub OnResolve(Node: IMetabaseUpdateNode; Resolver: IMetabaseUpdateResolver);
    Var
        Unresolv: IMetabaseUpdateUnresolved;
        i: Integer;
        MB: IMetabase;
    Begin
        MB := MetabaseClass.Active;
        Debug.WriteLine("OnResolve");
        For i := 0 To Resolver.Count - 1 Do
            Unresolv := Resolver.Item(i);
            If Unresolv.ClassId = MetabaseObjectClass.KE_CLASS_RUBRICATOR Then
                Debug.WriteLine("Id: " + Unresolv.Id);
                Debug.WriteLine("Name: " + Unresolv.Name);
                Debug.WriteLine("Key: " + Unresolv.Key.ToString);
                Debug.WriteLine("Description: " + Unresolv.Description);
                Debug.WriteLine("KeepResolve: " + Unresolv.KeepResolve.ToString);
                Unresolv.ResolveObject := MB.ItemById("FC");
                Debug.WriteLine("---");
            End If;
        End For;
    End Sub OnResolve;
End Class MyUpdateProgress;

After executing the example, the time series database is copied according to the settings contained in the CUBEMETAUPD object. The MyUpdateProgress custom class is used for handling the events that occur during copying. If during copying there is a dependency from source repository time series database that does not exist in destination repository this dependency is removed, information about it is displayed in the console window.

See also:

IMetabaseUpdateProgress