Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Function to search all STRING data types in model for one or more specified string patternpatterns. This function must have 8,11,14,17 or 20 have variable number of arguments. The 4 set of optional arguments (stringPattern2, matchingInstances2, matchingAttributes2), (stringPattern3, matchingInstances3, matchingAttributes3),   (stringPattern4, matchingInstances4, matchingAttributes4) and (stringPattern5, matchingInstances5, matchingAttributes5) can be used to specify 4 more string patterns to search forlegal number of arguemts are  9,12,15,18 or 21 arguments.

Arguments

...

  Type   
NameComment
GENERIC
modelId 

The actual model to be search. This model must be open.

INTEGER
optionsThis argument can be specified as INDETERMINATE ("?")Optional  argument. The default option value is XPXSEARCH_INSTANCES ~| XPXSEARCH_SIMPLE_ATTRIBUTES ~| XPXSEARCH_AGGREGATES ~| XPXCASE_SENSITIVE"xpxCASE_SENSITIVE", i.e., all existing string roles will be search for matching the given string pattern by invoking xpfLike() with the option xpxCASE_SENSITIVE set.
INTEGER
maxHitsOfOneStringPattern

Optional argument. The search operation will be terminated when one of the specified search criteria is fulfilled "maxHitsOfOneStringPattern" times.default value is INDETERMINATE (?), i.e., all specified string roles will be searched before the search operation is terminated. When specified, this argument specifies the maximum hits before the search operation is terminated. The meaning of "maximum hits before the search operation is terminated" may have different interpretation according to the actual given "options" value (xpxSTOP_ON_FIRST_MATCH, xpxSTOP_ONE_ONE_REACHED_MAX_MATCH, xpxSTOP_ON_ALL_REACHED_MAX_MATCH)

SET OF GENERIC
includeOrExcludeInstanceTypeFilter 
This
Optional argument is valid when one of the options XPXEXCLUDE_FILER or XPXINCLUDE_FILTER is set and should contain a SET OF ENTITY_DEFINITION. The default value is INDETERMINATE (?). When specified, this argument should be a set of entity names and/or full qualified roles, i.e., a SET OF STRING aggregate. An entity name element repesents all roles of the specified enity, i.e., a set all roles of the specified instance type definitions. When XPXEXCLUDE. A fully qualified role has the format: "entityName.attributeName". When the option xpxINCLUDE_FILTER is set, only the roles specified in the argument "includeOrExcludeInstanceTypeFilter" specifies what instance types should not be search for the actual string pattern(s). When XPXINCLUDEincludeOrExcludeFilter" will be search. When the option xpxEXCLUDE_FILTER is set, he argument "includeOrExcludeInstanceTypeFilter" specifies what instance types should be search for the actual string pattern(s). This argument may be specified as INDETERMINATE ("?") all possible roles except those specified in the "includeOrExcludeFilter" will be searched. This argument have no effect when neither the xpxINCLUDE_FILTER nor the xpxEXCLUDE_FILTER options are set.
INTEGER
VAR index

This is both an IN and OUT value that represent a search cursor in the model. The IN value specifies where to start the current search. "index" = 1 means search from start of model, the OUT value specifies the cursor of the last match, i.e., when doing iterative searches, the next IN value of "index" should be the value of the "returned index in the previous search + 1" 

 

BOOLEAN
VAR anyMatchingInstances

TRUE when at least one matching instance is found. FALSE when no match is found. This argument can be set to indeterminate

STRING
stringPattern1

The string pattern to search for. The format of this string pattern is as specified by the EXPRESS LIKE operator. The stringPattern1 argument can contain more string patterns with logical operators in between each operand (stringPattern)

Example1: 'Like (''pattern'')'

Example2: '((LIKE(''pattern1'')) AND (NOT(LIKE(''pattern2''))))'

Optional argument. Default value is index = 1, i.e., start searching on the first possible string value. When specified, it defines the index of the first string value to be searched. The index of the "last search string value + 1" is returned when the xpxFindStringPatternInModel() operation is terminated. This functionality enables the possibility to perform a search in an iterative way, i.e., the xpxFindStringPatternInModel() function can be called in a loop using the returned "index" value from one invocation as the input "index" value in the next invocation.

BOOLEAN
VAR anyMatchingInstances

Optional argument. Default value is INDETERMINATE (?). When specified this argument will be set to TRUE when at least one hit is found in the search, else "anyMatchingInstances" will be set to FALSE

STRING
stringPattern1 ... stringPattern5

This argument can be specified in 4 different ways:

  1.          As a "string pattern" used in the xpfLike() operation that implements the actual search operation
  2.          As an EDMexpressX logical expression (string) that is used in the actual search operation
  3.          As an integer expressionId that identifies an EDMexpressX logical expression that is previously decoded by a xpfDecodeLogicalExpression() in the same EDMvmSession.
  4.          As the actual string to search for when the option xpxEXACT_EQUALS is specified.
