Versions Compared

Key

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

...

Code Block
languagecpp
themeConfluence
EdmiError edmiRemoteNumberOfInstancesInModel(SdaiServerContext serverContextId,
                                              SdaiString        remoteRepositoryName,
                                              SdaiString        remoteModelName,
                                              SdaiString        entityName,
                                              SdaiOptions       options,
                                              SdaiString        resultFile,
                                              SdaiInvocationId  *edmiInvocationId);

Returns the number of instances of a given instance type (entity) in an edmModel in a remote EDMdatabase

...

.

...

Arguments

...

TypeNameComment
SdaiServerContext

serverContextId

Context identification, from edmiDefineServerContext

SdaiString

remoteRepositoryName

The name of the edmRepository in the remote _remote  EDMdatabase _ that containss contains the edmModel of interest. Repository names are case sensitive.

SdaiString

remoteModelName

The name of the remote edmModel of interest. Model names are case sensitive. The combination of the <remoteRepositoryName> and <remoteModelName> arguments uniquely identifies an edmModel in a remote _EDMdatabase{_}.remote  EDMdatabase

SdaiString

entityName

The name of the entity. Entity names are case insensitive.

SdaiOptions

options

See description of available options below.
Options may be joined by using bitwise OR operator

SdaiString

resultFile

The name of the file that will be written on the local file system when the option RESULT_IN_FILE is used.

SdaiInvocationId

edmiInvocationId

Currently not used.

Options: Descriptions:

Return Value

...

Insert excerpt
US:_r_EDMInterface
US:_r_EDMInterface
nopaneltrue

 

Options

...

  

NameComment

SUBTYPES

Also the instances of subtypes of the specified instance type <entityName> will be included in the count. Each subtype will not be listed individually.

ONLY_INSTANTIATED_ENTITIES

All instances of the subtypes of the specified instance type <entityName> will be counted separately. I.e, the count of each of them will be listed in an individual line in the output file.

INDIVIDUAL_SUBTYPES

Only subtypes of the instance type <entityName> that have been instanciated will be listed in the output file. This option has no effect unless combined with the option SUBTYPES.

TAB_SEPARATED_COLUMNS

The output file will have tab-separators inserted between the columns to make it easier to browse it in a spreadsheet application.

RESULT_IN_FILE

The resulting output from this function will be returned in the file given by the argument <resultFile> on the local file system.

 Returns:
A completion code of datatype EdmiError is the returned function value. The completion code has the following values:
Completion code = 0 : Operation successfully performed.
Completion code != 0: Error in operation. Completion code is an _EDMinterface_ error code. Use edmiGetErrorText to get the error text corresponding to the error code.
Example:
EdmiError rstat, error;
SdaiInteger nWrn, nErr;
SdaiServerContext myContext;
SdaiOptions options;
 
/* Create Server Context */
rstat =

Example

...

 

Code Block
languagecpp
EdmiError rstat, error;
 SdaiInteger nWrn, nErr;
 SdaiServerContext myContext;
 SdaiOptions options;
  
 /* Create Server Context */
 rstat = edmiDefineServerContext("MyContext",

...


 "Johnny", "Supervisor", "cf37ftr",

...

 
 "TCP", "9090", "MyServerHost",

...

 
 NULL, NULL, NULL, NULL, NULL, &myContext);

...

 
  
 /* Read the population into the remote database */

...


 rstat = edmiRemoteReadStepFile(myContext,

...


 "OurRemoteRepository", "OurRemoteModel",

...

 
 NULL, NULL, "c:/data/population.stp",

...

 
 NULL, "OurExpressSchema", NULL, 0,

...

 
 &nWrn, &nErr, &error, NULL);

...

 
  
 /* Count the instances of OurEntity,

...


 and all its subtypes */

...

 
 options = INDIVIDUAL_SUBTYPES;

...


 options |= TAB_SEPARATED_COLUMNS;

...


 options |= ONLY_INSTANTIATED_ENTITIES;

...


 options |= RESULT_IN_FILE;

...


 rstat = edmiRemoteNumberOfInstancesInModel(myContext,

...


 "OurRemoteRepository", "OurRemoteModel",

...

 
 "OurEntity", options,

...

 
 "c:/data/output/population.count", NULL);

...

 
 . . .

 

See also

Filter by label (Content by label)
showLabelsfalse
showSpacefalse
cqllabel = "model" and parent = "6062220"