SetDimSelectionSchema

Syntax

DimSelectionSchemaResult SetDimSelectionSchema(OdId tOb, SetDimSelectionSchemaArgs tArg)

Parameters

tOb. Opened selection schema instance moniker.

tArg. Operation execution parameters.

Description

The SetDimSelectionSchema operation changes selection schema metadata.

Comments

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.

Example

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.

SOAP request:

<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<SetDimSelectionSchema xmlns="http://www.fsight.ru/PP.SOM.Som">
<tOb xmlns="">
  <id>S1!M!S!DSS1</id>
  </tOb>
<tArg xmlns="">
<pattern>
  <obInst>true</obInst>
  <primitives>Add</primitives>
  </pattern>
<meta>
<primitives>
<its>
<it>
  <selectionType>All</selectionType>
  </it>
  </its>
  </primitives>
  </meta>
<metaGet>
  <obInst>true</obInst>
  <primitives>Get</primitives>
  </metaGet>
  </tArg>
  </SetDimSelectionSchema>
  </s:Body>
  </s:Envelope>

SOAP response:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Body>
<SetDimSelectionSchemaResult xmlns="http://www.fsight.ru/PP.SOM.Som" xmlns:q1="http://www.fsight.ru/PP.SOM.Som" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<id xmlns="">
  <id>S1!M!S!DSS1</id>
  </id>
<meta xmlns="">
<primitives>
<its>
<it>
  <selectionType>Specified</selectionType>
  <deselect>0</deselect>
<selectedElems>
  <it>0</it>
  <it>1</it>
  <it>2</it>
  </selectedElems>
<selId>
  <id>S1!M!S!DSS3</id>
  </selId>
  </it>
<it>
  <selectionType>All</selectionType>
  <deselect>0</deselect>
  <selectedElems />
  </it>
  </its>
  </primitives>
  </meta>
  </SetDimSelectionSchemaResult>
  </soapenv:Body>
  </soapenv:Envelope>

JSON request:

{
"SetDimSelectionSchema" :
{
"tOb" :
{
"id" : "S1!M!S!DSS1"
},
"tArg" :
{
"pattern" :
{
"obInst" : "true",
"primitives" : "Add"
},
"meta" :
{
"primitives" :
{
"its" :
{
"it" :
[
{
"selectionType" : "All"
}
]
}
}
},
"metaGet" :
{
"obInst" : "true",
"primitives" : "Get"
}
}
}
}

JSON response:

{
"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:

Working with Dictionaries