AllRdsDatabase(RdsDatabase: IRdsDatabase): IRdsDictionaryConverterList;
AllRdsDatabase(RdsDatabase: Prognoz.Platform.Interop.Rds.IRdsDatabase): Prognoz.Platform.Interop.Rds.IRdsDictionaryConverterList;
RdsDatabase. MDM repository.
The AllRdsDatabase method checks MDM repository and returns the list of MDM dictionaries converted to table MDM dictionaries.
To convert all MDM dictionaries to table MDM dictionaries, use the IRdsDictionaryConverter.ConvertAll method.
Executing the example requires an MDM repository with the 16008 key that contains MDM dictionaries required to convert to table MDM dictionaries.
Add links to the Metabase, Rds system assemblies.
Sub UserProc;
Var
RDS_DB: IRdsDatabase;
Converter: IRdsDictionaryConverter;
List: IRdsDictionaryConverterList;
NotConv: IMetabaseObjectDescriptors;
pReasons: IRdsNotConvertibleReasons;
pReason: IRdsNotConvertibleReason;
i, j: Integer;
Begin
RDS_DB := MetabaseClass.Active.Bind(16008) As IRdsDatabase;
Converter := New RdsDictionaryConverter.Create;
List := Converter.AllRdsDatabase(RDS_DB);
NotConv := List.NotConvertibleDictionaries;
For i := 0 To NotConv.Count - 1 Do
pReasons := List.GetNotConvertibleReasons(NotConv.Item(i).Key);
Debug.WriteLine("Total errors: " + pReasons.Count.ToString);
For j := 0 To pReasons.GetExplanation.Length - 1 Do
pReason := pReasons.Item(j);
Debug.WriteLine("Error code: " + pReason.Reason.ToString);
Debug.WriteLine(" Reason: " + pReason.GetExplanation);
End For;
End For;
End Sub UserProc;
Imports Prognoz.Platform.Interop.Metabase;
Imports Prognoz.Platform.Interop.Rds;
…
Public Shared Sub Main(Params: StartParams);
Var
RDS_DB: IRdsDatabase;
Converter: IRdsDictionaryConverter;
List: IRdsDictionaryConverterList;
NotConv: IMetabaseObjectDescriptors;
pReasons: IRdsNotConvertibleReasons;
pReason: IRdsNotConvertibleReason;
i, j: Integer;
Begin
RDS_DB := Params.Metabase.Bind(16008) As IRdsDatabase;
Converter := New RdsDictionaryConverter.Create();
List := Converter.AllRdsDatabase(RDS_DB);
NotConv := List.NotConvertibleDictionaries;
For i := 0 To NotConv.Count - 1 Do
pReasons := List.GetNotConvertibleReasons(NotConv.Item[i].Key);
System.Diagnostics.Debug.WriteLine("Total errors: " + pReasons.Count.ToString());
For j := 0 To pReasons.GetExplanation().Length - 1 Do
pReason := pReasons.Item[j];
System.Diagnostics.Debug.WriteLine("Error code: " + pReason.Reason.ToString());
System.Diagnostics.Debug.WriteLine(" Reason: " + pReason.GetExplanation());
End For;
End For;
End Sub;
After executing the example the console window displays the following:
The number of reasons, due to which MDM dictionary cannot be converted to table MDM dictionary.
Error code and explanation of the reason, due to which MDM dictionary cannot be converted to table MDM dictionary.
See also: