Windchill Dependency Filtering for Downgraded Deliveries
Dependency filter is a Java based filter used to filter any set of dependent objects which are not valid to exchange, if any of its required objects are filtered out by either xpath or property based filter. This section provided guidelines for effectively customizing the dependency filters.
Guidelines
• Implementing the DependencyFilter interface directly is not recommended. DependencyFilter customization must involve extending DefaultDependencyFilter and provide implementation for execute method in it.
• If a dependency filter depends on multiple objects, then you must define multiple FilterIdentity annotations.
• Customized DependencyFilter must define the DependencyFilterPriority as shown below:
package com.ptc.transformation.filter;
public final class DependencyFilterPriority {
private DependencyFilterPriority() {
// This is not be instantiated. Should be used for static references only
}
public static final int BUFFER = 25;
public static final int PRIMARY_OBJECT_PRIORITY = BUFFER;
public static final int LINK_OBJECT_PRIORITY = PRIMARY_OBJECT_PRIORITY + BUFFER;
public static final int SECONDARY_OBJECT_PRIORITY = LINK_OBJECT_PRIORITY + BUFFER;
public static final int ACTIVITY_PRIORITY = SECONDARY_OBJECT_PRIORITY + 2;
public static final int WORKITEM_PRIORITY = ACTIVITY_PRIORITY + 2;
public static final int VOTING_EVENT_AUDIT_PRIORITY = WORKITEM_PRIORITY + 2;
public static final int ASSIGNMENT_EVENT_AUDIT_PRIORITY = ACTIVITY_PRIORITY + 2;
}
• It must be define based on the object getting filter to avoid the recursion. Dependency filter priorities are defined as following:
◦ PRIMARY_OBJECT_PRIORITY – These are the dependency filters which get executed first in priority. It is recommended to use this priority for filtering primary business objects which are normally package members.
◦ LINK_OBJECT_PRIORITY – These are the dependency filters which get executed second in the priority. It is recommended to use this priority for filtering binary link objects of the primary business objects
◦ SECONDARY_OBJECT_PRIORITY – These are the dependency filters which get executed at the end. It is recommended to use this priority for secondary objects which are dependent on both package members and links.
|
You can provide your own filter priority definitions based on your object models and relations.
|
• It is recommended to use API’s exposed through XMLLookUpService to perform query on XMLs to get appropriate XMLFilterEntries.
For more information, see the section "XMLLookUpService Supported APIs".
• Methods which are marked as supported must be used for customization.
XMLLookUpService Supported APIs
Method
|
Arguments
|
Return
|
Usage
|
getXMLFilterEntries
|
String rootTag- Root tag of the XMLs to be filtered
Map of FilterEntries, which comprises of XPATH as key and collection of values as value.
|
Returns collection of XMLFilterEntries. These XMLFilterEntries do not include already filtered XMLs
|
Use in dependency filter customization to perform database query.
|
getXMLFilterEntries
|
String rootTag- Root tag of the XMLs to be filtered
Map of FilterEntries, which comprises of XPATH as key and collection of values as value.
removeFiltered flag
|
Returns collection of XML filter entries. Returned XML filter entries may return the XML entries which are already filtered based on removeFiltered flag
|
Use in dependency filter customization to perform database query
|
getInstance
|
TransformationContext
|
XMLLookUpService instance initialized for a given TransformationContext.
|
Always use this method to get XMLLookUpService instance. This ensures that all the operations happen under one downgrade delivery and corresponding base delivery referred XMLs.
|