Incremental: Boolean;
Incremental: boolean;
The Incremental property determines whether data of the MDM dictionary is added on import.
Available values:
True. New items are added to the list of dictionary elements on import. The dictionary contains both its own and imported elements.
False. Default value. The list of dictionary elements is cleared before import. The dictionary contains only imported elements.
Executing the example requires the MDM repository with the NSI_1 identifier that contains an MDM dictionary with the Dict_1 identifier. The database set for the MDM repository, contains the TabImport table. Names of the table fields must match the names of basic attributes of the Dict_1 dictionary.
Add links to the Metabase, Rds system assemblies.
Sub UserProc;
Var
MB: IMetabase;
MObj: IMetabaseObject;
Dict: IRdsDictionary;
DictInst: IRdsDictionaryInstance;
Import: IRdsImportSchemas;
SchemaImport: IRdsImportSchema;
Attrs: IRdsAttributes;
Begin
MB := MetabaseClass.Active;
MObj := MB.ItemByIdNamespace("Dict_1", MB.ItemById("NSI_1").Key).Edit;
Dict := MObj As IRdsDictionary;
Attrs := Dict.Attributes;
Import := Dict.ImportSchemas;
SchemaImport := Import.Add;
SchemaImport.Id := "Import1";
SchemaImport.Name := "Import scheme №1";
SchemaImport.Incremental := True;
SchemaImport.Mappings(Attrs.Key).FieldName := "Key";
SchemaImport.Mappings(Attrs.Name).FieldName := "Name";
SchemaImport.Mappings(Attrs.Order).FieldName := "Ord";
SchemaImport.Mappings(Attrs.ParentKey).FieldName := "Parent_key";
SchemaImport.TableName := "TabImport";
MObj.Save;
DictInst := Dict.Open(Null);
DictInst.ImportData(SchemaImport);
End Sub UserProc;
After executing the example a new import scheme is created in the MDM dictionary. Names of dictionary attributes are exported from the TabImport table fields with the same names. After saving data is imported in accordance with settings of a created scheme. MDM dictionary data is added on import.
Executing the example requires the MDM repository with the NSI_1 identifier that contains an MDM dictionary with the Dict_1 identifier. The database set for the MDM repository, contains the TabImport table. Names of the table fields must match the names of basic attributes of the Dict_1 dictionary.
Imports Prognoz.Platform.Interop.Rds;
…
Public Shared Sub Main(Params: StartParams);
Var
MB: IMetabase;
MObj: IMetabaseObject;
Dict: IRdsDictionary;
DictInst: IRdsDictionaryInstance;
Import: IRdsImportSchemas;
SchemaImport: IRdsImportSchema;
Attrs: IRdsAttributes;
Begin
MB := Params.Metabase;
MObj := MB.ItemByIdNamespace["Dict_1", MB.ItemById["NSI_1"].Key].Edit();
Dict := MObj As IRdsDictionary;
Attrs := Dict.Attributes;
Import := Dict.ImportSchemas;
SchemaImport := Import.Add();
SchemaImport.Id := "Import1";
SchemaImport.Name := Import scheme #1;
SchemaImport.Incremental := True;
SchemaImport.Mappings[Attrs.Key].FieldName := "Key";
SchemaImport.Mappings[Attrs.Name].FieldName := "Name";
SchemaImport.Mappings[Attrs.Order].FieldName := "Ord";
SchemaImport.Mappings[Attrs.ParentKey].FieldName := "Parent_key";
SchemaImport.TableName := "TabImport";
MObj.Save();
DictInst := Dict.Open(Null);
DictInst.ImportData(SchemaImport);
End Sub;
After executing the example a new import scheme is created in the MDM dictionary. Names of dictionary attributes are exported from the TabImport table fields with the same names. After saving data is imported in accordance with settings of a created scheme. MDM dictionary data is added on import.
See also: