ActivateObject(Object: IEtlObject; Value: Boolean);
ActivateObject(Object: Prognoz.Platform.Interop.KeEtl.IEtlObject; Value: Boolean);
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.
The ActivateObject method is used to include or exclude the object from chain calculation.
To determine whether the object is excluded from the chain calculation, use the IEtlTask.CanDeactivateObject method.
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 chain calculation object
Object1 := EtlTask.Item(5);
CanDeactiv := EtlTask.CanDeactivateObject(Object1);
If CanDeactiv = False Then
Debug.WriteLine("Object is excluded from the chain");
Else Debug.WriteLine("Object is included to the chain");
End If;
// exclude/include object from chain calculation
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.
The requirements and result of the Fore.NET example execution match with those in the Fore example.
Imports Prognoz.Platform.Interop.Etl;
…
Public Shared Sub Main(Params: StartParams);
Var
MB: IMetabase;
MbObj: IMetabaseObject;
EtlTask: IEtlTask;
Object1, Object2: IEtlObject;
ActiveChain, CanDeactiv: Boolean;
Begin
MB := Params.Metabase;
MbObj := MB.ItemById["ETL"].Bind();
EtlTask := (MbObj) As IEtlTask;
// status of objects chain
ActiveChain := EtlTask.ActiveChain[3];
If ActiveChain = True Then
System.Diagnostics.Debug.WriteLine("Objects chain is active");
Else System.Diagnostics.Debug.WriteLine("Objects chain is not active");
End If;
// status of chain calculation object
Object1 := EtlTask.Item[5];
CanDeactiv := EtlTask.CanDeactivateObject(Object1);
If CanDeactiv = False Then
System.Diagnostics.Debug.WriteLine("Object is excluded from the chain");
Else System.Diagnostics.Debug.WriteLine("Object is included to the chain");
End If;
// exclude/include object from chain calculation
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;
See also: