IEtlTask.ActivateObject

Syntax

ActivateObject(Object: IEtlObject; Value: Boolean);

Parameters

Object. The object that must be activated or deactivated.

Value. Indicates whether the object is activated. If the parameter is set to True, the object and all dependent objects are activated. Otherwise they are deactivated.

Description

The ActivateObject method is used to include or exclude the object from chain calculation.

Comments

To determine whether the object is excluded from the chain calculation, use the IEtlTask.CanDeactivateObject method.

Example

Executing the example requires that the repository contains an ETL task with the ETL identifier. Chains of operations are set up for ETL task.

Add links to the Metabase and ETL system assemblies.

Sub UserProc;
Var
    MB: IMetabase;
    MbObj: IMetabaseObject;
    EtlTask: IEtlTask;
    Object1, Object2: IEtlObject;
    ActiveChain, CanDeactiv: Boolean;
Begin
    MB := MetabaseClass.Active;
    MbObj := MB.ItemById("ETL").Bind;
    EtlTask := (MbObj) As IEtlTask;
    // status of objects chain
    ActiveChain := EtlTask.ActiveChain(3);
    If ActiveChain = True Then
        Debug.WriteLine("Objects chain is active");
        Else Debug.WriteLine("Objects chain is not active");
    End If;
    // status of the object of calculation chain
    Object1 := EtlTask.Item(5);
    CanDeactiv := EtlTask.CanDeactivateObject(Object1);
    If CanDeactiv = False Then
        Debug.WriteLine("The object is excluded from the chain");
        Else Debug.WriteLine("The object is included into the chain");
    End If;
    // exclude or include the object when calculating chain
    Object2 := EtlTask.Item(3);
    CanDeactiv := EtlTask.CanDeactivateObject(Object2);
    If CanDeactiv = False Then
        EtlTask.ActivateObject(Object2, False);
        Else EtlTask.ActivateObject(Object2, True);
    End If;
End Sub UserProc;

After executing the example the console window displays information about the status of objects chain (active or inactive) and about the status of the object of calculation chain (included or excluded from the chain). The object of chain calculation is excluded or included for ETL task.

See also:

IEtlTask