bool SemanticLayerCheckPattern(string mon, SemanticLayerPatternArg tArg)
mon. Moniker for working with preconfigured DBMS connection templates.
tArg. Settings of checked preconfigured DBMS connection template.
The SemanticLayerCheckPattern operation checks connection to the DBMS, which settings are stored in preconfigured template.
To execute the operation, in the mon field specify moniker of opened data model instance with the !Patterns postfix, and in the tArg.index field specify key of checked template. The moniker can be obtained on executing the OpenSemanticLayer operation. Template key will be available in results of the SemanticLayerGetPatterns operation.
The operation results in the logical true if DBMS connection was checked successfully. If connection is unavailable, an exception is thrown that should be handled in application code.
Below is the example of checking connection to the DBMS, which settings are stored in preconfigured template. The request contains moniker for working with preconfigured templates and template key. The response contains whether check was successful.
{
"SemanticLayerCheckPattern" :
{
"mon" : "KPACNCCOCDBDGOAEFDJDAIBAMJFFBCDEDJLPICPCMCFDIKCG!M!S!PLDNOFGCOCDBDGOAEMEKOCGKLAEFDMALEOIGKKCECKAAGLFHC!Patterns",
"tArg" :
{
"index" : "358187"
}
}
}
{
"SemanticLayerCheckPatternResult" : "1"
}
public static bool SemanticLayerCheckPattern(string moniker, int? patternIndex)
{
var somClient = new SomPortTypeClient(); // Proxy object for operation execution
// Operation execution parameters
var tCheck = new SemanticLayerCheckPattern()
{
tArg = new SemanticLayerPatternArg()
{
index = patternIndex
},
// Moniker for working with preconfigured templates
mon = moniker + "!Patterns"
};
// Check DBMS connection
var result = somClient.SemanticLayerCheckPattern(tCheck);
return result;
}
See also: