Task: IEtlTask;
The Task property returns the ETL task, in which an object is created.
The use of the property may result in memory leak.
To prevent memory leak:
Do not use global variables to store property value.
When working with a property in a class, use local variables of class properties or methods.
Executing this example requires that the repository contains an ETL task with the OBJ_ETL identifier.
Add links to the Metabase and ETL system assemblies.
Sub UserProc;
Var
MB: IMetabase;
Etl: IEtlTask;
EtlObj: IEtlObject;
Count: Integer;
Begin
MB := MetabaseClass.Active;
// Get ETL task
Etl := MB.ItemById("OBJ_ETL").Edit As IEtlTask;
EtlObj := Etl.Item(0);
// Display the number of ETL task objects in the console
Count := EtlObj.Task.Count;
Debug.WriteLine("Number of ETL task objects: " + Count.ToString);
End Sub UserProc;
Imports Prognoz.Platform.Interop.Metabase;
Imports Prognoz.Platform.Interop.Etl;
…
Public Shared Sub Main(Params: StartParams);
Var
MB: IMetabase;
Etl: IEtlTask;
EtlObj: IEtlObject;
Count: Integer;
Begin
MB := Params.Metabase;
// Get ETL task
Etl := MB.ItemById["OBJ_ETL"].Edit() As IEtlTask;
EtlObj := Etl.Item[0];
// Display the number of ETL task objects in the console
Count := EtlObj.Task.Count;
System.Diagnostics.Debug.WriteLine("Number of ETL task objects: " + Count.ToString());
End Sub;
After executing the example the console displays the number of ETL task objects.
See also: