Class LotBaselineImpactedDelegate

java.lang.Object
wt.impact.ImpactDelegate
wt.impact.ImpactedDelegate
wt.lotbaseline.LotBaselineImpactedDelegate
All Implemented Interfaces:
Serializable, Comparable<ImpactDelegate>

public class LotBaselineImpactedDelegate extends ImpactedDelegate
Delegate used to control the impacted behavior of LotBaseline objects.

This delegate should be registered as:

 &ltService context="default" name="wt.impact.ImpactedDelegate"&gt
     &ltOption selector="10" cardinality="duplicate"
     serviceClass="wt.lotbaseline.LotBaselineImpactedDelegate"
     requestor="wt.lotbaseline.LotBaseline"/&lt
 &lt/Service&gt
 
 Where:
     selector = Integer value defining the ascending order in which
                this delegate is applied. OOTB value is "10", but may
                be modified as needed per installation.
 


Supported API: true

Extendable: true
See Also:
  • Constructor Details

    • LotBaselineImpactedDelegate

      public LotBaselineImpactedDelegate()
      Default constructor.

      Supported API: true
    • LotBaselineImpactedDelegate

      public LotBaselineImpactedDelegate(Impacted impacted)
      Construct LotBaselineImpactedDelegate for an Impacted object.

      Supported API: true
    • LotBaselineImpactedDelegate

      public LotBaselineImpactedDelegate(WTCollection impacteds)
      Construct LotBaselineImpactedDelegate for a collection of Impacted objects.

      Supported API: true
  • Method Details

    • getMasterToLinkMap

      protected WTValuedMap getMasterToLinkMap(Impacted lotBaseline) throws WTException
      Get map of all lot baseline member masters to member links. The map is cached so it can be used by different apply methods. Apply methods should add and remove map entries to keep the map up to date.

      Supported API: true
      Parameters:
      lotBaseline - LotBaseline object for which map is returned.
      Returns:
      WTValuedMap of member master (deflated) to member link (inflated). Map is guaranteed non-null, but may be empty.
      Throws:
      WTException
    • updateMasterToLinkMap

      protected void updateMasterToLinkMap(Impacted lotBaseline, WTCollection memberLinks, boolean addToMap) throws WTException
      Update the common member links map.

      Supported API: true
      Parameters:
      memberLinks - A single or collection of FloatingBaselineMember links to be added to the map. All link references will be deflated.
      addToMap - True to add links to the map, false to remove them.
      Throws:
      WTException
    • applyRemoveImpact

      protected boolean applyRemoveImpact(LotBaseline lotBaseline, WTSet removedObjs) throws WTException
      Remove baseline members with matching revisions.

      Supported API: true
      Parameters:
      lotBaseline - LotBaseline object whose membership is being changed.
      removedObjs - Objects to be removed from membership. An object is only removed from baseline membership if it has same revision as the member link.
      Returns:
      True if one or more objects was removed from membership.
      Throws:
      WTException
    • applyAddImpact

      protected boolean applyAddImpact(LotBaseline lotBaseline, WTSet addedObjs) throws WTException
      Add new members that are not already in the baseline.

      Supported API: true
      Parameters:
      lotBaseline - LotBaseline object whose membership is being changed.
      addedObjs - Objects to be added as new members. An object is only added to baseline membership if its master is not already a member.
      Returns:
      True if one or more objects was added to membership.
      Throws:
      WTException
    • applyReplaceImpact

      protected boolean applyReplaceImpact(LotBaseline lotBaseline, WTSet replacedObjs) throws WTException
      Replace members that are already in the baseline with a different revision.

      Supported API: true
      Parameters:
      lotBaseline - LotBaseline object whose membership is being changed.
      replacedObjs - Objects to be replaced in the membership. An object is only replaced if it has a different revision already in the baseline.
      Returns:
      True if one or more objects was replaced in the membership.
      Throws:
      WTException
    • applyAddOrReplaceLatestImpact

      protected boolean applyAddOrReplaceLatestImpact(LotBaseline lotBaseline, WTSet addedReplacedObjs) throws WTException
      Add new members that are not already in the baseline or replace existing members with a later version.

      Supported API: true
      Parameters:
      lotBaseline - LotBaseline object whose membership is being changed.
      addedReplacedObjs - Objects to be added/replaced as new members. An object is only added to baseline membership if its master is not already a member, or replaces an existing member if it is a later version.
      Returns:
      True if one or more objects was added to or replaced in the membership.
      Throws:
      WTException
    • getMasterVersionRefPairMap

      protected WTKeyedMap getMasterVersionRefPairMap()
      Get map of master and version references for impacting objects. May only be called after first calling initializeMasterVersionRefPairMap(WTSet).

      Supported API: true
      Returns:
      Deflated map of impacting object reference to WTPair object. The WTPair contains deflated master (ref1) and version references (ref2) for the object. Guaranteed non-null, but may be empty.
      Throws:
      WTException
    • initializeMasterVersionRefPairMap

      protected void initializeMasterVersionRefPairMap(WTSet impactingObjs) throws WTException
      Initialize a cached, deflated map of object reference to WTPair object. The WTPair contains deflated master (ref1) and version references (ref2) for the object. Subsequent calls to getMasterVersionRefPairMap() will return the intialized map.

      Supported API: true
      Parameters:
      impactingObjs - Set of impacting objects.
      Throws:
      WTException
    • addOrReplaceMemberLinks

      protected void addOrReplaceMemberLinks(Impacted lotBaseline, WTSet members) throws WTException
      Add or replace LotBaseline membership and maintain the common member link map.

      Supported API: true
      Parameters:
      lotBaseline - LotBaseline object whose membership is being changed.
      members - New members and new revisions of existing members. Set will be automatically deflated unless it is fully inflated when passed in.
      Throws:
      WTException
    • createFloatingBaselineMemberLinks

      protected WTCollection createFloatingBaselineMemberLinks(LotBaseline lotBaseline, WTSet members) throws WTException
      Wrapper around call to LotBaselineService.createFloatingBaselineMemberLinks(LotBaseline, WTCollection). Extended delegates can override this method to get the set of new members being added and new versions being updated.

      Supported API: true
      Parameters:
      lotBaseline - LotBaseline object whose membership is being changed.
      members - New members and new revisions of existing members.
      Returns:
      Collection of created and updated links.
      Throws:
      WTException
    • removeMemberLinks

      protected void removeMemberLinks(Impacted lotBaseline, WTSet links) throws WTException
      Remove LotBaseline membership and maintain the common member link map.

      Supported API: true
      Parameters:
      lotBaseline - LotBaseline object whose membership is being changed.
      links - Existing FloatingBaselineMember links being removed.
      Throws:
      WTException
    • removeBaselinableObjects

      protected WTCollection removeBaselinableObjects(LotBaseline lotBaseline, WTSet masterRefs) throws WTException
      Wrapper around call to com.ptc.windchill.lotbaseline.LotBaselineService#removeBaselinableObjects(LotBaseline, WTCollection). Extended delegates can override this method to get the set of existing members being removed.

      Supported API: true
      Parameters:
      lotBaseline - LotBaseline object whose membership is being changed.
      masterRefs - Set of references to masters being removed.
      Returns:
      Collection of deleted links.
      Throws:
      WTException