Class NotificationUtilities

  • java.lang.Object
    • com.thingworx.notifications.NotificationUtilities
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.lang.String replaceEventTokensInString​(java.lang.String content, InfoTable event, java.lang.String languages)


      Replaces the tokens for event data in a notification content string with the actual values from an event.
      static java.lang.String replaceTokensInString​(java.lang.String content, InfoTable event, InfoTable user, IServiceProvider serviceProvider, java.lang.String languages)


      Replaces the tokens in a notification content string with the actual values from an event, user or service.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • NotificationUtilities

        public NotificationUtilities()
    • Method Detail

      • replaceEventTokensInString

        @ThingworxExtensionApiMethod(since={7,4})
        public static java.lang.String replaceEventTokensInString​(java.lang.String content,
                                                                  InfoTable event,
                                                                  java.lang.String languages)
                                                           throws java.lang.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:
        java.lang.Exception - If there are circular dependencies in nested localization tokens.
      • replaceTokensInString

        @ThingworxExtensionApiMethod(since={8,0})
        public static java.lang.String replaceTokensInString​(java.lang.String content,
                                                             InfoTable event,
                                                             InfoTable user,
                                                             IServiceProvider serviceProvider,
                                                             java.lang.String languages)
                                                      throws java.lang.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:
        java.lang.Exception - If there are circular dependencies in nested localization tokens.