State Filter
The State Filter queries the repository for objects having a specified state within a revision tree and returns the most recent iteration matching that state.
Below are the attributes and parameters along with a detailed description.
Attributes
Attribute Name |
Description |
name |
Descriptive name of the task. |
type |
“StateFilter” |
Parameters
Parameters are inherited from Collection and referencing elements (i.e. Task).
Parameter Name |
Description |
containerName |
Name of the product or library to be queried. |
containerType |
Internal object type name of the container to be queried. The out-of-the-box Library container name is “wt.inf.library.WTLibrary”. The out-of-the-box Product container name is “wt.pdmlink.PDMLinkProduct”. If containerName is specified, containerType is required. |
state |
Internal name of the target state. Required. |
objectType |
The fully qualified name of the object type to be queried. The default Document object type is “WCTYPE|wt.doc.WTDocument” and the default EPM Document Type is “WCTYPE|wt.epm.EPMDocument” |
folder |
The container folder to be queried. For example “/Publications”. |
criteria |
Any additional criteria to be included in the query. The criteria must confirm to the Info*Engine Search-Objects task WHERE Clause. For additional information, refer to the PTC Windchill Adapters Guide. |
excludeIfLaterRevision |
If the objects returned by the filter are of a later version that what is already been returned by previous filters, if excludeIfLaterRevision is true, the object is removed from the filter. For example, if a document revision history is: B.1 Cancelled A.2 Released A.1 In Work If a previous filter queried for released objects, version A.2 would be in the collection. However, if the a second filter is applied to query for Cancelled objects, returning B.1, and the excludeIfLaterRevision is true, A.2 will be removed from the collection. |
includeMetadata |
Additional Windchill attributes to be included with the filter results. The attribute must be defined in the object type or ancestor object type. Multiple attributes can be specified delimited with commas. Attribute names must be the internal Windchill name. |
syncSubFolders |
True or false. Indicates whether to process synchronize subfolders of content. This applies to QueryFilters and StateFilters. |
downloadReferences |
If set to false, this will still name referenced XML files in the same way, but it will not recursively download and resolve them. This is used for incremental update scenarios where just a map is updated but none of the descendant objects are as an example. |
nameByNumber |
When set to true, this sets the filename as the Windchill number. |
Example
The following example defines collection of all released manuals. If a document has a state of CANCELLED in a later revision compared to a RELEASED revision, the document will be removed from the collection.
<Collection name="Released Documents" type="Basic"> <Param name="containerName" value="Manuals"/> <Param name="containerType" value="wt.inf.library.WTLibrary"/> <Param name="objectType" value="com.company.DynamicDocument"/> <Filter name="IncludeReleased" type="StateFilter"> <Param name="state" value="RELEASED"/> </Filter> <Filter name="ExcludeCancelled" type="StateFilter"> <Param name="excludeIfLaterRevision" value="true"/> <Param name="state" value="CANCELLED"/> </Filter> </Collection>