Handling Working Copies in WRS Entity Sets
This section describes how working copies (for example, private checkouts, PDM checkouts, and one‑off versions) are handled in Windchill REST Services (WRS) search and entity set responses.
WRS supports multiple mechanisms that influence whether original copies, working copies, or both are returned in query results. These mechanisms include:
• A server-side configuration property: replaceWithWorkingCopiesInEntitySetResults
• A client-side query parameter: showWorkingCopy
• Special handling for filtering by object ID
• Additional rules for PDM checkouts
Configuration Property: replaceWithWorkingCopiesInEntitySetResults
This wrs property controls whether WRS replaces original copies with their corresponding working copies in entity set results.
When set to true (default), replaces original copies with working copies. $filter and $orderby always apply to the original copies, regardless of the value of the property:
• Working copies are returned.
• Filtering on a working copy’s field value returns no results.
• Filtering on an original copy’s field value returns the working copy.
When set to false, does not return working copies and behaves similarly to Advanced Search:
• Results include only original copies.
• Working copies are not returned.
• Filtering on a working copy’s field value returns no results.
• Filtering on an original copy’s field value returns the original copy.
Query Parameter: showWorkingCopy
This boolean type query parameter explicitly controls whether working copies are included in the response and how filtering is applied.
When showWorkingCopy=true, working copies are requested directly from the Search Service. Filtering and sorting are applied to working copy values. When showWorkingCopy=true is specified, it takes precedence over the replaceWithWorkingCopiesInEntitySetResults property.
• Results include working copies that the user has access to.
• Filtering is applied only on working copy field values.
• Filtering on a working copy’s field value returns that working copy.
• Filtering on an original copy’s field value:
◦ Returns no results for the owner of the working copy
◦ Returns the original copy for other users (assuming access)
When showWorkingCopy=false (default), working copies are not explicitly requested from the Search Service. Filtering and sorting are applied to original copy values, even if working copies are included in the response:
• Behavior depends on the value of replaceWithWorkingCopiesInEntitySetResults.
• If replaceWithWorkingCopiesInEntitySetResults=true, working copies are returned but filtering applies only to original copies.
• If replaceWithWorkingCopiesInEntitySetResults=false, only original copies are returned and filtering applies only to original copies.
Filtering by Object ID
When filtering by ID, the following rules apply:
• The requested ID is always returned as long as the user has access to the object.
• The values of replaceWithWorkingCopiesInEntitySetResults and showWorkingCopy are irrelevant when filtering by ID.
• Both original version IDs and working copy IDs are supported.
Precedence Rules
When both controls are present, the following precedence rules apply:
|
showWorkingCopy
|
replaceWithWorkingCopiesInEntitySetResults
|
Results Returned
|
Filtering Applied On
|
|
false
|
true
|
Working copies
|
Original copies
|
|
true
|
true
|
Working copies
|
Working copies
|
|
true
|
false
|
Working copies
|
Working copies
|
|
false
|
false
|
Original copies
|
Original copies
|
PDM Checkout Behavior
PDM checkouts follow additional rules to remain consistent with UI behavior:
• When showWorkingCopy=true
◦ For the user who created the one‑off version, only the one‑off (working copy) is returned.
◦ For other users, both the original version and the one‑off version are returned, as long as the user has access.
• When showWorkingCopy=false, both the original version and the one‑off version are returned, assuming the user has access to both.