Checkout and Download
To modify an object from the commonspace, you must check out the object. The process of checking out communicates your intention to modify a design to the Windchill server. The object in the database is locked, so that other users can obtain read-only copies of the object, and are prevented from modifying the object while you have checked it out.
Checkout is often accompanied by a download action, where the objects are brought from the server-side workspace to the local workspace cache. In Creo Object TOOLKIT C++, both operations are covered by the same set of methods.
Methods Introduced:
The method pfcServer::CheckoutObjects checks out and optionally downloads the object to the workspace based on the configuration specifications of the workspace. The input arguments of this method are as follows:
Mdl—Specifies the object to be checked out. This is applicable if the model has already been retrieved without checking it out.
File—Specifies the top-level object to be checked out.
Checkout—The checkout flag. If you specify the value of this argument as true, the selected object is checked out. Otherwise, the object is downloaded without being checked out. The download action enables you to bring read-only copies of objects into your workspace. This allows you to examine the object without locking it.
Options—Specifies the checkout options object. If you pass NULL as the value of this argument, then the default Creo checkout rules apply. Use the method pfcCheckoutOptions::Create to create a new pfcCheckoutOptions object.
Use the method pfcServer::CheckoutMultipleObjects to check out and download multiple objects to the workspace based on the configuration specifications of the workspace. This method takes the same input arguments as listed above, except for Mdl and File. Instead it takes the argument Files that specifies the sequence of the objects to check out or download.
* 
Creo Object TOOLKIT C++ methods do not support the AS_STORED configuration.
By using an appropriately constructed options argument in the above functions, you can control the checkout operation. Use the APIs listed above to modify the checkout options. The checkout options are as follows:
Dependency—Specifies the dependency rule used while checking out dependents of the object selected for checkout. The types of dependencies given by the ServerDependency class are as follows:
pfcSERVER_DEPENDENCY_ALL—All the objects that are dependent on the selected object are downloaded, that is, they are added to the workspace.
pfcSERVER_DEPENDENCY_REQUIRED—All the objects that are required to successfully retrieve the selected object in the CAD application are downloaded, that is, they are added to workspace.
pfcSERVER_DEPENDENCY_NONE—None of the dependent objects from the selected object are downloaded, that is, they are not added to workspace.
IncludeInstances—Specifies the rule for including instances from the family table during checkout. The type of instances given by the pfcServerIncludeInstances class are as follows:
pfcSERVER_INCLUDE_ALL—All the instances of the selected object are checked out.
pfcSERVER_INCLUDE_SELECTED—The application can select the family table instance members to be included during checkout.
pfcSERVER_INCLUDE_NONE—No additional instances from the family table are added to the object list.
SelectedIncludes—Specifies the sequence of URLs to the selected instances, if IncludeInstances is of type SERVER_INCLUDE_SELECTED.
Version—Specifies the version of the checked out object. If this value is set to NULL, the object is checked out according to the current workspace configuration.
Download—Specifies the checkout type as download or link. The value download specifies that the object content is downloaded and checked out, while link specifies that only the metadata is downloaded and checked out.
Readonly—Specifies the checkout type as a read-only checkout. This option is applicable only if the checkout type is link.
The following truth table explains the dependencies of the different control factors in the method pfcServer::CheckoutObjects and the effect of different combinations on the end result.
Argument checkout in pfcServer::CheckoutObjects
pfcCheckoutOptions::SetDownload
pfcCheckoutOptions::SetReadonly
Result
true
true
NA
Object is checked out and its content is downloaded.
true
false
NA
Object is checked out but content is not downloaded.
false
NA
true
Object is downloaded without checkout and as read-only.
false
NA
false
Not supported
Was this helpful?