DimSelectionSchemaResult SetDimSelectionSchema(OdId tOb, SetDimSelectionSchemaArgs tArg)
tOb. Opened selection schema instance moniker.
tArg. Operation execution parameters.
The SetDimSelectionSchema operation changes selection schema metadata.
To execute the operation, in the tOb field specify moniker of opened selection schema instance, and in the tArg field specify operation execution parameters. In the tArg.pattern field specify the pattern that will be used to make changes in selection schema, and in the tArg.meta field specify the updated metadata. The moniker can be obtained on executing the OpenDimSelectionSchema operation. To set up primitives selection, use the ChangeDimSelection operation. To save changes, use the SaveObject operation.
The operation results in the updated metadata of selection schema if the tArg.metaGet field was defined.
Below is the example of adding a new primitive for selection schema. The request contains selection schema instance, template specifying that primitive has to be added and updated metadata containing settings of new primitive. The response contains the updated list of all selection schema primitives.
{
"SetDimSelectionSchema" :
{
"tOb" :
{
"id" : "S1!M!S!DSS1"
},
"tArg" :
{
"pattern" :
{
"obInst" : "true",
"primitives" : "Add"
},
"meta" :
{
"primitives" :
{
"its" :
{
"it" :
[
{
"selectionType" : "All"
}
]
}
}
},
"metaGet" :
{
"obInst" : "true",
"primitives" : "Get"
}
}
}
}
{
"SetDimSelectionSchemaResult" :
{
"id" :
{
"id" : "S1!M!S!DSS1"
},
"meta" :
{
"primitives" :
{
"its" :
{
"it" :
[
{
"selectionType" : "Specified",
"deselect" : "0",
"selectedElems" :
{
"it" :
[
"0",
"1",
"2"
]
},
"selId" :
{
"id" : "S1!M!S!DSS3"
}
},
{
"selectionType" : "All",
"deselect" : "0",
"selectedElems" : ""
}
]
}
}
}
}
}
public static DimSelectionSchemaResult AddPrimitive(string moniker, DimSelectionSchemaPrimitive primitive)
{
var somClient = new SomPortTypeClient(); //Proxy object for operation execution
//Operation execution parameters
var tSet = new SetDimSelectionSchema()
{
tOb = new OdId() { id = moniker },
tArg = new SetDimSelectionSchemaArgs()
{
pattern = new DimSelectionSchemaMdPattern()
{
primitives = ListOperation.Add
},
meta = new DimSelectionSchemaMd()
{
primitives = new DimSelectionSchemaPrimitives()
{
its = new DimSelectionSchemaPrimitive[1]
{
primitive
}
}
},
metaGet = new DimSelectionSchemaMdPattern()
{
primitives = ListOperation.Get
}
}
};
//Change primitive settings
var result = somClient.SetDimSelectionSchema(tSet);
return result;
}
See also: