SetCubeResult SetCube(CubeId tCube, SetCubeArg tArg)
tCube. Opened cube instance moniker.
tArg. Metadata change parameters.
The SetCube operation changes cube metadata.
This operation enables the user to change cube structure:
Set of dimensions.
Display versions.
Parameters of controlling dimensions.
To execute the operation, specify the opened cube instance moniker in the tCube parameter and specify parameters, according to which the changes must be made, in the tArg parameter. The moniker can be obtained on executing the OpenCube operation. The tArg.pattern field is used to specify the pattern of changing the cube structure, and the tArg.meta field contains updated metadata.
The operation results in the changed cube moniker and requested metadata that can be specified in the tArg.metaGet pattern.
To save the changes, execute the SaveObject or SaveObjectAs operation after the SetCube operation.
NOTE. Foresight Analytics Platform enables the user to change only standard cube structure.
The example of adding a dimension to cube structure. The request contains:
Moniker of the cube opened for edit.
Pattern indicating that a dimension must be added.
Updated metadata that contains the dimension to be added.
The response contains updated information about cube dimensions.
{ "SetCube" : { "tCube" : {
"id" : "S1!M!S!C1" }, "tArg" : { "pattern" : { "obInst" : "true", "dims" : "Add" }, "meta" :
{ "dims" : { "its" : { "it" : [ { "k" : "208", "id" : "",
"n" : "", "obDesc" : { "i" : "", "n" : "", "k" : "208", "c" : "4294967295" } } ]
} } }, "metaGet" : { "obInst" : "true", "dims" : "Get" } } } }
{ "SetCubeResult" : { "id" : { "id" : "S1!M!S!C1" }, "meta" : { "obInst" : {
"obDesc" : { "@isShortcut" : "0", "@isLink" : "0", "i" : "STD_CUBE", "n" : "Cube", "k" : "5857", "c" : "1281", "p" : "5845", "h" : "0"
} }, "dirty" : "1", "dims" : { "its" : { "it" : [ {
"k" : "5858", "id" : "FACTS", "n" : "Facts", "vis" : "1", "obDesc" : { "@isShortcut" : "0", "@isLink" : "0", "i" : "FACTS", "n" : "Facts"
"k" : "5858", "c" : "1028", "p" : "5857", "h" : "0" } }, { "k" : "112", "id" : "CALENDAR", "n" : "Calendar",
"vis" : "1", "obDesc" : { "@isShortcut" : "0", "@isLink" : "0", "i" : "CALENDAR", "n" : "Calendar", "k" : "112", "c" : "1026", "p" : "103",
"h" : "0" } }, { "k" : "116", "id" : "DIM_1", "n" : "Dim_1", "vis" : "1", "obDesc" : {
"@isShortcut" : "0", "@isLink" : "0", "i" : "DIM_1", "n" : "Dim_1", "k" : "116", "c" : "1025", "p" : "103", "h" : "0" } },
{ "k" : "991", "id" : "DIM_2", "n" : "Dim_2", "vis" : "1", "obDesc" : { "@isShortcut" : "0", "@isLink" : "0", "i" : "DIM_2",
"n" : "Dim_2", "k" : "991", "c" : "1025", "p" : "989", "h" : "0" } }, { "k" : "208", "id" : "COUNTRY",
"n" : "Country", "vis" : "1", "obDesc" : { "@isShortcut" : "0", "@isLink" : "0", "i" : "COUNTRY", "n" : "Country", "k" : "208", "c" : "4354",
"p" : "159", "h" : "0" } } ] } }, "supportsRub" : "0" } } }
public static SetCubeResult ChangeCubeStructure(CubeId moniker, Od newDim) { var somClient = new SomPortTypeClient(); //Proxy object for operation execution //Operation execution parameters var tSet = new SetCube() {
tArg = new SetCubeArg() { //Pattern that specifies whether to add dimension to cube pattern = new CubeMdPattern() { dims = ListOperation.Add, }, //Updated metadata containing new dimension meta = new CubeMd {
dims = new CubeDims { its = new CubeDim[] { new CubeDim { k = newDim.k, id = string.Empty, n = string.Empty, obDesc = new Od
{ k = newDim.k, n = string.Empty, i = string.Empty, c = uint.MaxValue } } } } },
metaGet = new CubeMdPattern() { dims = ListOperation.Get, } }, tCube = moniker }; //Change cube structure var result = somClient.SetCube(tSet); return result; }
See also: