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
Type | Name | Comment |
GENERIC | repositoryId | Unique integer representing the repository in the EDMdatabase |
STRING | modelName | The name of the model in the given repository |
Return Value
Type | Name | Comment |
GENERIC | modelId | Unique 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.