Info
The options xpxEXACT_EQUALS and xpxEXPRESSION_CONDITION are valid for all specified "stringPattern" arguments. Hence a mix of 1 and/or 2+3 and/or 4 is invalid. Only a mix of 2 and 3 are legal in one  invocation of the xpxFindStringPatternInModel() function.

One xpxFindStringPatternInModel() operation can maximum search for 5 string patterns

LIST OF GENERIC
VAR matchingInstances1
The InstanceId of the instances matching the "stringPattern1" search criteria will returned in this LIST aggregate. The same InstanceId may occur more times in the "matchingInstances1" LIST because the actual string pattern may be found in more attributes of the same
.. matchingInstances5

This argument receives a LIST OF GENERIC with one instanceId for each hits, i.e., the number of elements in this list will be equal to the number of hits for the related "stringPattern" argument. The same instanceId may occur several times in the actual "matchingInstances" list as there may be more than one matching role in an instance.

LIST OF GENERIC
VAR matchingAttributes1
The attributeId that holds the actual string pattern will be returned in this LIST aggregate. Independent of how many occurrences of the actual pattern is found in an attribute, only one occurrence of the actual attributeId will be stored in the "matchingAttributes1" LIST aggregate. Hence this aggregate is a LIST OF UNIQUE GENERIC. An element
.. matchingAttributes5
This argument receives a LIST OF GENERIC with one attributeId (attributeId is a role) for each hits, i.e., the number of elements in this list will be equal to the number of hits for the related "stringPattern" argument. The same attributeId may occur several times in the actual "matchingAttributes" list as there may be more instances that matches the search in the same role. A pair of elements with the same index in the "matchingInstances1matchingInstances" aggregate and the "matchingAttributes1" aggregate gives the "InstanceId.AttributeId" of matchingAttributes" lists uniquely identifies the matching string value (instanceId.attributeId). When an AttributeID the attributeId is an aggregate, the actual aggregate must be search to find the element(s) holding the actual string pattern.  element index can be found by searching the aggregate. The function xpfAggrLike() is suitable for this operation.

...

Return Value

...

Insert excerpt
US:_r_XPX_Return_Value
US:_r_XPX_Return_Value
nopaneltrue

Options

...

all standard entity instances in model
 OptionComment
1XPXSEARCH_TABLE_INSTANCESSearch
XPXSEARCH_SIMPLE_ATTRIBUTESSimple attributes will be search
XPXSEARCH_AGGREGATESAggregates will be search
XPXSEARCH_TABLE_INSTANCES 
XPXSEARCH_USER_DEFINED_ENTITIES 
XPXCASE_INSENSITIVE 
XPXCASE_SENSITIVE 
XPXINCLUDE_FILTER 
XPXEXCLUDE_FILTER all columns of all persistent EDMtableInstances. NOTE: option not yet implemented!
2XPXSEARCH_USER_DEFINED_ENTITIESSearch all userDefinedEntity instances. NOTE: option not yet implemented!
3XPXCASE_INSENSITIVEUse case insensitive string comparison in the actual xpfLike() function that implements the actual search operation.
4XPXCASE_SENSITIVEUse case sensitive string comparison in the actual xpfLike() function that implements the actual search operation.
5XPXINCLUDE_FILTER

The filter specified in the "includeOrExcludeFilter" argument is an "include filter". This option has no effect when no "includeOrExcludeFilter" is specified. 

6XPXEXCLUDE_FILTERThe filter specified in the "includeOrExcludeFilter" argument is an "exclude filter". This option has no effect when no "includeOrExcludeFilter" is specified.
7xpxEXPRESSION_CONDITIONThe specified "stringPatternOrCondition" arguments is specified as an textual EDMexpressX logical expression or an integer expressionId that has been compiled by the xpfDecodeLogicalExpression() or the xpxDecodeLogicalExpression() earlier in the actual EDMvmSession.
8xpxEXCLUDE_AGGR_ROLESNo aggregate attributes (roles) will be searched.
9xpxEXCLUDE_SIMPLE_ATTR_ROLESNo simple attributes (roles) will be searched. NOTE: option not yet implemented!
10xpxEXACT_EQUALS

Search for equalness only, i.e., search for strings that are identical to the specified "stringPattern".

11xpxSTOP_ON_FIRST_MATCHThe search operation will stop on the first found match.
12xpxSTOP_ONE_ONE_REACHED_MAX_MATCHThe search will stop when the number of hits for at least one search condition is reached the max hits specified in the "maxHitsOfOneStringPattern" argument. This option has no effect when the "maxHitsOfOneStringPattern" argument is not specified.
13xpxSTOP_ON_ALL_REACHED_MAX_MATCHThe search will stop when the number of hits for all given search condition have eached the max hits specified in the "maxHitsOfOneStringPattern" argument. This option has no effect when the "maxHitsOfOneStringPattern" argument is not specified.

 

Example

...

Code Block
languagecpp
<Missing Example>

...