MID - the modeling company Home Search Tcl Script Help Tcl Script Help Contact Support

API Commands: inosrvSelect

Purpose:

Select a set of server elements of the same type within a model.

The search can be restricted by specifying a set of characteristics.

Synopsis:

inosrvSelect rep class model type [pattern] [kind] [refentity] [language] [mode] [count]

Arguments:
rep The name of the repository which is obtained as a result of applying inoevalRequest or after applying opteval_start (variable rep). It can also be given explicitly.
class The meta model class of the server element to be searched for. This class depends on the method.
model The model which is obtained as a result of opteval_start (variable e_pm). It can also be displayed explicitly. In case someone is looking for a model itself or for a target system, then model needs not to be specified.
type type specifies how to search. The statement refers to if and how to use the parameters pattern, kind, refentity, language and mode.
In parameter descriptions, the type argument is the bold printed word in the left column.
pattern (optional) Comparison string which, depending on the preselection (type), limits the selection. If no comparison string is required, '!' can be specified.
kind (optional) A specific integer value which, depending on the preselection (type), can be used to further limit the hit quota. If no integer value is required, '!' can be specified.
refentity (optional) With refentity a server element can be specified as a reference for a more detailed search (e.g. restricting or removing elements from the hit list). The detailed usage of the parameter is given by type. If no reference element is to be used, '!' can be specified.
language (optional) With the parameter language the search (depending on the parameter type) can be further restricted due to a language dependent criterion. This parameter is mainly used in UML models, where it is a programming language. The specification can relate to the parameter pattern. It is also possible to search for example for all elements having a declarator in the specified language.
mode (optional) With the parameter mode the search (depending on the parameter type) can be further restricted due to an additional criterion. See the actual description of specific parameters for details.
count (optional) Maximum number of the desired server elements. No specification means all found elements.
Note:

The valid values for the parameters class, type, pattern, kind , refentity, language and mode are described in the method dependent sections (see Parameters for Reading Functions).

Result:

If successful, the command returns a list of found elements.

Example:

# Search for the SA process 'proces1' in the actual
# model ('e_pm' is the model, child of '1'
# corresponds to 'SAProcess')

set process1 [vo1 [inosrvSelect $myrep SAObject $e_pm BYKINDNAME "Process1" 1]]

Example for using the parameter refentity

# Selecting all OM classes that can be
# included into the OM diagram '$omdia'

set classes [inosrvSelect $myrep OMFeatures $e_pm DIAADDABLE ! ! $omdia]

# Selecting all other OM diagrams whose
# name begins with an 'A', except '$omdia'

set dias [inosrvSelect $myrep OMDiagram $e_pm BYPATTERN "A*" ! $omdia]