Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 3 Current »


 

FUNCTION xpfGetModel (repositoryId : GENERIC;
                      modelName    : STRING)
                      modelId      : GENERIC;
                

The xpfGetModel function returns the instanceId of the specified model in the argument <modelId>. A model is uniquely specified by the <repositoryId> and <modelName> arguments. If the specified model exists in the database, the modelId defining the model will be returned in the <modelId> argument.

Arguments


TypeNameComment
GENERICrepositoryIdUnique integer representing the repository in the EDMdatabase
STRINGmodelNameThe name of the model in the given repository

Return Value


 

TypeNameComment
GENERICmodelIdUnique instance id of the model

Options


 

Example


  FUNCTION copyModel(sourceModelId : GENERIC) : GENERIC;
    LOCAL
      targetModelId           : GENERIC;
      controlId               : GENERIC;
      targetModelRepositoryId : GENERIC;
    END_LOCAL;
    ON_ERROR_DO;
      xpxPrintf('\nError.');
      xpxThrow;
    END_ON_ERROR_DO;
    
    targetModelRepositoryId := xpfGetRepository('DataRepository');
    targetModelId := xpfCopyModel(sourceModelId, targetModelRepositoryId, 'NAME_OF_COPIED_MODEL');
    xpxPrintf('\ntargetModelId : %lu',targetModelId);
    controlId :=  xpfGetModel(targetModelRepositoryId,'NAME_OF_COPIED_MODEL');
    xpxPrintf('\ncontrolId : %lu',controlId);
    IF(controlId :<>: targetModelId) THEN
      xpxThrow;
    END_IF;
    
    RETURN(targetModelId);
  END_FUNCTION;

 

See also

Filter by label

There are no items with the selected labels at this time.

 

  • No labels