Class ReplacePartUsageFilterDelegate

All Implemented Interfaces:
MassChangeFilterDelegate

public class ReplacePartUsageFilterDelegate extends AbstractPartUsageFilterDelegate
This filter delegate determines whether the selected objects are eligible for the mass change operation for the selected parts. The delegate filters invalid selected objects or replaces the part usage links for the valid objects selected with the user specified replacement part.

If this delegate is extended or replaced with a customized delegate, the action for the mass change operation should be overridden in a customized actions.xml. The customized delegate should be registered as the command class in the overridden mass change operation action.
This operation is currently registered with the action name replacePartUsage.

Extendable: true

Supported API: true

See Also:
  • Method Details

    • preProcessOperation

      protected void preProcessOperation(MassChangeFilterState mcFilterState) throws WTException
      Replace associations between target objects and the specified part.
      Overridden methods must have first line: super.preProcessOperation(mcFilterState)

      Supported API: true
      Overrides:
      preProcessOperation in class AbstractPartUsageFilterDelegate
      Parameters:
      mcFilterState - MassChangeFilterState object populated with mass change target objects.
      Throws:
      WTException
    • preEvaluate

      protected void preEvaluate(MassChangeFilterState mcFilterState) throws WTException
      Filter out mass change target parts that:
      1. Share the same master as the new child part.
      2. Violate an association constraint with the new child part.
      3. Do not actually use the child part or have different line or find number values.
      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 AbstractPartUsageFilterDelegate
      Parameters:
      mcFilterState - MassChangeFilterState object populated with mass change target objects.
      Throws:
      WTException
    • getHintText

      public String getHintText()
      Retrieve the hint text for the replacement mass change operation.

      Supported API: true
      Specified by:
      getHintText in interface MassChangeFilterDelegate
      Overrides:
      getHintText in class AbstractDefaultFilterDelegate
      Returns:
      String
    • validateFormSubmission

      public UIValidationResult validateFormSubmission(UIValidationCriteria validationCriteria) throws WTException
      Validates the selected replacement part is not the same as the selected current part.
      Specified by:
      validateFormSubmission in interface MassChangeFilterDelegate
      Overrides:
      validateFormSubmission in class AbstractPartUsageFilterDelegate
      Parameters:
      validationCriteria - - UIValidationCriteria object that holds client data
      Returns:
      UIValidationStatus.DENIED when the replacement part and current part are the same.

      Supported API: true
      Throws:
      WTException
    • getReplacementChildPart

      protected WTPart getReplacementChildPart() throws WTException
      Returns the original copy of the part that is going to replace the existing one. 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