LoadSelection(Value: IDimSelectionSet): IDimSelectionSet;
LoadSelection(Value: Prognoz.Platform.Interop.Dimensions.IDimSelectionSet): Prognoz.Platform.Interop.Dimensions.IDimSelectionSet;
Value. Empty selection of the source cube, to which the selection will be loaded, according to which data cache is updated.
The LoadSelection method copies the selection, according to which data cache is updated.
Executing the example requires a scheduled task of cache update for the calculated cube. The task has the SCHEDULED_TASK identifier and it has the selection, by which the cube cache should be updated.
Sub UserProc;
Var
Metabase: IMetabase;
CubeIns: ICubeInstance;
CubInDes: ICubeInstanceDestination;
MObj: IMetabaseObject;
ScheduledTask: ICubeCacheUpdateScheduledTask;
DimSS: IDimSelectionSet;
DimS: IDimSelection;
Begin
Metabase := MetabaseClass.Active;
MObj := Metabase.ItemById("SCHEDULED_TASK").Edit;
ScheduledTask := MObj As ICubeCacheUpdateScheduledTask;
CubeIns := (ScheduledTask.SourceCube As IMetabaseObject).Open(Null) As ICubeInstance;
CubInDes := CubeIns.Destinations.FindByKey(ScheduledTask.DestKey);
DimSS := CubInDes.CreateDimSelectionSet;
//Copy selection already set for the task
DimSS := ScheduledTask.LoadSelection(DimSS);
//Change selection
For Each DimS In DimSS Do
DimS.InvertAll;
End For;
//Set new selection
ScheduledTask.SetSelection(DimSS);
MObj.Save;
End Sub UserProc;
After executing the example the specified selection will be loaded from the scheduled task and replaced with the new one.
Executing the example requires a scheduled task of cache update for the calculated cube. The task has the SCHEDULED_TASK identifier and it has the selection, by which cube cache should be updated.
Imports Prognoz.Platform.Interop.Metabase;
Imports Prognoz.Platform.Interop.Cubes;
Imports Prognoz.Platform.Interop.Dimensions;
Public Sub Main(Params: StartParams);
Var
Metabase: IMetabase;
CubeIns: ICubeInstance;
CubInDes: ICubeInstanceDestination;
MObj: IMetabaseObject;
ScheduledTask: ICubeCacheUpdateScheduledTask;
DimSS: IDimSelectionSet;
DimS: IDimSelection;
Begin
Metabase := Params.Metabase;
MObj := Metabase.ItemById["SCEDULED_TASK"].Edit();
ScheduledTask := MObj As ICubeCacheUpdateScheduledTask;
CubeIns := (ScheduledTask.SourceCube As IMetabaseObject).Open(Null) As ICubeInstance;
CubInDes := CubeIns.Destinations.FindByKey(ScheduledTask.DestKey);
DimSS := CubInDes.CreateDimSelectionSet();
//Copy the selection already set for the task
DimSS := ScheduledTask.LoadSelection(DimSS);
//Change selection
For Each DimS In DimSS Do
DimS.InvertAll();
End For;
//Set new selection
ScheduledTask.SetSelection(DimSS);
MObj.Save();
End Sub;
After executing the example the specified selection will be loaded from the scheduled task and replaced with the new one.
See also: