Package com.ptc.windchill.esi.delegate
Class ESIPartDifferenceManagementDelegateImpl
java.lang.Object
com.ptc.windchill.esi.delegate.ESIPartDifferenceManagementDelegateImpl
- All Implemented Interfaces:
ESIDifferenceManagementDelegate
public class ESIPartDifferenceManagementDelegateImpl
extends Object
implements ESIDifferenceManagementDelegate
Represents part information identified for BOM Difference logic calculation by the ESIWTPartRender and
ESIPartUtility.
Supported API: true
Extendable: true
Supported API: true
Extendable: true
-
Method Summary
Modifier and TypeMethodDescriptionfindAddedParts(Collection<ESITargetAssociation> previousParts, Collection<ESITargetAssociation> currentParts) Fetches the collection of ESITargetAssociations of part which is being published for the first time.findChangedParts(Collection<ESITargetAssociation> currAssoc, Collection<ESITargetAssociation> previousAssoc, VdbBuilder builder, ESIEffectivityHandler effHandler) Identifies and fetches the target association objects of changed parts from the input collection of current target associations and previous target associations.findChangedParts(Collection<ESITargetAssociation> currAssoc, Collection<ESITargetAssociation> previousAssoc, VdbBuilder builder, ESIEffectivityHandler effHandler, String groupName) Identifies and fetches the target association objects of changed parts from the input collection of current target associations and previous target associations.getAddedAlternateTargetAssociations(Collection<ESITargetAssociation> partTargetAssoc, Collection<WTPart> alternates) Fetches the ESITarget association objects from the input collection of target associations, identifies the alternate part target association from the input collection of parts and returns it to the caller.getDeletedAltrnateParts(Collection<ESITargetAssociation> curPartAssoc, Collection<WTPart> alts) Fetches the deleted alternate part objects from the input collection of target associations and alternate parts.getPartIteration(Collection<? extends WTPartMaster> partMasters, NavigationCriteria navigationCriteria) Returns a collection of ESIPartMasterIteration objects given a collection of part masters.getPartIteration(WTPartMaster partMaster, NavigationCriteria navigationCriteria) Returns an ESIPartMasterIteration objects given a part masters.Map[]getPartToPreviousExportedIterationMap(Collection<WTPart> parts, Collection<ESITargetAssociation> previousTargetAssoc) Returns an array of Maps.getPrevPublishedIteration(WTPart part, Collection<ESITargetAssociation> prevTgtAssociations) Returns the previously published iteration for the input part using the input collection of target associations.getSoftAttribute(Object ibaHolder, String attributeName) Returns the value of the soft attribute having the input name for the input object.getTargets(Collection<ESITargetAssociation> targetAssns) Fetches the ESITarget objects from the input collection of target associations, stores them in a HashSet and returns it to the caller.getTargets(Collection<ESITargetAssociation> targetAssociations, WTPart part) Fetches the collection of ESITargets of part from respective target associations.booleanhasPartChanged(WTPart currPart, WTPart prevPart, ESITargetAssociation tgtAssoc, ESIEffectivityHandler effHandler, NCServerHolder ncServerHolder, boolean ignoreEnterpriseDataChanged) Lets the caller know if the currently published part iteration is different from a previously published iteration of the same part for a given distribution target.booleanisIterationInSameViewVariations(ViewManageable newPartIteration, ViewManageable oldPartIteration) Check if the input part iterations are from the same view and have the same values for variation1 (i.e.voidProcesses the input query results and populates the input collections as appropriate.
-
Method Details
-
getPrevPublishedIteration
public WTPart getPrevPublishedIteration(WTPart part, Collection<ESITargetAssociation> prevTgtAssociations) throws WTException Returns the previously published iteration for the input part using the input collection of target associations. The returned iteration could even be identical to the input part iteration, depending on what was passed in for prevTgtAssociations.
Supported API: true- Specified by:
getPrevPublishedIterationin interfaceESIDifferenceManagementDelegate- Parameters:
part- - Input part for which to fetch the previously published iteration.prevTgtAssociations- - Collection of ESITargetAssociation objects for previously published iterations, all of which are associated to a given distribution target.- Returns:
- Part iteration that was previously published to the given distribution target, if such an iteration exists; null, otherwise.
- Throws:
WTException- - if any of the invoked methods throws this exception.
-
hasPartChanged
public boolean hasPartChanged(WTPart currPart, WTPart prevPart, ESITargetAssociation tgtAssoc, ESIEffectivityHandler effHandler, NCServerHolder ncServerHolder, boolean ignoreEnterpriseDataChanged) throws WTException Lets the caller know if the currently published part iteration is different from a previously published iteration of the same part for a given distribution target. The method first checks if the version of the part has changed, and if not, checks if the effectivity on the part has changed and if not, then check if enterprise data associated with part has changed since it was last released.
Supported API: true- Specified by:
hasPartChangedin interfaceESIDifferenceManagementDelegate- Parameters:
currPart- - Currently published part iteration.prevPart- - Previously published part iteration.tgtAssoc- - ESITargetAssociation for the currently published part iteration.effHandler- - ESIEffectivityHandler instance, used for determining if the effectivity on the currently published part iteration is already released to the distribution target in the input target association.ncServerHolder- The ncServerHolder holds navigation criteriaignoreEnterpriseDataChanged- - Indicates if Enterprise Data changes need to be considered or not.vdbBuilder-- Returns:
- boolean true, if the currently published part iteration is different from the previously published one; false, otherwise.
- Throws:
ESIRendererExceptionWTException
-
findAddedParts
public Collection<ESITargetAssociation> findAddedParts(Collection<ESITargetAssociation> previousParts, Collection<ESITargetAssociation> currentParts) Fetches the collection of ESITargetAssociations of part which is being published for the first time.
Supported API: true- Specified by:
findAddedPartsin interfaceESIDifferenceManagementDelegate- Parameters:
previousParts- - Collection of ESITargetAssociations of previously published parts.currentParts- - Collection of ESITargetAssociations of part which are being published as part of current transaction.- Returns:
- Collection of ESITargetAssociations.
-
getTargets
public Collection<ESITarget> getTargets(Collection<ESITargetAssociation> targetAssociations, WTPart part) Fetches the collection of ESITargets of part from respective target associations.
Supported API: true- Specified by:
getTargetsin interfaceESIDifferenceManagementDelegate- Parameters:
targetAssociations- - Collection of ESITargetAssociationspart- - WTPart being published.- Returns:
- Collection of ESITargets.
-
getTargets
Fetches the ESITarget objects from the input collection of target associations, stores them in a HashSet and returns it to the caller.
Supported API: true- Specified by:
getTargetsin interfaceESIDifferenceManagementDelegate- Parameters:
targetAssns- - Input collection of ESITargetAssociations.- Returns:
- Collection Output collection of ESITarget objects.
-
getAddedAlternateTargetAssociations
public Collection<ESITargetAssociation> getAddedAlternateTargetAssociations(Collection<ESITargetAssociation> partTargetAssoc, Collection<WTPart> alternates) Fetches the ESITarget association objects from the input collection of target associations, identifies the alternate part target association from the input collection of parts and returns it to the caller.
Supported API: true- Specified by:
getAddedAlternateTargetAssociationsin interfaceESIDifferenceManagementDelegate- Parameters:
partTargetAssoc- - Input collection of ESITargetAssociations.alternates- - Input collection of alternate parts.- Returns:
- Collection of ESITargetAssociations.
-
getDeletedAltrnateParts
public Collection<WTPart> getDeletedAltrnateParts(Collection<ESITargetAssociation> curPartAssoc, Collection<WTPart> alts) Fetches the deleted alternate part objects from the input collection of target associations and alternate parts.
Supported API: true- Specified by:
getDeletedAltrnatePartsin interfaceESIDifferenceManagementDelegate- Parameters:
curPartAssoc- - Input collection of ESITargetAssociations.alts- - Input collection of alternate parts.- Returns:
- Collection of WTPart.
-
findChangedParts
public Collection<ESITargetAssociation>[] findChangedParts(Collection<ESITargetAssociation> currAssoc, Collection<ESITargetAssociation> previousAssoc, VdbBuilder builder, ESIEffectivityHandler effHandler) throws WTException Identifies and fetches the target association objects of changed parts from the input collection of current target associations and previous target associations.
Supported API: true- Specified by:
findChangedPartsin interfaceESIDifferenceManagementDelegate- Parameters:
currAssoc- - Input collection ESITargetAssociations for part currently being published.previousAssoc- - Input collection of ESITargetAssociations for previously published parts.- Returns:
- Collection of ESITargetAssociations.
- Throws:
WTException
-
findChangedParts
public Collection<ESITargetAssociation>[] findChangedParts(Collection<ESITargetAssociation> currAssoc, Collection<ESITargetAssociation> previousAssoc, VdbBuilder builder, ESIEffectivityHandler effHandler, String groupName) throws WTException Identifies and fetches the target association objects of changed parts from the input collection of current target associations and previous target associations.
Supported API: true- Specified by:
findChangedPartsin interfaceESIDifferenceManagementDelegate- Parameters:
currAssoc- - Input collection ESITargetAssociations for part currently being published.previousAssoc- - Input collection of ESITargetAssociations for previously published parts.- Returns:
- Collection of ESITargetAssociations.
- Throws:
WTException
-
getPartToPreviousExportedIterationMap
public Map[] getPartToPreviousExportedIterationMap(Collection<WTPart> parts, Collection<ESITargetAssociation> previousTargetAssoc) Returns an array of Maps. Each key in a Map is a part in the input collection and the value is the corresponding previously published iteration. The Maps at indices 0, 2 and 3 in the output array hold the added, changed and unchanged parts respectively as keys.
Supported API: true- Specified by:
getPartToPreviousExportedIterationMapin interfaceESIDifferenceManagementDelegate- Parameters:
parts- - Collection parts whose previous exported iterations need to be identified from the target association collection "previousTargetAssoc".previousTargetAssoc- - Target associations corresponding to the previous exported iterations of the parts in the input "parts" collection.- Returns:
- An array of Maps. The Maps at indices 0, 2 and 3 hold the added, changed and unchanged parts respectively as keys and the corresponding previously published iterations as values. The Map at index 1 will be empty.
-
processQueryResultsOfPartIterations
public void processQueryResultsOfPartIterations(QueryResult qr, Collection<ESIPartMasterIteration> esipmis) Processes the input query results and populates the input collections as appropriate. See the argument descriptions for more information.
Supported API: true- Specified by:
processQueryResultsOfPartIterationsin interfaceESIDifferenceManagementDelegate- Parameters:
qr- - Input query results to process.esipmis- - Collection to be populated with ESIPartMasterIteration objects.
-
isIterationInSameViewVariations
public boolean isIterationInSameViewVariations(ViewManageable newPartIteration, ViewManageable oldPartIteration) Check if the input part iterations are from the same view and have the same values for variation1 (i.e. BOM Usage) and variation2 (i.e BOM Alternate).
Supported API: true- Specified by:
isIterationInSameViewVariationsin interfaceESIDifferenceManagementDelegate- Parameters:
newPartIteration- - The new iteration of part to be compared.oldPartIteration- - The old iteration of part with which new iteration needs to be compared.- Returns:
- - true, if the input part iterations are from the same view and have the same variation1 and variation2 values; otherwise false.
-
getSoftAttribute
Returns the value of the soft attribute having the input name for the input object. Delegates the actual work to certain lower level APIs.
Supported API: true- Specified by:
getSoftAttributein interfaceESIDifferenceManagementDelegate- Parameters:
ibaHolder- - Input object for which to fetch the soft attribute value.attributeName- - Name of the soft attribute associated to the input object for which to return the value.- Returns:
- String Value of the soft attribute having the input name.