xpfCopyModel

FUNCTION xpfCopyModel (soureModelId            : GENERIC;  
                       targetModelRepositoryId : GENERIC; 
                       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
GENERICsoureModelIdcomments
GENERICtargetModelRepositoryId 
STRINGtargetModelName 

Return Value


 

TypeNameComment
GENERICtargetModlIdcomments

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.