xpfCopyModelBN

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 argument <sourceModelId> to the new model (target model), specified by the attributes <targetModelRepositoryId> and <targetModelName>. 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.

Arguments


TypeNameComment
STRINGsourceNodelRepositoryNamecomments
STRINGsourceModelName 
STRINGtargetModelRepositoryName 
STRINGtargetModelName 

Return Value


 

TypeNameComment
GENERICtargetModlIdcomments

Options


 

Example


  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

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