Query Filter

The Query Filter queries the repository for objects using specified criteria returning the latest objects.

Below are the attributes and parameters along with a detailed description.

Attributes

Attribute Name

Description

name

Descriptive name of the task.

type

“QueryFilter”

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.

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.

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 targeting two documents based on their Windchill number.

<Collection name="ExampleCollection" type="Basic">
        <Param name="containerName" value="ExammpleLibrary"/>
        <Param name="containerType" value="wt.inf.library.WTLibrary"/>
        <Param name="objectType" value="WCTYPE|wt.epm.EPMDocument"/>
        <Param name="syncSubfolders" value="false"/>
				<Filter name="LatestManual6" type="QueryFilter">
	     	<Param name="criteria" value="(number='0000506969')|(number='0000506970')"/>
	     </Filter>
      </Collection>

The following example defines collection targeting documents updated in the past two days. The way currentDate-24 is it creates a timestamp of the current date, minus 24 hours. That creates a date of the previous day. Windchill can only support intervals of days.

<Collection name="IncCollection" type="Basic">
    <Param name="containerName" value="Demo-JJ"/>
    <Param name="containerType" value="wt.inf.library.WTLibrary"/>
    <Param name="objectType" value="WCTYPE|wt.epm.EPMDocument"/>
    <Param name="syncSubfolders" value="false"/>
    <Filter name="LatestManual6" type="QueryFilter">
        <Param name="state" value="RELEASED"/>
        <Param name="criteria" value="(thePersistInfo.updateStamp>'currentDate-24')"/>
    </Filter>
</Collection>

The following example defines collection targeting a document based on it’s Windchill number. It also includes a state parameter that will ensure any documents exported are in the RELEASED or INWORK states.

<Collection name="DemoCollectionJJ" type="Basic">
    <Param name="containerType" value="wt.inf.library.WTLibrary"/>
    <Param name="containerName" value="Demo-JJ"/>
    <Param name="objectType" value="WCTYPE|wt.epm.EPMDocument"/>
    <Filter name="LatestManual6" type="QueryFilter">
        <Param name="criteria" value="number='0002913923'"/>
        <Param name="state" value="RELEASED,INWORK"/>
    </Filter>
</Collection>