Class NotificationUtilities

java.lang.Object
com.thingworx.notifications.NotificationUtilities

@ThingworxExtensionApiClass(since={7,4}, canInstantiate=true) public class NotificationUtilities extends Object
A collection of utility methods used for processing notifications.
  • Constructor Details

    • NotificationUtilities

      public NotificationUtilities()
  • Method Details

    • replaceEventTokensInString

      @ThingworxExtensionApiMethod(since={7,4}) public static String replaceEventTokensInString(String content, InfoTable event, String languages) throws Exception


      Replaces the tokens for event data in a notification content string with the actual values from an event.
      Parameters:
      content - The content where the tokens should be replaced.
      event - The InfoTable representing the Event triggering the notification (based on the Event datashape).
      languages - The languages to localize to (in order of preference, comma-delimited).
      Returns:
      The processed string.
      Throws:
      Exception - If there are circular dependencies in nested localization tokens.
    • replaceTokensInString

      @ThingworxExtensionApiMethod(since={8,0}) public static String replaceTokensInString(String content, InfoTable event, InfoTable user, IServiceProvider serviceProvider, String languages) throws Exception


      Replaces the tokens in a notification content string with the actual values from an event, user or service.
      Parameters:
      content - The content where the tokens should be replaced.
      event - The InfoTable representing the Event triggering the notification (based on the Event datashape).
      user - The InfoTable representing the User recipient of the notification.
      serviceProvider - The service provider defining services to resolve service tokens.
      languages - The languages to localize to (in order of preference, comma-delimited).
      Returns:
      The processed string.
      Throws:
      Exception - If there are circular dependencies in nested localization tokens.