Class PromotionTargetsReviseValidator

java.lang.Object
com.ptc.core.ui.validation.DefaultValidationFilter
com.ptc.core.ui.validation.DefaultUIComponentValidator
com.ptc.windchill.enterprise.maturity.validators.PromotionTargetsReviseValidator
All Implemented Interfaces:
UIComponentValidator, ValidationFilter

public class PromotionTargetsReviseValidator extends DefaultUIComponentValidator
Validates that the promotion candidates are ready to be revised. Objects that are eligible to revised are returned in the result set as a result with a status of UIValidationStatus.ENABLED or UIValidationStatus.PERMITTED. For promotion candidates that are not eligible for revising the result will contain a feedback message that is of type FeedbackType.ERROR.

In order to invoke this validator call the
invalid reference
#performFullPreValidation(PromotionNotice)
. This API will instantiate this validator class or the validator registered for "revisePromotionTargets" selector.

Supported API: true

Extendable: true
  • Method Details

    • validatePromotionTargetsArePromoted

      protected WTCollection validatePromotionTargetsArePromoted(UIValidationResultSet resultSet, PromotionNotice pn, WTCollection promotionTargets, Locale locale)
      Validate that the promotion targets have been promoted already if not returns an empty list of valid promotion targets. The promotion date is set when the promotion targets are promoted.

      Supported API: true
      Parameters:
      resultSet -
      pn -
      promotionTargets -
      locale -
    • validatePromotionRevisePreference

      protected WTCollection validatePromotionRevisePreference(UIValidationResultSet resultSet, PromotionNotice pn, WTCollection promotionTargets, Locale locale) throws WTException
      Checks the revise promotion targets preference for all targets, targets only with new series, or none and then will filter based on the preference. Will update the UIValidationResultSet with the denied target objects and return the collection only with valid objects eligible for revision. Following actions will take place depending on the preference selected:
      None-Do nothing - The return collection will be empty with UIValidationStatus to DENIED for all the promotables.
      Automatically revise all the promotion candidates - Will return the passed in promotionTargets collection.
      Automatically revise only the promotion targets with versioning scheme changed - Will update the UIValidationStatus.DENIED status to objects with no versioning series changed.
      Preference value is calculated for the container of the Promotable.

      Supported API: true
      Parameters:
      resultSet -
      pn -
      promotionTargets -
      locale -
      Throws:
      WTException
    • getReviseResultSetMessage

      public static String getReviseResultSetMessage(UIValidationResultSet resultSet, Locale locale) throws WTException
      Given a validation result set will filter any results with a status UIValidationStatus.PERMITTED or UIValidationStatus.ENABLED in order to generate a message of the promotion candidates that were not able to be revised. If an empty message is returned then all promotion candidates were successfully revised.

      Supported API: true
      Throws:
      WTException