ObjectId: String;
The ObjectId property determines an identifier of the object that is updated.
By default a property value corresponds with an object identifier, added to the update from the repository. Value of this property can be changed in order to change identifier of the object under updating, or for updating another object, if the update type by identifier is used.
Public Class CUpdateEvents: UpdateEvents
Public Sub OnBeginUpdate(Update: IMetabaseUpdate);
Begin
Debug.WriteLine("Beginning of update of repository objects");
End Sub OnBeginUpdate;
Public Sub OnBeforeApplyUpdate(Update: IMetabaseUpdate);
Var
MB: IMetabase;
Root: IMetabaseUpdateFolderNode;
Node: IMetabaseUpdateNode;
ObjectNode: IMetabaseUpdateObjectNode;
i: Integer;
Begin
MB := MetabaseClass.Active;
If MB.Security.Policy.ObjectsIdFormat <> "" Then
Root := Update.RootFolder;
For i := 0 To Root.Count - 1 Do
Node := Root.Item(i);
If Node.NodeType = MetabaseUpdateNodeType.Object Then
ObjectNode := Node As IMetabaseUpdateObjectNode;
ObjectNode.ObjectId := MB.GenerateId(ObjectNode.ObjectId);
End If;
End For;
End If;
End Sub OnBeforeApplyUpdate;
Public Sub OnEndUpdate(Update: IMetabaseUpdate);
Begin
Debug.WriteLine("Update of objects is completed");
End Sub OnEndUpdate;
End Class CUpdateEvents;
This example is a template for update module. Before update application, the presence of a set identifiers formatting in the repository will be audited. If identifiers formatting is set, new identifiers will be generated according to this formatting for root update objects that correspond with repository objects.
See also: