Class AbstractPartUsageFilterDelegate

All Implemented Interfaces:
MassChangeFilterDelegate
Direct Known Subclasses:
AddPartUsageFilterDelegate, ChangePartUsageFilterDelegate, RemovePartUsageFilterDelegate, ReplacePartUsageFilterDelegate

public abstract class AbstractPartUsageFilterDelegate extends AbstractWorkableFilterDelegate
This delegate contains filter logic to exclude row objects from a mass change operation based on logic that is specific to WTPartUsageLink operations.

Extendable: true

Supported API: true
See Also:
  • Method Details

    • validateFormSubmission

      public UIValidationResult validateFormSubmission(UIValidationCriteria validationCriteria) throws WTException
      Implementation used for Part Usage operations of the Mass Change wizard. This will validate that if a build option is selected then the child part(s) is build from CAD.

      Supported API: true
      Specified by:
      validateFormSubmission in interface MassChangeFilterDelegate
      Overrides:
      validateFormSubmission in class AbstractDefaultFilterDelegate
      Parameters:
      validationCriteria - - UIValidationCriteria object that holds client data
      Returns:
      UIValidationResult
      Throws:
      WTException
    • preEvaluate

      protected void preEvaluate(MassChangeFilterState mcFilterState) throws WTException
      Filter out mass change target parts that are either:
      1. Built from CAD documents if such parts are to be excluded.
      2. Build from CAD if their owning CAD document is not in the change notice and this policy preference is enabled.
      3. To be built and published, but the owning CAD document cannot be modified.
      Filtered objects will be marked as excluded. Objects already excluded will not be evaluated.

      Overridden methods must have first line: super.preEvaluate(mcFilterState)

      Supported API: true

      Overrides:
      preEvaluate in class AbstractWorkableFilterDelegate
      Parameters:
      mcFilterState - MassChangeFilterState object populated with mass change target objects.
      Throws:
      WTException
    • filterBuiltFromCad

      protected void filterBuiltFromCad(MassChangeFilterState mcFilterState) throws WTException
      Filter out mass change target parts built from owning CAD documents. Filtered objects will be marked as excluded. Objects already excluded will not be evaluated.

      Supported API: true
      Parameters:
      mcFilterState - MassChangeFilterState object populated with mass change target objects.
      Throws:
      WTException
    • filterCadNotInChange

      protected void filterCadNotInChange(MassChangeFilterState mcFilterState, ChangeOrder2 changeOrder) throws WTException
      Filter out mass change target parts whose built from owning CAD documents are not in the change order. Filtered objects will be marked as excluded. Objects already excluded will not be evaluated.

      Supported API: true
      Parameters:
      mcFilterState - MassChangeFilterState object populated with mass change target objects.
      changeOrder - Change order from which the mass change operation was invoked.
      Throws:
      WTException
    • filterSameMaster

      protected void filterSameMaster(MassChangeFilterState mcFilterState, WTPart childPart) throws WTException
      Filter out mass change target parts that share the same master as the new child part. Filtered objects will be marked as excluded. Objects already excluded will not be evaluated.

      Supported API: true
      Parameters:
      mcFilterState - MassChangeFilterState object populated with mass change target objects.
      childPart - Child part used to filter target parts.
      Throws:
      WTException
    • filterUsage

      protected void filterUsage(MassChangeFilterState mcFilterState, WTPart childPart, String lineNumberOnFilter, String findNumberOnFilter) throws WTException
      Filter out mass change target parts that do not actually use the old child part, or do not have the specified line/find number. Filtered objects will be marked as excluded. Objects already excluded will not be evaluated.

      Supported API: true
      Parameters:
      mcFilterState - MassChangeFilterState object populated with mass change target objects.
      childPart - Child part used to filter target parts.
      lineNumberOnFilter - Child part usage line number (null if not used).
      findNumberOnFilter - Child part usage find number (null if not used).
      Throws:
      WTException
    • filterDuplicateLineFindNumber

      protected void filterDuplicateLineFindNumber(MassChangeFilterState mcFilterState, String lineNumber, String findNumber) throws WTException
      Filter out mass change target parts that would result in a duplicate line or find number. Filtered objects will be marked as excluded. Objects already excluded will not be evaluated.

      Supported API: true
      Parameters:
      mcFilterState - MassChangeFilterState object populated with mass change target objects.
      lineNumber - Line number to compare for duplicates (null if not used).
      findNumber - Find number to compare for duplicates (null if not used).
      targetToLinksMap - Map mass change target object to its usage links (created if null).
      Throws:
      WTException
    • usageLinksChanged

      protected final boolean usageLinksChanged()
      Return true if usage links have been updated by delegate, false if not.

      Supported API: true
    • getSearchChildPart

      protected WTPart getSearchChildPart() throws WTException
      Return child part used to search for usage links created or updated in the mass change operation (null if no usages links can be found).

      Supported API: true
      Throws:
      WTException
    • getSearchLineNumber

      protected String getSearchLineNumber() throws WTException
      Return line number used to search for usage links created or updated in the mass change operation (null if not specified).

      Supported API: true
      Throws:
      WTException
    • getSearchFindNumber

      protected String getSearchFindNumber() throws WTException
      Return find number used to search for usage links created or updated in the mass change operation (null if not specified).

      Supported API: true
      Throws:
      WTException
    • getUsageLinks

      protected final WTKeyedMap getUsageLinks(MassChangeFilterState mcFilterState) throws WTException
      Get usage links created or updated in the mass change operation.

      Supported API: true
      Parameters:
      mcFilterState - MassChangeFilterState object populated with mass change target objects.
      Returns:
      Map of original target object to a WTSet of its usage links (guaranteed non-null, may be empty).
      Throws:
      WTException
    • preProcessOperation

      protected void preProcessOperation(MassChangeFilterState mcFilterState) throws WTException
      Update associations between target objects and the specified document.

      Overridden methods must have first line: super.preProcessOperation(mcFilterState)

      Supported API: true

      Overrides:
      preProcessOperation in class AbstractWorkableFilterDelegate
      Parameters:
      mcFilterState - MassChangeFilterState object populated with mass change target objects.
      Throws:
      WTException
    • getChildPart

      public WTPart getChildPart() throws WTException
      Returns the original copy of the source child part. If one is not found, or if it is not a WTPart, then this will return null.

      Supported API: true
      Throws:
      WTException - thrown if the object found is not a Changeable2