FindSpecialObjectsNode: IMetabaseUpdateFindSpecialObjectsNode;
FindSpecialObjectsNode: Prognoz.Platform.Interop.Metabase.IMetabaseUpdateFindSpecialObjectsNode;
The FindSpecialObjectsNode method searches for the object that determines special object update options.
If the object is not found, the empty value is returned and the object is not created.
To create a new object that determines special object update options, use the IMetabaseUpdate.SpecialObjectsNode property.
Executing the example requires the Update.pefx update file.
Add a link to the Metabase system assembly.
Sub Main;
Var
MB: IMetabase;
MS: IMetabaseSecurity;
Update: IMetabaseUpdate;
SpecialObjNode: IMetabaseUpdateSpecialObjectsNode;
Begin
// Get access to repository
MB := MetabaseClass.Active;
MS := MB.Security;
Update := Mb.CreateUpdate;
Update.LoadFromFileNF("C:\Update.pefx");
// Check if update contains special object
SpecialObjNode := Update.FindSpecialObjectsNode;
If SpecialObjNode <> Null Then
Debug.WriteLine("Update contains special object");
Else
SpecialObjNode := Update.SpecialObjectsNode;
SpecialObjNode.ApplyObject(MetabaseSpecialObject.SharedParams) := True;
End If;
Update.SaveToFileNF("C:\Update.pefx");
End Sub Main;
Imports Prognoz.Platform.Interop.Metabase;
…
Public Shared Sub Main(Params: StartParams);
Var
MB: IMetabase;
MS: IMetabaseSecurity;
Update: IMetabaseUpdate;
SpecialObjNode: IMetabaseUpdateSpecialObjectsNode;
Begin
// Get access to repository
MB := Params.Metabase;
MS := MB.Security;
Update := MB.CreateUpdate();
Update.LoadFromFileNF("C:\" + "Update.pefx", UpdateLoadMode.ulmReplace);
// Check if update contains special object
SpecialObjNode := Update.FindSpecialObjectsNode();
If SpecialObjNode <> Null Then
System.Diagnostics.Debug.WriteLine("Update contains special object");
Else
SpecialObjNode := Update.SpecialObjectsNode;
SpecialObjNode.ApplyObject[MetabaseSpecialObject.msoSharedParams] := True;
End If;
Update.SaveToFileNF("C:\" + "Update.pefx");
End Sub;
After executing the example the global variables are added to the update loaded from the Update.pefx file:
The repeated example execution displays the message in the console:
Update contains special object
See also: