Package com.ptc.windchill.esi.delegate
Class ESIBOMDifferenceMangementDelegateImpl
java.lang.Object
com.ptc.windchill.esi.delegate.AbstractESIBOMDifferenceMangementDelegate
com.ptc.windchill.esi.delegate.ESIBOMDifferenceMangementDelegateImpl
- All Implemented Interfaces:
ESIBOMDifferenceMangementDelegate
public class ESIBOMDifferenceMangementDelegateImpl
extends com.ptc.windchill.esi.delegate.AbstractESIBOMDifferenceMangementDelegate
implements ESIBOMDifferenceMangementDelegate
Provides services which can used for customizing the difference calculation of BOM.
Supported API: true
Extendable: true
Supported API: true
Extendable: true
-
Method Summary
Modifier and TypeMethodDescriptionvoidaddCurrToPrevUsageLinksEntry(WTPartUsageLink currentUsageLink, Collection<ESIQueryTargetAssociation> queryTargetAssocs, Map<WTPartUsageLink, Set<WTPartUsageLink>> currToPrevUsageLinks) Populates the output Map (in currToPrevUsageLinks) using the input arguments.voidadjustDelta(WTPart part, Collection<Object>[] linkDiff, TreeNavigator navigator, Map<WTPartUsageLink, WTPart>[] delta) Traverses the elements in the input array and populates the output array as appropriate, after allocating memory for a given element in the latter as needed.voidadjustUsage(com.infoengine.object.factory.Element element, String attName, WTPart part, ESITarget target) Update the attribute "Usage" on the input Element using the value defined for the preference "View To BOM Type Mappings".booleancompareAttrsOtherThanLineNumber(WTPartUsageLink partUsageLink, HashMap<String, HashMap<String, String>> attrDiffs) Traverses the input Map looking for changes to any of the attributes other than given attribute on the input part usage link.booleancompareFindNumbers(WTPartUsageLink partUsageLink1, WTPartUsageLink partUsageLink2) Compares the findNumber attribute on the two input part usage links and returns a boolean value that indicates the outcome of the comparison.static booleancompareLineNumbers(LineNumber lineNumber1, LineNumber lineNumber2) Deprecated.static booleancompareLineNumbers(WTPartUsageLink partUsageLink1, WTPartUsageLink partUsageLink2) Deprecated.: UseBOMUtility.compareLineNumbers(WTPartUsageLink, WTPartUsageLink)
Supported API: truebooleancompareQuantities(WTPartUsageLink partUsageLink1, WTPartUsageLink partUsageLink2) Compares the quantity attribute on the two input part usage links and returns a boolean value that indicates the outcome of the comparison.
Supported API: truegetChildNodes(Persistable object, Map<Persistable, Map<ObjectToObjectLink, Persistable>> roleAObjectAndAssocLinks, boolean immediateOnly) Return the collection of child nodes for input persistable object from specified input input roleAObjectAndAssocLinks map.voidgetDeletedRMLinks(WTPart currentPart, Set<RawMaterialLink> deletedRMLinks, ESITarget esiTarget) Fetches and populates deleted manufacturing history object links.getLastPublishedUsageLink(Collection<ESIQueryTargetAssociation> latestLinkHistories, WTPart prevPublishedPart, WTPartUsageLink partUsageLink, ESITarget target) Fetches a Collection of ESIQueryTargetAssociations that hold the part usage links that were last published to the input distribution target and returns it to the caller.getLastPublishedUsageLink(WTPart prevPublishedPart, WTPartUsageLink partUsageLink, ESITarget target) Fetches a Collection of ESIQueryTargetAssociations that hold the part usage links that were last published to the input distribution target and returns it to the caller.
Supported API: truevoidgetMfgHistoryDeletedLinks(RawMaterialLink link, Set<RawMaterialLink> unchgRMLinksToRemove, Set<RawMaterialLink> deletedRMLinks, Set<RawMaterialLink> rmLinks) Populates links from unchanged collection into deleted collection based upon manufacturing history object's event type.getMfgHistoryLinks(Map<WTPart, MfgHistory> mfgHistoryMap) Fetches raw material links from manufacturing history link objects.getPartToRMLinksMap(Persistable previousPart, Persistable currentPart, ESITarget esiTarget, String releaseClass, VdbBuilder builder) Returns a map of raw material links and their respective attribute values, fetched by their respective snapshot object for published raw material links.getPartUsageLinks(Set<Persistable> links) Fetches part usage links
Supported API: truegetRawMaterialLinks(Set<Persistable> links) Return the set of Raw Material links given the set of links
Supported API: truegetRealLeafNodes(Collection<Persistable> leafNodes) Looks for parts that do not have any part usages from among the ones in the input collection and returns such parts in a collection to the caller.
Supported API: trueFetches the deleted raw material links and snapshot map.voidgetUnchangedRMLinks(Set<RawMaterialLink> unchangedRMLinks, Set<RawMaterialLink> unchgRMLinksToRemove, Set<RawMaterialLink> deletedRMLinks, VdbBuilder builder) Fetches and populates unchanged manufacturing history object links.voidgetUpdatedRMLinksForChangedAttributes(RawMaterialLink link, RawMaterialLink rawMaterialLinkHistory, Set<RawMaterialLink> changedRMLinks, Set<RawMaterialLink> unchgRMLinksToRemove, Set<RawMaterialLink> addedRMLinks, Set<RawMaterialLink> deletedRMLinks, Map<RawMaterialLink, String> rmLinkAttrMap, VdbBuilder builder) Populate the maps appropriately for raw material links if line number is changed.getUsageLinkWithMatchingCompId(WTPart part, WTPartUsageLink partUsageLink, ESITarget target) Fetches an ESIQueryTargetAssociation object that holds a part usage link associated with the input part, and whose componentId matches that of the input part usage link.
Supported API: truebooleanReturns true if the given part has any children (connected to aWTPartMastervia aWTPartUsageLink) or was ever released by ESI to any target as a BOM.booleanReturns a true if the input part has any children (connected to aWTPartMastervia aWTPartUsageLink), or was ever released by ESI to the input distribution target as a BOM.voidpopulateDelta(Set<Object> links, Map<ObjectToObjectLink, Persistable> linksToRoleBObjects, int type, Map<WTPartUsageLink, WTPart> delta) Populates the Map in delta using the input parameters.HashSet[]retrieveBOMDifferencesForCPLinks(WTPart previousPart, WTPart currentPart, boolean ignoreLineNumbers, ESITarget esiTarget, HashSet<Persistable>[] delta, VdbBuilder builder) Returns a array of Sets (the Sets at indices 0, 1, 2 and 3 hold the added, deleted, changed and unchanged CoProduceMemberLink or CoProduceUsageLink links ,fetched by comparing the currently and previously published links.HashSet[]retrieveBomDifferencesForRMLinks(WTPart previousPart, WTPart currentPart, boolean ignoreLineNumbers, ESITarget esiTarget, HashSet<Persistable>[] delta, VdbBuilder builder) Returns a array of Sets (the Sets at indices 0, 1, 2 and 3 hold the added, deleted, changed and unchanged raw material links respectively, fetched by comparing the currently and previously published raw material links.retrieveBomDifferencesUsingObjComparison(WTPart currentPart, WTPart previousPart, boolean ignoreLineNumbers, Map<WTPartUsageLink, Set<WTPartUsageLink>> currToPrevUsageLinks, ESITarget esiTarget, VdbBuilder builder, Map<WTPartUsageLink, Collection<ESIQueryTargetAssociation>> partUsagesToTargetAssocsMap) Compares the bill of material of the current WTPart iteration with that of a previously published WTPart iteration.voidsetSnapshotToDelRMLinksMap(Map<ESIReleasedObjectSnapshot, RawMaterialLink> snapshotToRMLinkMap) Sets the deleted raw material links and snapshot map
Supported API: truevoidupdateMaps(RawMaterialLink link, Set<RawMaterialLink> rmLinksToAdd, Set<RawMaterialLink> rmLinksToDelete, VdbBuilder builder) Populate the added, deleted collections appropriately for raw material links.Methods inherited from class com.ptc.windchill.esi.delegate.AbstractESIBOMDifferenceMangementDelegate
getSnaphotsToVersionToObjectLinks, setSnapshotsToVersionToObjectLinks
-
Method Details
-
isBom
Returns true if the given part has any children (connected to aWTPartMastervia aWTPartUsageLink) or was ever released by ESI to any target as a BOM. Otherwise returns false
Supported API: true- Specified by:
isBomin interfaceESIBOMDifferenceMangementDelegate- Parameters:
part- The WTPart to be evaluated.- Returns:
- boolean
- Throws:
WTException
-
isBom
Returns a true if the input part has any children (connected to aWTPartMastervia aWTPartUsageLink), or was ever released by ESI to the input distribution target as a BOM. Otherwise returns a false. If a true was passed in for allViews, iterations of the input part in all views are considered while checking if the part was ever published as a BOM; otherwise, only those iterations that reside in the view of the input part iteration are considered.
Supported API: true- Specified by:
isBomin interfaceESIBOMDifferenceMangementDelegate- Parameters:
part- - Input part to be evaluated.target- - Input distribution target.allViews- - This is either true or false, according as iterations in all views are to be considered for the database lookup or otherwise respectively.- Returns:
- A true, if the input part iteration has any children, or was ever released to the input distribution target as a BOM; a false, otherwise.
- Throws:
WTException
-
adjustUsage
public void adjustUsage(com.infoengine.object.factory.Element element, String attName, WTPart part, ESITarget target) Update the attribute "Usage" on the input Element using the value defined for the preference "View To BOM Type Mappings". This method does the following: 1. Using the number on the input target, fetch the relevant view using the value defined for the preference "View To Distribution Target Mappings". 2. From this view, fetch the usage using the value defined for the preference "View To BOM Type Mappings". 3. Update the "Usage" attribute on the input Element with the thus fetched usage if appropriate. Log a message stating that the usage on the BOM iteration is ignored, if applicable.
Supported API: true- Specified by:
adjustUsagein interfaceESIBOMDifferenceMangementDelegate- Parameters:
element- - The element to be updated.attName- - The name of the attribute whose value needs to be adjusted.part- - Input part for which usage needs to be updated.target- - Distribution target for which the input part is being rendered.
-
retrieveBomDifferencesUsingObjComparison
public Map<String,Object> retrieveBomDifferencesUsingObjComparison(WTPart currentPart, WTPart previousPart, boolean ignoreLineNumbers, Map<WTPartUsageLink, Set<WTPartUsageLink>> currToPrevUsageLinks, ESITarget esiTarget, VdbBuilder builder, Map<WTPartUsageLink, throws WTException, WTPropertyVetoExceptionCollection<ESIQueryTargetAssociation>> partUsagesToTargetAssocsMap) Compares the bill of material of the current WTPart iteration with that of a previously published WTPart iteration. Returns a Map holding the following Strings as keys - "AttributeDifferenceList", "LinksDifferenceList". The value associated with the former is a Map (see the JavaDoc of the API ESIObjectComparisonUtility.computeAttrDifferences() for more information). The value associated with the latter is an array of Sets (the Sets at indices 0, 1, 2 and 3 hold the added, deleted, changed and unchanged part usage and raw material links respectively, fetched by comparing the current and previously published part iterations). Besides, the method optionally populates a Map with currently and previously published part usage links/raw material links.Note: The method is too long and ugly to be maintained. It has to be re-factored.
Supported API: true- Specified by:
retrieveBomDifferencesUsingObjComparisonin interfaceESIBOMDifferenceMangementDelegate- Parameters:
currentPart- - Current iteration of the assembly part.previousPart- - Previously published iteration of the assembly part.ignoreLineNumbers- - If true, a change to the LineNumber attribute is ignored. In other words, even if the value of this attribute on a usage link has changed since the link was last published, the link is considered to be an unchanged one.currToPrevUsageLinks- - A Map where each key is a part usage link that is currently being published, and each value is a Set of the corresponding previously published part usage links. Can be null, if the caller does not wish to populate the Map.esiTarget- - The currently processed distribution target.builder- - The VdbBuilder instance that is used for generating the ESI response.partUsagesToTargetAssocsMap- - A Map where each key is a part usage link that is currently being published, and each value is a Collection of query target associations that represent the corresponding previously published usage links.- Returns:
- A Map as mentioned in the method description.
- Throws:
wt.part.LineNumberUsageExceptionWTExceptionWTPropertyVetoException
-
retrieveBOMDifferencesForCPLinks
public HashSet[] retrieveBOMDifferencesForCPLinks(WTPart previousPart, WTPart currentPart, boolean ignoreLineNumbers, ESITarget esiTarget, HashSet<Persistable>[] delta, VdbBuilder builder) throws WTException Returns a array of Sets (the Sets at indices 0, 1, 2 and 3 hold the added, deleted, changed and unchanged CoProduceMemberLink or CoProduceUsageLink links ,fetched by comparing the currently and previously published links.
Supported API: true- Specified by:
retrieveBOMDifferencesForCPLinksin interfaceESIBOMDifferenceMangementDelegate- Overrides:
retrieveBOMDifferencesForCPLinksin classcom.ptc.windchill.esi.delegate.AbstractESIBOMDifferenceMangementDelegate- Parameters:
previousPart- - Previously published iteration of the assembly part.currentPart-ignoreLineNumbers- - If true, a change to the LineNumber attribute is ignored. In other words, even if the value of this attribute on a usage link has changed since the link was last published, the link is considered to be an unchanged one.esiTarget- - The currently processed distribution target.builder-- Returns:
- A array of Sets as mentioned in the method description.
- Throws:
wt.part.LineNumberUsageExceptionWTExceptionWTPropertyVetoException
-
retrieveBomDifferencesForRMLinks
public HashSet[] retrieveBomDifferencesForRMLinks(WTPart previousPart, WTPart currentPart, boolean ignoreLineNumbers, ESITarget esiTarget, HashSet<Persistable>[] delta, VdbBuilder builder) throws WTException Returns a array of Sets (the Sets at indices 0, 1, 2 and 3 hold the added, deleted, changed and unchanged raw material links respectively, fetched by comparing the currently and previously published raw material links.
Supported API: true- Specified by:
retrieveBomDifferencesForRMLinksin interfaceESIBOMDifferenceMangementDelegate- Overrides:
retrieveBomDifferencesForRMLinksin classcom.ptc.windchill.esi.delegate.AbstractESIBOMDifferenceMangementDelegate- Parameters:
previousPart- - Previously published iteration of the assembly part.currentPart-ignoreLineNumbers- - If true, a change to the LineNumber attribute is ignored. In other words, even if the value of this attribute on a usage link has changed since the link was last published, the link is considered to be an unchanged one.esiTarget- - The currently processed distribution target.builder-- Returns:
- A array of Sets as mentioned in the method description.
- Throws:
WTException
-
compareFindNumbers
Compares the findNumber attribute on the two input part usage links and returns a boolean value that indicates the outcome of the comparison.
Supported API: true- Specified by:
compareFindNumbersin interfaceESIBOMDifferenceMangementDelegate- Parameters:
partUsageLink1- - First part usage link.partUsageLink2- - Second part usage link.- Returns:
- A true, if findNumber is set on both the input part usage links and are equal, or are both null; a false, otherwise.
-
compareQuantities
Compares the quantity attribute on the two input part usage links and returns a boolean value that indicates the outcome of the comparison.
Supported API: true- Specified by:
compareQuantitiesin interfaceESIBOMDifferenceMangementDelegate- Parameters:
partUsageLink1- - First part usage link.partUsageLink2- - Second part usage link.- Returns:
- A true, if quantity is set on both the input part usage links and are equal with identical units, or are both null; a false, otherwise.
-
compareLineNumbers
public static boolean compareLineNumbers(WTPartUsageLink partUsageLink1, WTPartUsageLink partUsageLink2) Deprecated.: UseBOMUtility.compareLineNumbers(WTPartUsageLink, WTPartUsageLink)
Supported API: trueCompares the line numbers on the two input part usage links and returns a boolean value that indicates the outcome of the comparison. Delegates the work to another method that performs the actual comparison.- Parameters:
partUsageLink1- - First part usage link.partUsageLink2- - Second part usage link.- Returns:
- A true, if line numbers are set on both the input part usage links and are equal, or are not set (i.e., if they are null on both the usage links); a false, otherwise.
-
compareLineNumbers
Deprecated.: UseBOMUtility.compareLineNumbers(LineNumber, LineNumber)
Supported API: trueCompares the values associated with the two input LineNumber objects and returns a boolean value that indicates the outcome of the comparison.- Parameters:
lineNumber1- - First LineNumber object.lineNumber2- - Second LineNumber object.- Returns:
- A true, if the values associated with the input LineNumber objects are both null, or are equal; a false, otherwise.
-
getRealLeafNodes
Looks for parts that do not have any part usages from among the ones in the input collection and returns such parts in a collection to the caller.
Supported API: true- Specified by:
getRealLeafNodesin interfaceESIBOMDifferenceMangementDelegate- Parameters:
leafNodes- - Input collection of parts.- Returns:
- - Collection of parts (from among those in the input collection) that do not have part usages.
- Throws:
WTException
-
getChildNodes
public Collection<Persistable> getChildNodes(Persistable object, Map<Persistable, Map<ObjectToObjectLink, Persistable>> roleAObjectAndAssocLinks, boolean immediateOnly) Return the collection of child nodes for input persistable object from specified input input roleAObjectAndAssocLinks map. Children will be returned provided they are already available in the input map otherwise no data for child will be provided.
Supported API: true- Specified by:
getChildNodesin interfaceESIBOMDifferenceMangementDelegate- Parameters:
object- - The object for which child nodes needs to be fetched.roleAObjectAndAssocLinks- - A Map that holds RoleA object as a key and Map as value. A value map containing associated link as RoleB objects as value.immediateOnly- - A flag that indicate whether to fetch immediate children or indirect child as well. When specified as true, API will returns direct child only, otherwise, returns all child nodes.
Example:
P1
+--C1
---+--C11
-------+--C111
---+--C12
+--C2
---+--C21
---+--C22
When immediateOnly specified as 'true' for P1 object then will return C1, C2 is returned in collection.
When immediateOnly specified as 'false' for P1 object then will return C1,C2,C11,C12, C21,C22,C111 is returned in collection.- Returns:
- - The collection of child nodes for input persistable object.
-
getPartUsageLinks
Fetches part usage links
Supported API: true- Specified by:
getPartUsageLinksin interfaceESIBOMDifferenceMangementDelegate- Parameters:
links- - Part usage links collection that is currently being published.
-
addCurrToPrevUsageLinksEntry
public void addCurrToPrevUsageLinksEntry(WTPartUsageLink currentUsageLink, Collection<ESIQueryTargetAssociation> queryTargetAssocs, Map<WTPartUsageLink, Set<WTPartUsageLink>> currToPrevUsageLinks) Populates the output Map (in currToPrevUsageLinks) using the input arguments. See the parameter descriptions below for more information.
Supported API: true- Specified by:
addCurrToPrevUsageLinksEntryin interfaceESIBOMDifferenceMangementDelegate- Parameters:
currentUsageLink- - Part usage link that is currently being published.queryTargetAssocs- - Collection of ESIQueryTargetAssociations that represent the release history for previously published part usage links.currToPrevUsageLinks- - The input part usage link is added as a key, and a Set of usage links in the input collection of query target associations is added as a value to this Map. This is done provided the value Set (that is populated by this method) ends up having at least one usage link.
-
compareAttrsOtherThanLineNumber
public boolean compareAttrsOtherThanLineNumber(WTPartUsageLink partUsageLink, HashMap<String, HashMap<String, String>> attrDiffs) Traverses the input Map looking for changes to any of the attributes other than given attribute on the input part usage link. Returns a boolean depending on whether or not an attribute other than given attribute has changed.
Supported API: true- Specified by:
compareAttrsOtherThanLineNumberin interfaceESIBOMDifferenceMangementDelegate- Parameters:
partUsageLink- - Input part usage link.attrDiffs- - A HashMap where each key is a fully qualified class name indicating a type (e.g., "wt.part.WTPartUsageLink") and each value is a Map; each key in this value Map is of the form "<object identifier>_<attribute name>" (for e.g., "wt.part.WTPartMaster:427685_Unit", where wt.part.WTPartMaster:427685 is the object identifier of the role B end of the given part usage link) and each value is the value of the attribute on the usage link (for e.g., "each"). This is populated using the output that results from comparing two BOMs, using the Object Comparison Framework.- Returns:
- A true, if no attribute other than given attribute has changed as per the contents of the input HashMap; a false, otherwise.
-
getPartToRMLinksMap
public Map<RawMaterialLink,String> getPartToRMLinksMap(Persistable previousPart, Persistable currentPart, ESITarget esiTarget, String releaseClass, VdbBuilder builder) throws WTException Returns a map of raw material links and their respective attribute values, fetched by their respective snapshot object for published raw material links.
Supported API: true- Overrides:
getPartToRMLinksMapin classcom.ptc.windchill.esi.delegate.AbstractESIBOMDifferenceMangementDelegate- Parameters:
previousPart- - Previously published iteration of the assembly part.esiTarget- - Instance of ESI TargetreleaseClass- - Raw material Link release class.builder- - Instance of VdbBuilder- Returns:
- A map as mentioned in the method description.
- Throws:
WTException
-
getRawMaterialLinks
Return the set of Raw Material links given the set of links
Supported API: true- Specified by:
getRawMaterialLinksin interfaceESIBOMDifferenceMangementDelegate- Overrides:
getRawMaterialLinksin classcom.ptc.windchill.esi.delegate.AbstractESIBOMDifferenceMangementDelegate- Parameters:
links- - Set of links which can be either WTPartUsageLink or RawMaterialLink- Returns:
- - Set of RawMaterialLinks
-
getLastPublishedUsageLink
public Collection<ESIQueryTargetAssociation> getLastPublishedUsageLink(WTPart prevPublishedPart, WTPartUsageLink partUsageLink, ESITarget target) throws WTException Fetches a Collection of ESIQueryTargetAssociations that hold the part usage links that were last published to the input distribution target and returns it to the caller.
Supported API: true- Specified by:
getLastPublishedUsageLinkin interfaceESIBOMDifferenceMangementDelegate- Parameters:
prevPublishedPart- - Part iteration that was previously published to the input distribution target.partUsageLink- - Part usage link that is currently being published. This is one of the inputs used for - fetching the output.target- - Input distribution target.- Returns:
- Collection of ESIQueryTargetAssociations; for the commonly known use cases, this will be a singleton one. An empty Collection is returned if the last published part usage links could not be fetched for some reason.
- Throws:
WTException- If any of the invoked APIs threw this exception.
-
getLastPublishedUsageLink
public Collection<ESIQueryTargetAssociation> getLastPublishedUsageLink(Collection<ESIQueryTargetAssociation> latestLinkHistories, WTPart prevPublishedPart, WTPartUsageLink partUsageLink, ESITarget target) throws WTException Fetches a Collection of ESIQueryTargetAssociations that hold the part usage links that were last published to the input distribution target and returns it to the caller.
Supported API: true- Specified by:
getLastPublishedUsageLinkin interfaceESIBOMDifferenceMangementDelegate- Parameters:
latestLinkHistories- Collection of ESIQueryTargetAssociations that represent all the usage links with release history, associated with the previously published part iteration. The contents of this Collection remain unaffected upon calling this method.prevPublishedPart- Part iteration that was previously published to the input distribution target.partUsageLink- Part usage link that is currently being published. This is one of the inputs used for fetching the output.target- Input distribution target.- Returns:
- Collection of ESIQueryTargetAssociations; for the commonly known use cases, this will be a singleton one. An empty Collection is returned if the last published part usage links could not be fetched for some reason.
- Throws:
WTException- If any of the invoked APIs threw this exception.
-
getUsageLinkWithMatchingCompId
public ESIQueryTargetAssociation getUsageLinkWithMatchingCompId(WTPart part, WTPartUsageLink partUsageLink, ESITarget target) throws WTException Fetches an ESIQueryTargetAssociation object that holds a part usage link associated with the input part, and whose componentId matches that of the input part usage link.
Supported API: true- Specified by:
getUsageLinkWithMatchingCompIdin interfaceESIBOMDifferenceMangementDelegate- Parameters:
part- - Input part from which to fetch the output usage link. Cannot be null.partUsageLink- - Input part usage link used for setting up the database query parameters.target- - Input distribution target.- Returns:
- An ESIQueryTargetAssociation object holding the output part usage link and the input distribution target.
- Throws:
WTException- If any of the invoked APIs threw this exception.
-
getUpdatedRMLinksForChangedAttributes
public void getUpdatedRMLinksForChangedAttributes(RawMaterialLink link, RawMaterialLink rawMaterialLinkHistory, Set<RawMaterialLink> changedRMLinks, Set<RawMaterialLink> unchgRMLinksToRemove, Set<RawMaterialLink> addedRMLinks, Set<RawMaterialLink> deletedRMLinks, Map<RawMaterialLink, String> rmLinkAttrMap, VdbBuilder builder) throws WTExceptionPopulate the maps appropriately for raw material links if line number is changed.
Supported API: true- Specified by:
getUpdatedRMLinksForChangedAttributesin interfaceESIBOMDifferenceMangementDelegate- Overrides:
getUpdatedRMLinksForChangedAttributesin classcom.ptc.windchill.esi.delegate.AbstractESIBOMDifferenceMangementDelegate- Parameters:
link- - Input raw material link.changedRMLinks- - Map of changed raw material links.unchgRMLinksToRemove- - Changed raw material linkaddedRMLinks- - Map to populate added link if line number is changed.deletedRMLinks- - Map to populate deleted link if line number is changed.rmLinkAttrMap- - Input raw material link invalid input: '&' link attribute maps.builder- - Instance of VdbBuilder.ignoreLineNumbers- - Boolean value for ignore line number preference- Throws:
WTException- If any of the invoked APIs threw this exception.
-
updateMaps
public void updateMaps(RawMaterialLink link, Set<RawMaterialLink> rmLinksToAdd, Set<RawMaterialLink> rmLinksToDelete, VdbBuilder builder) Populate the added, deleted collections appropriately for raw material links.
Supported API: true- Overrides:
updateMapsin classcom.ptc.windchill.esi.delegate.AbstractESIBOMDifferenceMangementDelegate- Parameters:
link- - Input raw material link.rmLinksToAdd- - Collection of added raw material links.rmLinksToDelete- - Collection of deleted raw material link.builder- - Instance of VdbBuilder.- Throws:
WTException- If any of the invoked APIs threw this exception.
-
populateDelta
public void populateDelta(Set<Object> links, Map<ObjectToObjectLink, Persistable> linksToRoleBObjects, int type, Map<WTPartUsageLink, WTPart> delta) Populates the Map in delta using the input parameters. The method could typically be invoked once for each type of part usage links fetched from the object comparison framework - i.e., added, deleted, changed or unchanged. Supported API: true- Specified by:
populateDeltain interfaceESIBOMDifferenceMangementDelegate- Parameters:
links- - Set of part usage and raw material links obtained from the object comparison framework.linksToRoleBObjects- - Map holding part usage links as keys, and the other end (role B) objects as values that represent the usages of the BOM being published.type- - Its value indicates the type of part usage and raw material links that are passed in links. For e.g., a value 0 indicates added links, 1 indicates deleted links etc.delta- - Output Map to be populated with part usage links and the relevant other end objects. When invoked for deleted links, the Map will hold null values, considering that such links will not figure in linksToRoleBObjects.
-
getSnapshotToDelRMLinksMap
Fetches the deleted raw material links and snapshot map.
Supported API: true- Overrides:
getSnapshotToDelRMLinksMapin classcom.ptc.windchill.esi.delegate.AbstractESIBOMDifferenceMangementDelegate- Returns:
- Raw material and snapshot map.
-
setSnapshotToDelRMLinksMap
public void setSnapshotToDelRMLinksMap(Map<ESIReleasedObjectSnapshot, RawMaterialLink> snapshotToRMLinkMap) Sets the deleted raw material links and snapshot map
Supported API: true- Overrides:
setSnapshotToDelRMLinksMapin classcom.ptc.windchill.esi.delegate.AbstractESIBOMDifferenceMangementDelegate- Parameters:
snapshotToRMLinkMap- - snapshot and raw material link map.
-
getMfgHistoryLinks
public Set<RawMaterialLink> getMfgHistoryLinks(Map<WTPart, MfgHistory> mfgHistoryMap) throws WTExceptionFetches raw material links from manufacturing history link objects.
Supported API: true- Overrides:
getMfgHistoryLinksin classcom.ptc.windchill.esi.delegate.AbstractESIBOMDifferenceMangementDelegate- Parameters:
mfgHistoryMap- - WTPart and manufacturing history objects map.- Returns:
- Raw material links
- Throws:
WTException
-
getMfgHistoryDeletedLinks
public void getMfgHistoryDeletedLinks(RawMaterialLink link, Set<RawMaterialLink> unchgRMLinksToRemove, Set<RawMaterialLink> deletedRMLinks, Set<RawMaterialLink> rmLinks) throws WTException Populates links from unchanged collection into deleted collection based upon manufacturing history object's event type.
Supported API: true- Overrides:
getMfgHistoryDeletedLinksin classcom.ptc.windchill.esi.delegate.AbstractESIBOMDifferenceMangementDelegate- Parameters:
link- - Raw material link from unchanged links collection.unchgRMLinksToRemove- - Collection to populate unchanged raw material links to be removed.deletedRMLinks- - Collection to populate deleted raw material links.rmLinks- - Raw material links fetched from manufacturing history object.- Throws:
WTException
-
getDeletedRMLinks
public void getDeletedRMLinks(WTPart currentPart, Set<RawMaterialLink> deletedRMLinks, ESITarget esiTarget) throws WTException Fetches and populates deleted manufacturing history object links. Supported API: true- Overrides:
getDeletedRMLinksin classcom.ptc.windchill.esi.delegate.AbstractESIBOMDifferenceMangementDelegate- Parameters:
currentPart-deletedRMLinks- - Collection to populate deleted raw material links.esiTarget- - Instance of ESITarget object.- Throws:
WTException
-
getUnchangedRMLinks
public void getUnchangedRMLinks(Set<RawMaterialLink> unchangedRMLinks, Set<RawMaterialLink> unchgRMLinksToRemove, Set<RawMaterialLink> deletedRMLinks, VdbBuilder builder) throws WTException Fetches and populates unchanged manufacturing history object links.
Supported API: true- Overrides:
getUnchangedRMLinksin classcom.ptc.windchill.esi.delegate.AbstractESIBOMDifferenceMangementDelegate- Parameters:
unchangedRMLinks- - Collection to populate unchanged raw material links.unchgRMLinksToRemove- - Collection to populate unchanged raw material links to be removed.deletedRMLinks- - Collection to populate deleted raw material links.builder- - Instance of VDBbuilder.- Throws:
WTException
-
BOMUtility.compareLineNumbers(LineNumber, LineNumber)Supported API: true