EventsNode: IMetabaseUpdateObjectNode;
The EventsNode property determines an update unit.
Executing the example requires that the repository contains a unit with MODULE identifier, and the NSI MDM repository containing the DICT MDM dictionary. Unit structure corresponds to the structure of the update unit.
Add a link to the Metabase system assembly.
Sub UserProc;
Var
Mb: IMetabase;
MUpdate: IMetabaseUpdate;
RootFolder: IMetabaseUpdateFolderNode;
Node: IMetabaseUpdateObjectNode;
DNode: IMetabaseUpdateDataObjectNode;
Begin
Mb := MetabaseClass.Active;
MUpdate := Mb.CreateUpdate;
RootFolder := MUpdate.RootFolder;
//Update unit
Node := RootFolder.Add(MetabaseUpdateNodeType.Object) As IMetabaseUpdateObjectNode;
Node.Object := Mb.ItemById("MODULE");
MUpdate.EventsNode := Node;
//MDM dictionary
DNode := RootFolder.Add(MetabaseUpdateNodeType.DataObject) As IMetabaseUpdateDataObjectNode;
DNode.Method := MetabaseUpdateMethod.All;
DNode.Object := MB.ItemByIdNamespace("DICT",MB.ItemById("NSI").Key);
DNode.ReferenceConstraintsHandling:= UpdateDataConstraintsHandlingType.Ask;
DNode.UpdatePart := MetabaseObjectUpdatePart.DataMetadataSD;
MUpdate.SaveToFileNF("C:\Update.pefx");
End Sub UserProc;
After executing the example a new update is created. A unit and an MDM dictionary are included in the update. The unit is updated as an update unit.
See also: