Class TransactionWarningEmailDelegate

java.lang.Object
com.ptc.windchill.esi.delegate.TransactionWarningEmailDelegate
All Implemented Interfaces:
TransactionWarningDelegate

public class TransactionWarningEmailDelegate extends Object implements TransactionWarningDelegate
This class sends the warning messages in form of email to the appropriate principals.
The warning email will be sent when there are warning generated during the publication in following scenarios.
  • Publication expressions that has alias or functions
  • Publication rules that has alias
  • Publication option set that has global rules used in it
Notification in form of Email will be sent to creator of Enterprise Systems Transaction.

Supported API: true

Extendable: true
  • Method Details

    • sendNotification

      public void sendNotification(VdbBuilder builder) throws Exception
      This method add the entry to the email queue and sends the email to the appropriate recipient.

      Specified by:
      sendNotification in interface TransactionWarningDelegate
      Parameters:
      builder - - The VdbBuilder instance containing warning information for the in-progress ESI Transaction. Supported API: true
      Throws:
      Exception
    • buildSubject

      protected String buildSubject(VdbBuilder builder, String targetNames) throws WTException
      Builds the message for the subject of email.

      Supported API: true
      Parameters:
      builder - - The VdbBuilder instance containing warning information for the in-progress ESI Transaction.
      Returns:
      - Localized subject for email notification containing informaton about transaction number, primary business object, esi target
      Throws:
      WTException
    • buildMessage

      protected String buildMessage(VdbBuilder builder, String targetNames) throws WTException
      Build the message for the email.

      Supported API: true
      Parameters:
      builder - - The VdbBuilder instance containing warning information for the in-progress ESI Transaction.
      target - - The set of targets for which this transaction is processed
      Returns:
      -The message representation for warning notification
      Throws:
      WTException
    • getTargetIds

      protected String getTargetIds(Set<ESITarget> targets)
      Returns the string for set of targets.

      Supported API: true
      Parameters:
      target - - The set of targets for which string identification is needed
      Returns:
      - The comma saperated list of targets.
    • getSender

      protected String getSender() throws IOException
      Returns the value for property wt.notify.notificationSenderEmail from wt.properties which is used as the sender.

      Supported API: true
      Returns:
      Throws:
      IOException
    • getWTPrincipalList

      protected Set<WTPrincipal> getWTPrincipalList(VdbBuilder builder) throws WTException
      Returns the WTPrincipal object list, the WTPrincipal list is decided based on the following criteria - If the transaction happened with Change - the recipient would be the creator of the change. If the transaction happened with Promotion - the recipient would be the creator of the promotion. In other cases (i.e. adhoc publishing or set state publishing) - the recipient would be the current session user.

      Supported API: true
      Parameters:
      builder - - The VdbBuilder instance containing warning information for the in-progress ESI Transaction.
      Returns:
      - The WTPrincipal list for sending notification
      Throws:
      WTException