Class PromotionNameAttributePopulator

java.lang.Object
com.ptc.core.components.forms.DefaultAttributePopulator
com.ptc.windchill.enterprise.maturity.forms.populators.PromotionNameAttributePopulator
All Implemented Interfaces:
com.ptc.core.components.forms.AttributePopulator, Externalizable, Serializable

public class PromotionNameAttributePopulator extends DefaultAttributePopulator implements Serializable
Will prepoluate the promotion request name in the promotion request wizard with a generated name from the first selected promotable object. The generated name with consist of 4 parts the Promotable object name, number, version and current date. The following is an example of a generated Promotion Request name of Part - WCDS000452, 01-32000.asm, A.1 (Design):

    01-32000.asm, WCDS000452, A.1, 2013-05-15
If the size of the generated Promotion Request name exceeds the Promotion Request max length for name than only the name of the Promotable will be used for generating the Promotion Request name. If the Promotable object name exceeds the max length for the Promotion Object name then the Promotable object name will be truncated to fit within the max limit.

To turn off prepolutation of the promotion request name the "wt.maturity.automaticNameGeneration.disabled" property can be set to true.

Supported API: true

Extendable: false
See Also:
  • Method Details

    • prePopulateAttributeDisplayValues

      public TypeInstance prePopulateAttributeDisplayValues(TypeInstance ti, NmCommandBean cb)
      Will prepoluate the promotion request name in the promotion request wizard with a generated name from the first selected promotable object.

      Supported API: true
      Specified by:
      prePopulateAttributeDisplayValues in interface com.ptc.core.components.forms.AttributePopulator
      Overrides:
      prePopulateAttributeDisplayValues in class DefaultAttributePopulator
      Parameters:
      ti - Promotion request type instance.
      cb - The current command bean.
      Returns:
      the modified type instance.
    • calculateNameAttribute

      protected String calculateNameAttribute(Object obj)
      Generates the name of the Promotion Request from the selected Promotable object. The generated name with consist of 4 parts the Promotable object name, number, version and current date.

      Supported API: true
      Parameters:
      obj - The selected Promotable object
      Returns:
      the name of the Promotion Notice
    • getNumber

      protected String getNumber(Object obj)
      Returns the number of the selected Promotable object.

      Supported API: true
      Parameters:
      obj - The selected Promotable object
      Returns:
      Number of the selected Promotable object.
    • getName

      protected String getName(Object obj) throws WTException
      Returns the name of the selected Promotable object.

      Supported API: true
      Parameters:
      obj - The selected Promotable object
      Returns:
      Name of the selected Promotable object.
      Throws:
      WTException
    • getVersion

      protected String getVersion(Object obj)
      Returns the version of the selected Promotable object. Returns an empty string, if the passed object is null or it's identifier is null or it's iteration identifier is null.

      Supported API: true
      Parameters:
      ver - The selected Promotable object
      Returns:
      The version of the selected Promotable object.