com.ptc.core.ocmp.service
Interface ObjComparisonService

All Known Implementing Classes:
StandardObjComparisonService

public interface ObjComparisonService

This service provides support for comparison operations for business objects given a specific set of attributes and links / associations to consider.

Supported API: true

Extendable: false

See Also:
ObjComparisonHelper, ComparisonSpec, ComparisonResult

Method Summary
 boolean areAttrsConfiguredForDomainType(WTReference domainObjRef)
          Determines whether any attributes are configred in the configuration resource for the type represented by the passed in reference object.
 boolean areLinksConfiguredForDomainType(WTReference domainObjRef)
          Determines whether any links (associations) are configured in the configuration resource for the object type represented by the passed in reference object.
 ComparisonResult compareDomainObjs(ComparisonSpec spec)
          Compares business objects specified as part of a ComparisonSpec.
 Set<String> getLinksConfiguredForType(WTReference domainObjRef)
          Returns any links (associations) configured in the configuration resource for the domain type represented by the passed in reference object.
 boolean isDomainTypeSupportedForComparison(String logicalTypeId)
          Identifies whether the type specified is supported for comparison by the comparison service, which in turn depends on whether the domain type (or any of its parent type) is configured in the object comparison configuration resource.
 

Method Detail

compareDomainObjs

ComparisonResult compareDomainObjs(ComparisonSpec spec)
                                   throws com.ptc.core.ocmp.framework.ConfigResourceException,
                                          WTException
Compares business objects specified as part of a ComparisonSpec. The results are tailored as per the various options specified as part of the ComparisonSpec.

The domain type (or one of its parent types) in context must be configured in the object comparison configuration resource for its objects to be supported for comparison by the comparison service. If a SimpleComparisonSpec is to be used as the comparison specification object for the comparison service, any attributes and links (associations) to be compared as part of the comparison operation must be configured in the resource too. An AdvancedComparisonSpec on the other hand allows such specification to be specified at runtime, and these values take precedence over the values configured in the resource (if any).



Supported API: true

Parameters:
spec - A non-null ComparisonSpec instance must be specified for a successful comparison operation. The list of domain objects to be compared must be non null too and must contain at least 2 objects specified for comparison.
Returns:
A ComparisonResult instance that aggregates and organizes the various comparison results, in a fashion such that the results are easily and efficiently retrieved and / or queried.
Throws:
NullPointerException - when the spec is null
IllegalArgumentException - when the ComparisonSpec instance has less than 2 objects specified for comparison.
com.ptc.core.ocmp.framework.ConfigResourceException - when an error is encountered while accesing the configuration resource.
com.ptc.core.ocmp.framework.ConfigResourceException
WTException
See Also:
ComparisonSpec, ComparisonResult

isDomainTypeSupportedForComparison

boolean isDomainTypeSupportedForComparison(String logicalTypeId)
                                           throws WTException
Identifies whether the type specified is supported for comparison by the comparison service, which in turn depends on whether the domain type (or any of its parent type) is configured in the object comparison configuration resource.

The domain type (or one of its parent types) in context must be configured in this resource for its objects to be supported for comparison by the comparison service. If a SimpleComparisonSpec is to be used as the comparison specification object for the comparison service, any attributes and links (associations) to be compared as part of the comparison operation must be configured in the resource too. AdvancedComparisonSpec on the other hand allows such specification to be specified at runtime, and these values take precedence over the values configured in the resource (if any).

Supported API: true

Parameters:
logicalTypeId - the logical type identifier (form) of the type which is to be checked for comparison support. The logical type identifier universally identifies a type in windchill using a logical identifier/form.
Returns:
trueif the type is supported for comparison; false otherwise.
Throws:
WTException
See Also:
Business Admin's Guide for more information on logical type identifiers.

areAttrsConfiguredForDomainType

boolean areAttrsConfiguredForDomainType(WTReference domainObjRef)
                                        throws WTException
Determines whether any attributes are configred in the configuration resource for the type represented by the passed in reference object.

Supported API: true

Parameters:
domainObjRef -
Returns:
true if any attributes are configured; false otherwise.
Throws:
WTException

areLinksConfiguredForDomainType

boolean areLinksConfiguredForDomainType(WTReference domainObjRef)
                                        throws WTException
Determines whether any links (associations) are configured in the configuration resource for the object type represented by the passed in reference object.

Supported API: true

Parameters:
domainObjRef -
Returns:
true if any links are configured; false otherwise.
Throws:
WTException

getLinksConfiguredForType

Set<String> getLinksConfiguredForType(WTReference domainObjRef)
                                      throws WTException
Returns any links (associations) configured in the configuration resource for the domain type represented by the passed in reference object.

Supported API: true

Parameters:
domainObjRef -
Returns:
the set of configured links for the domain type represented by the reference object; empty set if no configured links identified.
Throws:
WTException