EventId: String;
EventId: string;
The EventId property determines identifier of the event called on occurring ETL task execution error.
To determine the method of handling the errors, which may occur on data loading, use the IEtlPlainDataBulkConsumer.ActionOnProblem property.
Executing this example requires that the repository contains an ETL task with the ETL identifier.
Add links to the Metabase and ETL system assemblies.
Sub UserProc;
Var
MB: IMetabase;
Etl: IEtlTask;
Obj: IEtlObject;
Data: IEtlPlainDataBulkConsumer;
i: Integer;
Begin
MB := MetabaseClass.Active;
Etl := MB.ItemById("ETL").Edit As IEtlTask;
For i := 0 To Etl.Count - 1 Do
Obj := Etl.Item(i);
Data := Obj As IEtlPlainDataBulkConsumer;
If (Obj Is IEtlPlainDataBulkConsumer) Then
Data.ActionOnProblem := EtlActionOnProblem.DiscardInvalidRecords;
Data.SaveInvalidRecs := True;
Data.InvalidRecsFileName := "Errors";
Data.CommitCount := 2000;
Data.UseStopLimit := True;
Data.StopLimit := 2;
Data.EventId := "CUSTOM_EVENT";
End If;
End For;
(Etl As IMetabaseObject).Save;
End Sub UserProc;
After executing the example the same parameters are set for all the consumers supporting error handling of separate transaction execution:
On executing the transactions only incorrect records will be skipped
If errors occur, all skipped records are saved into the Errors file
If more than two errors occur, task execution is stopped
The number of records processed during one transaction is 2000
If errors occur on task execution, the Starting Loading event is called.
The requirements and result of the Fore.NET example execution match with those in the Fore example.
Imports Prognoz.Platform.Interop.Metabase;
Imports Prognoz.Platform.Interop.Etl;
…
Public Shared Sub Main(Params: StartParams);
Var
MB: IMetabase;
Etl: IEtlTask;
Obj: IEtlObject;
Data: IEtlPlainDataBulkConsumer;
i: Integer;
Begin
MB := Params.Metabase;
Etl := MB.ItemById["ETL"].Edit() As IEtlTask;
For i := 0 To Etl.Count - 1 Do
Obj := Etl.Item[i];
Data := Obj As IEtlPlainDataBulkConsumer;
If (Obj Is IEtlPlainDataBulkConsumer) Then
Data.ActionOnProblem := EtlActionOnProblem.aopDiscardInvalidRecords;
Data.SaveInvalidRecs := True;
Data.InvalidRecsFileName := "Errors";
Data.CommitCount := 2000;
Data.UseStopLimit := True;
Data.StopLimit := 2;
Data.EventId := "CUSTOM_EVENT";
End If;
End For;
(Etl As IMetabaseObject).Save();
End Sub;
See also: