ICubeExecuteSetup.RequiredDataRights

Syntax

RequiredDataRights: CubeDataRights;

Description

The RequiredDataRights property determines access permissions for the data, which will be returned after calculation.

Example

Executing the example requires that the repository contains a time series database with the FC_A identifier.

Sub Main;

Var

Mb: IMetabase;

Cat: IMetabaseObject;

Inst: IRubricatorInstance;

Cub: ICubeInstance;

Dest: ICubeInstanceDestination;

Exe: ICubeInstanceDestinationExecutor;

Sels: IDimSelectionSet;

Sel: IDimSelection;

Arr: Array[1] Of Integer;

Si, Sc: Integer;

Mat: IMatrix;

ExecuteResult: ICubeExecuteResult;

It: IMatrixIterator;

Coo: IMatrixCoord;

Sto: ICubeInstanceStorage;

Rights: ICubeExecuteDataRights;

Begin

Mb := MetabaseClass.Active;

Cat := Mb.ItemById("FC_A").Bind;

Inst := Cat.Open(Null) As IRubricatorInstance;

Cub := Inst As ICubeInstance;

Dest := Cub.Destinations.DefaultDestination;

Sels := Dest.CreateDimSelectionSet;

Sc := Sels.Count - 1;

For Si := 0 To Sc Do

Sel := Sels.Item(Si);

Sel.SelectAll;

End For;

Exe := Dest.CreateExecutor;

(Exe As IRubricatorFactorIO).MultipleFactors := True;

Arr[0] := 125616;

(Exe As IRubricatorFactorExecutor).SetFactorKeys(Arr);

(Sels As ICubeExecuteSetup).RequiredDataRights := CubeDataRights.ReadWrite;

Exe.PrepareExecute(Sels);

Mat := Exe.Matrix;

ExecuteResult := CubeClass.ExecuteResult(Mat);

Rights := ExecuteResult.DataRights;

If Rights <> Null Then

Exe.PerformExecute;

Mat.ValueFlag := 1;

Coo := Mat.CreateCoord;

It := Mat.CreateIterator;

It.Move(IteratorDirection.First);

While It.Valid Do

It.ValueFlag := 0;

If Rights.Rights(Coo) = CubeDataRights.ReadWrite Then

It.ValueFlag := 1;

It.Value := Math.RandBetweenI(0, 5);

End If;

It.Move(IteratorDirection.Next);

End While;

Sto := Dest.CreateStorage;

(Sto As IRubricatorFactorIO).MultipleFactors := True;

Sto.SaveMatrix(Mat, 1);

End If;

End Sub Main;

After executing the example data of time series with the 125616 key, to which the user has read and write permissions, is obtained. Then data is changed and saved.

See also:

ICubeExecuteSetup