...
Code Block | ||||
---|---|---|---|---|
| ||||
FUNCTION xpfCopyModelBN (sourceNodelRepositoryName : STRING;
sourceModelName : STRING;
targetModelRepositoryName : STRING;
targetModelName : STRING)
targetModlId : GENERIC;
|
The xpfCopyModel function makes a copy of a model, i.e. creates a new model and copies all instances in the source model, specified by the arguments <sourceModelRepositoryName> and <sourceModelName> argument <sourceModelId> to the new model (target model), specified by the arguments <targetModelRepositoryName> attributes <targetModelRepositoryId> and <targetModelName>. Model and repository names are case sensitive.
The function returns the <targetModelId> after the copy operation. This function is only applicable to data models. The executing EDMuser must have read access to the source model. The source model will be unchanged by this operation. The source model can be open or closed when this function is executed.
The new created target model will have the same underlying schema as the source model, i.e. the source and target model will be two different populations of the same Express schema.
This function is equivalent to the EDMinterface function edmiCopyModelBN.
See also xpxCopyModelBN.
Arguments
...
Type | Name | Comment |
STRING | sourceNodelRepositoryName | comments |
STRING | sourceModelName | |
STRING | targetModelRepositoryName | |
STRING | targetModelName |
Return Value
...
Type | Name | Comment |
GENERIC | targetModlId | comments |
Options
...
Example
...
Code Block | ||
---|---|---|
| ||
FUNCTION createModel(sourceModelName: STRING) : GENERIC;
LOCAL
targetModelId : GENERIC;
controlId : GENERIC;
END_LOCAL;
ON_ERROR_DO;
xpxPrintf('\nError.');
xpxThrow;
END_ON_ERROR_DO;
targetModelId := xpfCopyModelBN('DataRepository', sourceModelName, 'DataRepository', 'NAME_OF_COPIED_MODEL');
xpxPrintf('\ntargetModelId : %lu',targetModelId);
controlId := xpfGetModelBN('DataRepository','NAME_OF_COPIED_MODEL');
xpxPrintf('\ncontrolId : %lu',controlId);
IF(controlId :<>: targetModelId) THEN
xpxThrow;
END_IF;
RETURN(targetModelId);
END_FUNCTION; |
See also
Filter by label (Content by label) | ||||||
---|---|---|---|---|---|---|
|