QPR Knowledge Base

CreateCopy

Hide Navigation Pane

CreateCopy

Previous topic Next topic No expanding text in this topic  

CreateCopy

Previous topic Next topic JavaScript is required for expanding text Mail us feedback on this topic!  

Comments (...)

Revision history:

Introduced in QPR 8.0

 

Creates a copy of an object referred to by FullId. Copies can be created from elements and element instances. If FullId refers to an element, a copy of the element is created with one default instance (one in parent process step). If FullId refers to an element's instance, a copy of the instance is created for the element.

 

Synopsis:

 

PGModel.CreateCopy(FullId, Name, Parameters, out FullId)

 

Parameters:

 

FullId (Integer) | (String): FullId of the element or element instance to be copied. Mandatory. No Default value.

Name: String. Name of the element.

Parameters: A semicolon-separated list of parameters for creating a new element. The supported parameters:

ParentElement=<ParentId>: Defines the parent in element hierarchy. If omitted, the new element gets the same parent element as the original one. Note that ParentElement can be set only for the element types that have the ParentElement attribute.
ProcessLevel=<PS level Id>: Defines the process level where the default first instance is created. If omitted, the new element gets the same process level as the original one.
OrganizationUnit=<Organization Unit Id>: Defines the organization unit where the default first instance is created. Note that the organization unit must be instantiated to the process level that is defined with the ProcessLevel= parameter. Instance graphical properties are set automatically so that the instance is placed inside the organization unit lanes. If omitted, the new element gets the same organization as the original one.
InstanceGraphicalProperties=<startpoint.X>,<startpoint.Y>,<height>,<width>: Defines the graphical position and size of the first default instance. Some of the properties can be separately left empty. However, both <startpoint.X> and <startpoint.Y> must be set if position is needed to be set. If <startpoint.X> and <startpoint.Y> are set, these override the possible automatic Organization unit placement. If omitted, the new element gets the same graphical properties as the original one.
FullId: Integer. Id of the created element or instance. Note that id an element is copied, the FullId is in form "<ElementId>".

 

Required Rights:

 

Modify rights to the process level.

 

Return Values:

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

 

RV_SUCCESS

RV_INVALID_PARAMETER

RV_ELEMENT_NOT_FOUND

RV_ELEMENT_IS_NOT_SUBPROCESS

RV_APPLICATION_QUIT_CALLED

RV_MODEL_NOT_OPEN

RV_CANNOT_CREATE_ELEMENT

 

Example Procedure:

 

iResult = PGModel.CreateCopy(sFullIdPrefix + CStr(iStoreId), "Copy of Test Store", "InstanceGraphicalProperties=50,50,100,50;ProcessLevel=" +CStr(iSubprocessId), iStoreCopyId)

Comments (...)