QPR Knowledge Base 2017.1

SetModelProperty

SetModelProperty

Previous topic Next topic No directory for this topic  

SetModelProperty

Previous topic Next topic Topic directory requires JavaScript Mail us feedback on this topic!  

Revision history:

Introduced in QPR 7.4.1 SP3

Last changed in QPR 2012.2

 

Sets a property value for the model property specified in the function call.

 

Synopsis:

 

PGModel.SetModelProperty(PropertyName, Value)

 

Parameters:

 

PropertyName: String. Name of the property for which the value will be set. Supported properties:

ModelPublished: Defines whether the model is published in QPR Portal. True = published, False = not published.

HideUnusedBaseModelElements: Defines whether all unused base model elements should be hidden. True = unused elements are hidden, False = unused elements are shown (default behavior). Note that setting this property value requires the model to be reserved exclusively. In the case the reservation is non-exclusive, the script tries to change the reservation type and a confirmation is asked from the user, but in the case the script is run in silent mode, the change is done automatically and RV_MODEL_HAS_TO_BE_OPEN_FOR_EXCLUSIVE_EDITING error is returned in the case the reservation cannot be changed.

VersionNumber: String. Sets the model's version information Version Number as string.

Author: String. Sets the model's version information Author as string.

Comment: String. Sets the model's version information Comment as string.

Status: Int (enum). Sets the model's version information Status as enumeration index value (integer). Default model enumerations: Draft = 0, Current State = 1, Proposal = 2, Approved = 3, Implemented = 4

ModelVersionManagement: Int (enum). Sets version management mode (i.e. save behavior) for the model. Supported values: 0 = off, 1 = save changes to the current version, 2 = save as new model version. 3 = prompt.

Value: Variant value of the property being set.

 

Required Rights:

 

Administrator or model administrator.

 

Return Values:

Below are listed the return values that this function can return:

 

RV_SUCCESS

RV_APPLICATION_QUIT_CALLED

RV_MODEL_NOT_OPEN

RV_MODEL_IS_NOT_SERVER_MODEL

RV_NO_RIGHTS_TO_MODEL

RV_NOT_CONNECTED_TO_SERVER

RV_CANNOT_SET_PROPERTY_TO_CHECKED_OUT_MODEL

RV_MODEL_HAS_BRANCHES_OR_MULTIPLE_MODEL_VERSIONS

RV_CAN_SET_PROPERTY_ONLY_TO_LATEST_MODEL_VERSION

RV_MODEL_DOES_NOT_USE_BASE_MODEL

RV_MODEL_HAS_TO_BE_OPEN_FOR_EXCLUSIVE_EDITING

RV_INVALID_PARAMETER

RV_UNKNOWN_ERROR

RV_FUNCTION_CANNOT_BE_USED_IN_VALIDATION_SCRIPT

 

Example Procedure:

 

iResult = PGModel.SetModelProperty("ModelPublished", true)