IRepositoryScriptManager.Operation

Syntax

Operation: RepositoryOperationType;

Operation: Prognoz.Platform.Interop.KeFore.RepositoryOperationType;

Description

The Operation property determines the operation that should be performed with repository.

Comments

Operation will be applied for the repository specified in the Repository property after activation of the Execute method.

Example

Executing the example requires the ORCL server named Test. Platform repository was created within the TestSchema scheme on the server. The root of disk C contains the "current.rm4" and "current_rds.rm4" files that includes the script used to create and update the repository and MDM repository.

Sub UserProc;
Var
    Rsm: IRepositoryScriptManager;
    Driv: IDalDriver;
    ConDesc: IDalConnectionDescriptor;
    Params: IDalConnectionDescriptorParams;
    Con: IDalConnection;
Begin
    
//Connection to schema on the Oracle server
    Driv := New DalOrcl8Driver.Create As IDalDriver;
    ConDesc := Driv.CreateDescriptor;
    Params := ConDesc.Params;
    Params.Find(
"User Name").Value := "TestSchema";
    Params.Find(
"Password").Value := "TestSchema";
    Params.Find(
"Host BSTR").Value := "Test";
    Params.Find(
"Schema").Value := "TestSchema";
    Con := ConDesc.CreateConnection;
    
//Repository manager settings
    Rsm := New RepositoryScriptManager.Create;
    Rsm.Connection := Con;
    Rsm.Driver := RepositoryDriverType.ORCL9;
    Rsm.Operation := RepositoryOperationType.Update;
    
//Repository update
    Rsm.Repository := RepositoryType.Metabase;
    Rsm.LoadScript(
New FileStream.Create("c:\current.rm4", FileOpenMode.Read, FileShare.Exclusive));
    Rsm.Execute(
Null);
    
//Update MDM repository
    Rsm.Repository := RepositoryType.RDS;
    Rsm.LoadScript(
New FileStream.Create("c:\current_rds.rm4", FileOpenMode.Read, FileShare.Exclusive));
    Rsm.Execute(
Null);
End Sub UserProc;

Imports System.IO;
Imports Prognoz.Platform.Interop.Dal;
Imports Prognoz.Platform.Interop.KeFore;

Public Shared Sub Main(Params: StartParams);
Var
    Rsm: IRepositoryScriptManager = 
New RepositoryScriptManagerClass();
    Driv: IDalDriver = 
New DalOrcl8DriverClass();
    ConDesc: IDalConnectionDescriptor;
    DalParams: IDalConnectionDescriptorParams;
    Con: IDalConnection;
Begin
    
//Connection to schema on the Oracle server
    ConDesc := Driv.CreateDescriptor();
    DalParams := ConDesc.Params;
    DalParams.Find(
"User Name").Value := "TestSchema";
    DalParams.Find(
"Password").Value := "TestSchema";
    DalParams.Find(
"Host BSTR").Value := "Test";
    DalParams.Find(
"Schema").Value := "TestSchema";
    Con := ConDesc.CreateConnection();
    
//Repository manager settings
    Rsm.Connection := Con;
    Rsm.Driver := RepositoryDriverType.repwelknodritypORCL9;
    Rsm.Operation := RepositoryOperationType.repopetypUpdate;
    
//Repository update
    Rsm.Repository := RepositoryType.reptypMetabase;
    Rsm.LoadScript(
New FileStream("c:\current.rm4", FileMode.Open, FileAccess.Read));
    Rsm.Execute(
Null);
    
//Update MDM repository
    Rsm.Repository := RepositoryType.reptypRDS;
    Rsm.LoadScript(
New FileStream("c:\current_rds.rm4", FileMode.Open, FileAccess.Read));
    Rsm.Execute(
Null);
End Sub;

Update of the repository version and MDM repository version in accordance with the "current.rm4" and "current_rds.rm4" files takes place after executing this example.

See also:

IRepositoryScriptManager