Class RootEntity

    • Field Detail

      • BASIC_PROPERTIES

        public static final java.util.TreeSet<java.lang.String> BASIC_PROPERTIES
        Set of basic properties for any entity.
    • Constructor Detail

      • RootEntity

        public RootEntity()
    • Method Detail

      • GetOwner

        @ThingworxExtensionApiMethod(since={8,4})
        public java.lang.String GetOwner()
                                  throws java.lang.Exception
        Service Category:
        Permissions
        Service Description:
        Get an owner to this entity.
        Returns:
        result User name - USERNAME
        Throws:
        java.lang.Exception - If an error occurs
      • SetOwner

        @ThingworxExtensionApiMethod(since={6,6})
        public void SetOwner​(java.lang.String name)
                      throws java.lang.Exception
        Service Category:
        Permissions
        Service Description:
        Assign an owner to this entity.
        Parameters:
        name - User name - USERNAME
        Throws:
        java.lang.Exception - If an error occurs
      • AddRunTimePermission

        @ThingworxExtensionApiMethod(since={6,6})
        public void AddRunTimePermission​(java.lang.String type,
                                         java.lang.String resource,
                                         java.lang.String principal,
                                         java.lang.String principalType,
                                         java.lang.Boolean allow)
                                  throws java.lang.Exception
        Service Category:
        Permissions
        Service Description:
        Add a run time permission.
        Parameters:
        type - Permission type (PropertyRead PropertyWrite ServiceInvoke EventInvoke EventSubscribe) - STRING
        resource - Resource name (* = all or enter a specific resource (i.e. Service, Property, Event) to override) - STRING
        principal - Principal name (name of user or group) - STRING
        principalType - Principal type (User or Group) - STRING
        allow - Permission (true = allow, false = deny) - BOOLEAN
        Throws:
        java.lang.Exception - If an error occurs

        Additional Information The user that calls this service must have service invoke permissions on the entity that they are adding the run time permission to. For example, If UserA doesn't have ServiceInvoke permission on ThingA, then it won't be able to call the AddRunTimePermission service on the thing.
      • DeleteRunTimePermission

        @ThingworxExtensionApiMethod(since={6,6})
        public void DeleteRunTimePermission​(java.lang.String type,
                                            java.lang.String resource,
                                            java.lang.String principal,
                                            java.lang.String principalType)
                                     throws java.lang.Exception
        Service Category:
        Permissions
        Service Description:
        Delete a run time permission.
        Parameters:
        type - Permission type - STRING
        resource - Resource name - STRING
        principal - Principal name (name of user or group) - STRING
        principalType - Principal type (User or Group) - STRING
        Throws:
        java.lang.Exception - If an error occurs
      • GetRunTimePermissionsAsJSON

        @ThingworxExtensionApiMethod(since={6,6})
        public org.json.JSONObject GetRunTimePermissionsAsJSON()
                                                        throws java.lang.Exception
        Service Category:
        Permissions
        Service Description:
        Get a list of assigned runtime permissions.
        Returns:
        result Permission list - JSON
        Throws:
        java.lang.Exception - If an error occurs
      • SetRunTimePermissionsAsJSON

        @ThingworxExtensionApiMethod(since={6,6})
        public void SetRunTimePermissionsAsJSON​(org.json.JSONObject permissions)
                                         throws java.lang.Exception
        Service Category:
        Permissions
        Service Description:
        Set a list of assigned runtime permissions.
        Parameters:
        permissions - Permissions in JSON format - JSON
        Throws:
        java.lang.Exception - If an error occurs
      • GetRunTimePermissions

        @ThingworxExtensionApiMethod(since={6,6})
        public InfoTable GetRunTimePermissions()
                                        throws java.lang.Exception
        Service Category:
        Permissions
        Service Description:
        Get a list of assigned runtime permissions.
        Returns:
        result Permission list - INFOTABLE - Aspects {dataShape:Permissions}
        Throws:
        java.lang.Exception - If an error occurs
      • AddDesignTimePermission

        @ThingworxExtensionApiMethod(since={6,6})
        public void AddDesignTimePermission​(java.lang.String type,
                                            java.lang.String principal,
                                            java.lang.String principalType,
                                            java.lang.Boolean allow)
                                     throws java.lang.Exception
        Service Category:
        Permissions
        Service Description:
        Add a design time permission.
        Parameters:
        type - Permission type (Create, Read, Update, Delete) - STRING
        principal - Principal name (name of user or group) - STRING
        principalType - Principal type (User or Group) - STRING
        allow - Permission (true = allow, false = deny) - BOOLEAN
        Throws:
        java.lang.Exception - If an error occurs

        Additional Information If a value is not passed for the allow parameter, the default permission will be set to true.
      • DeleteDesignTimePermission

        @ThingworxExtensionApiMethod(since={6,6})
        public void DeleteDesignTimePermission​(java.lang.String type,
                                               java.lang.String principal,
                                               java.lang.String principalType)
                                        throws java.lang.Exception
        Service Category:
        Permissions
        Service Description:
        Delete a design time permission.
        Parameters:
        type - Permission type - STRING
        principal - Principal name (name of user or group) - STRING
        principalType - Principal type (User or Group) - STRING
        Throws:
        java.lang.Exception - If an error occurs
      • GetDesignTimePermissionsAsJSON

        @ThingworxExtensionApiMethod(since={6,6})
        public org.json.JSONObject GetDesignTimePermissionsAsJSON()
                                                           throws java.lang.Exception
        Service Category:
        Permissions
        Service Description:
        Get a list of assigned designtime permissions.
        Returns:
        result Permission list - JSON
        Throws:
        java.lang.Exception - If an error occurs
      • SetDesignTimePermissionsAsJSON

        @ThingworxExtensionApiMethod(since={6,6})
        public void SetDesignTimePermissionsAsJSON​(org.json.JSONObject permissions)
                                            throws java.lang.Exception
        Service Category:
        Permissions
        Service Description:
        Set a list of assigned design time permissions.
        Parameters:
        permissions - Permissions in JSON format - JSON
        Throws:
        java.lang.Exception - If an error occurs
      • GetDesignTimePermissions

        @ThingworxExtensionApiMethod(since={6,6})
        public InfoTable GetDesignTimePermissions()
                                           throws java.lang.Exception
        Service Category:
        Permissions
        Service Description:
        Get a list of assigned design time permissions.
        Returns:
        result Permission list - INFOTABLE - Aspects {dataShape:Permissions}
        Throws:
        java.lang.Exception - If an error occurs
      • AddVisibilityPermission

        @ThingworxExtensionApiMethod(since={6,6})
        public void AddVisibilityPermission​(java.lang.String principal,
                                            java.lang.String principalType)
                                     throws java.lang.Exception
        Service Category:
        Permissions
        Service Description:
        Add a visibility permission.
        Parameters:
        principal - Principal name (name of organization or organization unit) - STRING
        principalType - Principal type (Organization or Organization Unit) - STRING
        Throws:
        java.lang.Exception - If an error occurs

        Additional Information
        • For the principal input, the name of the organization must be followed by a colon and the organizational unit name. For example, for an organization unit named Test_OrganizationUnit that is derived from an organization named TestOrganization, specify the principal input as follows: Test_Organization:Test_OrganizationalUnit
        • The top-most level of an organization (the organizational unit with the same name as the organization entity) can also be set as the principal input using the convention above (the principaltype must be set to OrganizationalUnit instead of Organization. For example, Test_Organization:Test_Organization
        • The permission applies only to members of the top-most level of the organization, as the permission does not flow down to all organizational units.
        • To add the permission to the entire organization and its organization units, the principalType parameter must be specified as Organization and the name of the organization in the principal parameter.
      • DeleteVisibilityPermission

        @ThingworxExtensionApiMethod(since={6,6})
        public void DeleteVisibilityPermission​(java.lang.String principal,
                                               java.lang.String principalType)
                                        throws java.lang.Exception
        Service Category:
        Permissions
        Service Description:
        Delete a visibility permission.
        Parameters:
        principal - Principal name (name of organization or organization unit) - STRING
        principalType - Principal type (Organization or Organization Unit) - STRING
        Throws:
        java.lang.Exception - If an error occurs
      • GetVisibilityPermissionsAsJSON

        @ThingworxExtensionApiMethod(since={6,6})
        public org.json.JSONObject GetVisibilityPermissionsAsJSON()
                                                           throws java.lang.Exception
        Service Category:
        Permissions
        Service Description:
        Get a list of assigned visibility permissions.
        Returns:
        result Permission list - JSON
        Throws:
        java.lang.Exception - If an error occurs
      • SetVisibilityPermissionsAsJSON

        @ThingworxExtensionApiMethod(since={6,6})
        public void SetVisibilityPermissionsAsJSON​(org.json.JSONObject permissions)
                                            throws java.lang.Exception
        Service Category:
        Permissions
        Service Description:
        Set a list of assigned visibility permissions.
        Parameters:
        permissions - Permissions in JSON format - JSON
        Throws:
        java.lang.Exception - If an error occurs
      • GetVisibilityPermissions

        @ThingworxExtensionApiMethod(since={6,6})
        public InfoTable GetVisibilityPermissions()
                                           throws java.lang.Exception
        Service Category:
        Permissions
        Service Description:
        Get a list of assigned visibility permissions.
        Returns:
        result Permission list - INFOTABLE - Aspects {dataShape:Permissions}
        Throws:
        java.lang.Exception - If an error occurs
      • CheckPermission

        @ThingworxExtensionApiMethod(since={6,6})
        public java.lang.Boolean CheckPermission​(java.lang.String type,
                                                 java.lang.String name)
                                          throws java.lang.Exception
        Service Category:
        Permissions
        Service Description:
        Check to see if an entity has a specific run time permission for the current user.
        Parameters:
        type - Permission type - STRING
        name - Name of the resource (i.e. property, service, event) to check - STRING
        Returns:
        result True/false based on if the user has the specified permission - BOOLEAN
        Throws:
        java.lang.Exception - If an error occurs

        Additional Information

        The valid inputs for the type parameter are (case sensitive): PropertyRead, PropertyWrite, EventSubscribe , EventInvoke, ServiceInvoke

        .
      • CheckPermissionForUser

        @ThingworxExtensionApiMethod(since={6,6})
        public java.lang.Boolean CheckPermissionForUser​(java.lang.String user,
                                                        java.lang.String type,
                                                        java.lang.String name)
                                                 throws java.lang.Exception
        Service Category:
        Permissions
        Service Description:
        Check to see if an entity has a specific run time permission for a specific user.
        Parameters:
        user - User name - USERNAME
        type - Permission type - STRING
        name - Name of the resource (i.e. property, service, event) to check - STRING
        Returns:
        result True/false based on if the user has the specified permission - BOOLEAN
        Throws:
        java.lang.Exception - If an error occurs

        Additional Information

        The valid inputs for the type parameter are (case sensitive): PropertyRead, PropertyWrite, EventSubscribe , EventInvoke, and ServiceInvoke

        .
      • CheckPermissionForGroup

        @ThingworxExtensionApiMethod(since={6,6})
        public java.lang.Boolean CheckPermissionForGroup​(java.lang.String group,
                                                         java.lang.String type,
                                                         java.lang.String name)
                                                  throws java.lang.Exception
        Service Category:
        Permissions
        Service Description:
        Check to see if an entity has a specific run time permission for a specific group.
        Parameters:
        group - Group name - GROUPNAME
        type - Permission type - STRING
        name - Name of the resource (i.e. property, service, event) to check - STRING
        Returns:
        result True/false based on if the group has the specified permission - BOOLEAN
        Throws:
        java.lang.Exception - If an error occurs

        Additional Information

        The valid inputs for the type parameter are (case sensitive): PropertyRead, PropertyWrite, EventSubscribe , EventInvoke, and ServiceInvoke

        .

        If the current user does not have visibility to the group being checked, then the permission will be returned as false (with no exception message).

      • CheckDesignTimePermission

        @ThingworxExtensionApiMethod(since={6,6})
        public java.lang.Boolean CheckDesignTimePermission​(java.lang.String type)
                                                    throws java.lang.Exception
        Service Category:
        Permissions
        Service Description:
        Check to see if an entity has a specific design time permission for the current user.
        Parameters:
        type - Permission type - STRING
        Returns:
        result True/false based on if the user has the specified permission - BOOLEAN
        Throws:
        java.lang.Exception - If an error occurs

        Additional Information

        The service returns only true or false. If false, the exception message is not returned.

        The type input can be one of the following (case-sensitive): Create, Read, Update, or Delete.

        The current user must also have ServiceInvoke permission on the entity that they're trying to check the design time permission on.

      • CheckDesignTimePermissionForUser

        @ThingworxExtensionApiMethod(since={6,6})
        public java.lang.Boolean CheckDesignTimePermissionForUser​(java.lang.String user,
                                                                  java.lang.String type)
                                                           throws java.lang.Exception
        Service Category:
        Permissions
        Service Description:
        Check to see if an entity has a specific design time permission for a specific user.
        Parameters:
        user - User name - USERNAME
        type - Permission type - STRING
        Returns:
        result True/false based on if the user has the specified permission - BOOLEAN
        Throws:
        java.lang.Exception - If an error occurs

        Additional Information

        The service returns only true or false. If false, the exception message is not returned.

        The type input can be one of the following (case-sensitive): Create, Read, Update, or Delete.

        If the current user does not have visibility on the user being passed, then the service will return false (with no message/exception). However, if the current user doesn't have visibility on the entity being checked (e.g. a Thing) but has design time permissions on the entity, then the service will return true for the specific permission.

      • CheckDesignTimePermissionForGroup

        @ThingworxExtensionApiMethod(since={6,6})
        public java.lang.Boolean CheckDesignTimePermissionForGroup​(java.lang.String group,
                                                                   java.lang.String type)
                                                            throws java.lang.Exception
        Service Category:
        Permissions
        Service Description:
        Check to see if an entity has a specific design time permission for a specific group.
        Parameters:
        group - Group name - GROUPNAME
        type - Permission type - STRING
        Returns:
        result True/false based on if the group has the specified permission - BOOLEAN
        Throws:
        java.lang.Exception - If an error occurs

        Additional Information

        The service returns only true or false. If false, the exception message is not returned.

        The type input can be one of the following (case-sensitive): Create, Read, Update, or Delete.

        The current user must also have ServiceInvoke permission on the entity that they're trying to check the design time permission on.

      • validateConfiguration

        @ThingworxExtensionApiMethod(since={6,6})
        public void validateConfiguration​(ImportedEntityCollection importedEntityCollections)
                                   throws java.lang.Exception


        Validates the configuration of the entity during the import process. This method is called whenever a entity is created or modified via the REST APIs. During the validation step, there may be other associated entities that are being imported. These can be accessed via the importedEntities collection if needed.

        Note that some resources belonging to the entity or other associated entities may not be available during this step in the lifecycle.

        It is required for all subclasses of RootEntity to call super.validateConfiguration(importedEntityCollections) if they override this method.

        Parameters:
        importedEntityCollections - - a typed collection of entities currently being imported
        Throws:
        java.lang.Exception - if the entity is invalid
      • GetLastModifiedDate

        @ThingworxExtensionApiMethod(since={6,6})
        public org.joda.time.DateTime GetLastModifiedDate()
        Service Category:
        Editing
        Service Description:
        Get the date edit was last modified.
        Returns:
        lastModifiedDate Last modified date - DATETIME
      • preInitializeEntity

        @ThingworxExtensionApiMethod(since={6,6},
                                     canOverride=true)
        public void preInitializeEntity()
                                 throws java.lang.Exception


        Pre initialize the entity.
        Throws:
        java.lang.Exception - if an error occurs during the pre-initialization process
      • initializeEntity

        @ThingworxExtensionApiMethod(since={9,0},
                                     canOverride=true)
        public void initializeEntity​(ContextType contextType)
                              throws java.lang.Exception


        Initializes the internal state of the entity. This method may be called more than once on the same entity during initialization.

        All metadata, including aspects and configuration tables, are available at this point in the lifecycle.

        Parameters:
        contextType - the patch operation
        Throws:
        java.lang.Exception - if an error occurs during the initialization process
      • cleanupEntity

        @ThingworxExtensionApiMethod(since={9,0},
                                     canOverride=true)
        public void cleanupEntity​(ContextType contextType)
                           throws java.lang.Exception


        Releases all managed or long-lived resources held by the entity. Cleanup that should be done regardless of patchRemove or delete should be done here

        All metadata, including aspects and configuration tables, are available at this point in the lifecycle. Extensions should not attempt to clean up metadata or any other resources that are managed internally by Thingworx.

        Parameters:
        contextType - model synchronization patch operation
        Throws:
        java.lang.Exception - if an error occurs during the cleanup process
      • GetConfigurationChangeHistory

        @ThingworxExtensionApiMethod(since={6,6})
        public InfoTable GetConfigurationChangeHistory()
                                                throws java.lang.Exception
        Service Category:
        Editing
        Service Description:
        Get the configuration change history.
        Returns:
        result Configuration changes - INFOTABLE - Aspects {dataShape:ConfigurationChange}
        Throws:
        java.lang.Exception - If an error occurs

        Additional Information

        This service is not specific to configuration tables. Any create or update to an entity is listed in the change history.

      • GetSummaryInformation

        @ThingworxExtensionApiMethod(since={6,6})
        public InfoTable GetSummaryInformation()
                                        throws java.lang.Exception
        Service Category:
        Metadata
        Service Description:
        Get summary information.
        Returns:
        Summary Summary information - INFOTABLE - Aspects {dataShape:EntitySummary}
        Throws:
        java.lang.Exception - If an error occurs
      • GetDescription

        @ThingworxExtensionApiMethod(since={6,6})
        public java.lang.String GetDescription()
        Service Category:
        Metadata
        Service Description:
        Get the description for an entity.
        Returns:
        description description - STRING
      • SetDescription

        @ThingworxExtensionApiMethod(since={6,6})
        public void SetDescription​(java.lang.String description)
                            throws java.lang.Exception
        Service Category:
        Metadata
        Service Description:
        Overwrite/set the description for an entity.
        Parameters:
        description - Description for an entity - STRING
        Throws:
        java.lang.Exception - If an error occurs
      • SetTags

        @ThingworxExtensionApiMethod(since={6,6})
        public void SetTags​(TagCollection tags)
                     throws java.lang.Exception
        Service Category:
        Metadata
        Service Description:
        Overwrite/set the tags for an entity.
        Parameters:
        tags - Tags for an entity - TAGS
        Throws:
        java.lang.Exception - If an error occurs
      • GetTagsAsInfoTable

        @ThingworxExtensionApiMethod(since={6,6})
        public InfoTable GetTagsAsInfoTable()
                                     throws java.lang.Exception
        Service Category:
        Metadata
        Service Description:
        Get the tags for an entity as an InfoTable.
        Returns:
        tags tags - INFOTABLE - Aspects {dataShape:VocabularyTermList}
        Throws:
        java.lang.Exception - If an error occurs
      • AddTags

        @ThingworxExtensionApiMethod(since={6,6})
        public void AddTags​(TagCollection tags)
                     throws java.lang.Exception
        Service Category:
        Metadata
        Service Description:
        Append additional tags to an entity.
        Parameters:
        tags - Tags for an entity - TAGS
        Throws:
        java.lang.Exception - If an error occurs

        Additional Information AddTags can be used to append new tags to an entity with existing tags. Tags are not overwritten. Use the SetTags service to overwrite existing tags.
      • RemoveTags

        @ThingworxExtensionApiMethod(since={6,6})
        public void RemoveTags​(TagCollection tags)
                        throws java.lang.Exception
        Service Category:
        Metadata
        Service Description:
        Remove tags from an entity.
        Parameters:
        tags - Tags to remove from the entity - TAGS
        Throws:
        java.lang.Exception - If an error occurs
      • GetHomeMashup

        @ThingworxExtensionApiMethod(since={6,6})
        public java.lang.String GetHomeMashup()
        Service Category:
        Mashups
        Service Description:
        Get home mashup.
        Returns:
        HomeMashup Home mashup - MASHUPNAME
      • SetHomeMashup

        @ThingworxExtensionApiMethod(since={6,6})
        public void SetHomeMashup​(java.lang.String name)
                           throws java.lang.Exception
        Service Category:
        Mashups
        Service Description:
        Set home mashup.
        Parameters:
        name - Home mashup name - MASHUPNAME
        Throws:
        java.lang.Exception - If an error occurs
      • GetAvatar

        @ThingworxExtensionApiMethod(since={6,6})
        public ImagePrimitive GetAvatar()
                                 throws java.lang.Exception
        Service Category:
        Metadata
        Service Description:
        Get avatar image.
        Specified by:
        GetAvatar in interface IAvatar
        Returns:
        Avatar Entity avatar - IMAGE
        Throws:
        java.lang.Exception - If an error occurs
      • GetAvatarURL

        @ThingworxExtensionApiMethod(since={6,6})
        public java.lang.String GetAvatarURL()
        Service Category:
        Metadata
        Service Description:
        Get avatar image url.
        Returns:
        result Entity avatar URL - IMAGELINK

        Additional Information

        Returns a URL for an avatar. Example: /Thingworx/Things/ThingName/Avatar

      • SetAvatar

        @ThingworxExtensionApiMethod(since={6,6})
        public void SetAvatar​(byte[] content)
                       throws java.lang.Exception
        Service Category:
        Metadata
        Service Description:
        Set the avatar icon for the entity.
        Specified by:
        SetAvatar in interface IAvatar
        Parameters:
        content - Base 64 Encoded Content - IMAGE
        Throws:
        java.lang.Exception - If an error occurs
      • getConfigurationSetting

        @ThingworxExtensionApiMethod(since={6,6})
        public java.lang.Object getConfigurationSetting​(java.lang.String table,
                                                        java.lang.String property)
      • getStringConfigurationSetting

        @ThingworxExtensionApiMethod(since={6,6})
        public java.lang.String getStringConfigurationSetting​(java.lang.String table,
                                                              java.lang.String property)
      • getStringConfigurationSettingWithDefault

        @ThingworxExtensionApiMethod(since={6,6})
        public java.lang.String getStringConfigurationSettingWithDefault​(java.lang.String table,
                                                                         java.lang.String property,
                                                                         java.lang.String defaultValue)
      • setConfigurationSetting

        @ThingworxExtensionApiMethod(since={6,6})
        public void setConfigurationSetting​(java.lang.String table,
                                            java.lang.String property,
                                            java.lang.Object value)
                                     throws java.lang.Exception
        Throws:
        java.lang.Exception - If an error occurs
      • setStringConfigurationSetting

        @ThingworxExtensionApiMethod(since={6,6})
        public void setStringConfigurationSetting​(java.lang.String table,
                                                  java.lang.String property,
                                                  java.lang.String value)
                                           throws java.lang.Exception
        Throws:
        java.lang.Exception - If an error occurs
      • AddConfigurationTableDefinition

        @ThingworxExtensionApiMethod(since={8,3})
        public void AddConfigurationTableDefinition​(java.lang.String name,
                                                    java.lang.String description,
                                                    java.lang.String category,
                                                    java.lang.Integer ordinal,
                                                    java.lang.Boolean isHidden,
                                                    java.lang.Boolean isMultiRow,
                                                    java.lang.String dataShapeName)
                                             throws java.lang.Exception
        Service Category:
        Configuration
        Service Description:
        Adds a ConfigurationTableDefinition and creates and ConfigurationTable from the definition.
        Parameters:
        name - The name of the configuration table. This name should be used when retrieving values from the configuration table during execution. Configuration tables must have unique names that obey standard ThingWorx entity naming conventions. It is strongly recommended that you always specify a non-empty configuration table name - STRING
        description - A short description of the configuration table and its purpose - STRING
        category - A category that conceptually groups together related configuration tables. - STRING
        ordinal - Controls the order in which the configuration tables should be rendered. Any non-negative integer is permitted, where lower values take higher precedence over larger values. If several tables share the same ordinal, then the order is non-deterministic - INTEGER
        isHidden - Controls whether the configuration table should be hidden by Composer (e.g. if the configuration is for internal purposes only) - BOOLEAN
        isMultiRow - Controls whether the configuration table should accept tabular entry of data or key/value entry. When set to true, the fields in the data shape provided will be interpreted as column descriptors. When set to false or omitted, the fields are interpreted as row descriptors - BOOLEAN
        dataShapeName - This datashape will be used as the data shape for the Configuration table. Any changes to the datashape like adding or deleting fields will reflect on the configuration table. - DATASHAPENAME
        Throws:
        java.lang.Exception - If an error occurs
      • GetConfigurationTableDefinition

        @ThingworxExtensionApiMethod(since={8,3})
        public InfoTable GetConfigurationTableDefinition​(java.lang.String tableName)
                                                  throws java.lang.Exception
        Service Category:
        Configuration
        Service Description:
        Get a specific configuration table definition as an InfoTable.
        Parameters:
        tableName - Configuration table name - STRING
        Returns:
        result Configuration Table Definition - INFOTABLE
        Throws:
        java.lang.Exception - If an error occurs
      • GetConfigurationTables

        @ThingworxExtensionApiMethod(since={6,6})
        public InfoTable GetConfigurationTables()
                                         throws java.lang.Exception
        Service Category:
        Configuration
        Service Description:
        Get a list of configuration tables.
        Returns:
        result Configuration Tables - INFOTABLE - Aspects {dataShape:EntityList}
        Throws:
        java.lang.Exception - If an error occurs

        Additional Information

        This service can be used for single or multi-row configuration tables.

      • GetConfigurationTable

        @ThingworxExtensionApiMethod(since={6,6})
        public InfoTable GetConfigurationTable​(java.lang.String tableName)
                                        throws java.lang.Exception
        Service Category:
        Configuration
        Service Description:
        Get a specific configuration table as an InfoTable.
        Parameters:
        tableName - Configuration table name - STRING
        Returns:
        table table - INFOTABLE
        Throws:
        java.lang.Exception - If an error occurs

        Additional Information

        This service can be used for single or multi-row configuration tables.

      • GetConfigurationTableRow

        @ThingworxExtensionApiMethod(since={6,6})
        public InfoTable GetConfigurationTableRow​(java.lang.String tableName,
                                                  java.lang.String key)
                                           throws java.lang.Exception
        Service Category:
        Configuration
        Service Description:
        Get a specific configuration table row as an InfoTable.
        Parameters:
        tableName - Configuration table name - STRING
        key - Row key value - STRING
        Returns:
        table table - INFOTABLE
        Throws:
        java.lang.Exception - If an error occurs

        Additional Information

        This service can be used to validate existing settings, to update configuration table rows, or to get a current structure and settings.

        This service only works on multi-row configuration tables that also have a primary key assigned. If this service is run against a single row configuration table or a multi-row configuration table that does not have a primary key, it will throw an exception (HTTP NOT FOUND). Infotable rows are identified by a primary key throughout ThingWorx. Therefore, without a primary key, there is no way to get a specific row.

      • IsMultiRowTable

        @ThingworxExtensionApiMethod(since={6,6})
        public java.lang.Boolean IsMultiRowTable​(java.lang.String tableName)
                                          throws java.lang.Exception
        Service Category:
        Configuration
        Service Description:
        Check if a configuration table is a multi-row table.
        Parameters:
        tableName - Configuration table name - STRING
        Returns:
        result Flag if table is multi-row or not - BOOLEAN
        Throws:
        java.lang.Exception - If an error occurs
      • SetConfigurationTable

        @ThingworxExtensionApiMethod(since={6,6})
        public void SetConfigurationTable​(java.lang.String tableName,
                                          InfoTable configurationTable,
                                          java.lang.Boolean persistent)
                                   throws java.lang.Exception
        Service Category:
        Configuration
        Service Description:
        Set an entire configuration table.
        Parameters:
        tableName - Configuration table name - STRING
        configurationTable - Configuration table content - INFOTABLE
        persistent - Persist these changes - BOOLEAN
        Throws:
        java.lang.Exception - If an error occurs
      • SetMultiRowConfigurationTable

        @ThingworxExtensionApiMethod(since={6,6})
        public void SetMultiRowConfigurationTable​(java.lang.String tableName,
                                                  InfoTable configurationTable,
                                                  java.lang.Boolean persistent)
                                           throws java.lang.Exception
        Service Category:
        Configuration
        Service Description:
        Set an entire multi-row configuration table.
        Parameters:
        tableName - Configuration table name - STRING
        configurationTable - Configuration table content - INFOTABLE
        persistent - Persist these changes - BOOLEAN
        Throws:
        java.lang.Exception - If an error occurs
      • SetConfigurationTableRows

        @ThingworxExtensionApiMethod(since={6,6})
        public void SetConfigurationTableRows​(java.lang.String tableName,
                                              InfoTable values,
                                              java.lang.Boolean persistent)
                                       throws java.lang.Exception
        Service Category:
        Configuration
        Service Description:
        Update/add one or more rows in a multi-row configuration table.
        Parameters:
        tableName - Configuration table name - STRING
        values - Configuration table rows to modify - INFOTABLE
        persistent - Persist these changes - BOOLEAN
        Throws:
        java.lang.Exception - If an error occurs
      • DeleteConfigurationTable

        @ThingworxExtensionApiMethod(since={6,6})
        public void DeleteConfigurationTable​(java.lang.String tableName,
                                             java.lang.Boolean persistent)
                                      throws java.lang.Exception
        Service Category:
        Configuration
        Service Description:
        Delete an entire configuration table.
        Parameters:
        tableName - Configuration table name - STRING
        persistent - Persist these changes - BOOLEAN
        Throws:
        java.lang.Exception - If an error occurs
      • DeleteConfigurationTableRows

        @ThingworxExtensionApiMethod(since={6,6})
        public void DeleteConfigurationTableRows​(java.lang.String tableName,
                                                 InfoTable values,
                                                 java.lang.Boolean persistent)
                                          throws java.lang.Exception
        Service Category:
        Configuration
        Service Description:
        Delete one or more rows from a multi-row configuration table.
        Parameters:
        tableName - Configuration table name - STRING
        values - Configuration table rows to modify - INFOTABLE
        persistent - Persist these changes - BOOLEAN
        Throws:
        java.lang.Exception - If an error occurs
      • DeleteAllConfigurationTableRows

        @ThingworxExtensionApiMethod(since={6,6})
        public void DeleteAllConfigurationTableRows​(java.lang.String tableName,
                                                    java.lang.Boolean persistent)
                                             throws java.lang.Exception
        Service Category:
        Configuration
        Service Description:
        Delete all rows from a multi-row configuration table.
        Parameters:
        tableName - Configuration table name - STRING
        persistent - Persist these changes - BOOLEAN
        Throws:
        java.lang.Exception - If an error occurs

        Additional Information

        If the persistent parameter is set to false, some settings may still be visible in the multi-row configuration table in Composer that were actually deleted (in-memory only), unless the entity is restarted (call RestartThing for things and verify that the settings are no longer displayed).

        If the entity is saved (in Composer) while the settings in the multi-row configuration table are still being displayed (after deleting with persistent = false), then the settings will become persisted (in-memory) again (i.e. as if it was never deleted).

      • SaveConfigurationTables

        @ThingworxExtensionApiMethod(since={6,6})
        public void SaveConfigurationTables()
                                     throws java.lang.Exception
        Service Category:
        Configuration
        Service Description:
        Save any changes to configuration tables.
        Throws:
        java.lang.Exception - If an error occurs
      • GetPropertyDefinitions

        @ThingworxExtensionApiMethod(since={6,6})
        public InfoTable GetPropertyDefinitions​(java.lang.String category,
                                                java.lang.String type,
                                                java.lang.String dataShape)
                                         throws java.lang.Exception
        Service Category:
        Metadata
        Service Description:
        Get the current property definitions for this thing.
        Parameters:
        category - Category to filter on - STRING
        type - Type to filter on - BASETYPENAME
        dataShape - Data shape to filter on if InfoTable base type - DATASHAPENAME
        Returns:
        result Property definitions - INFOTABLE - Aspects {dataShape:PropertyDefinition}
        Throws:
        java.lang.Exception - If an error occurs
      • GetPropertyDefinition

        @ThingworxExtensionApiMethod(since={6,6})
        public InfoTable GetPropertyDefinition​(java.lang.String name)
                                        throws java.lang.Exception
        Service Category:
        Metadata
        Service Description:
        Get the current property definitions for this thing.
        Parameters:
        name - Name - STRING
        Returns:
        result Property definition - INFOTABLE - Aspects {dataShape:PropertyDefinition}
        Throws:
        java.lang.Exception - If an error occurs
      • GetEventDefinitions

        @ThingworxExtensionApiMethod(since={6,6})
        public InfoTable GetEventDefinitions​(java.lang.String category,
                                             java.lang.String dataShape)
                                      throws java.lang.Exception
        Service Category:
        Metadata
        Service Description:
        Get the current event definitions for this thing.
        Parameters:
        category - Category to filter on - STRING
        dataShape - Data shape to filter on if InfoTable base type - DATASHAPENAME
        Returns:
        result Event definitions - INFOTABLE - Aspects {dataShape:EventDefinition}
        Throws:
        java.lang.Exception - If an error occurs
      • GetEventDefinition

        @ThingworxExtensionApiMethod(since={6,6})
        public InfoTable GetEventDefinition​(java.lang.String name)
                                     throws java.lang.Exception
        Service Category:
        Metadata
        Service Description:
        Get ann event definitions for this thing.
        Parameters:
        name - Name - STRING
        Returns:
        result Event definition - INFOTABLE - Aspects {dataShape:EventDefinition}
        Throws:
        java.lang.Exception - If an error occurs
      • GetServiceDefinitions

        @ThingworxExtensionApiMethod(since={6,6})
        public InfoTable GetServiceDefinitions​(java.lang.String category,
                                               java.lang.String type,
                                               java.lang.String dataShape)
                                        throws java.lang.Exception
        Service Category:
        Metadata
        Service Description:
        Get the current service definitions for this thing.
        Parameters:
        category - Category to filter on - STRING
        type - Type to filter on - BASETYPENAME
        dataShape - Data shape to filter on if InfoTable base type - DATASHAPENAME
        Returns:
        result Service definitions - INFOTABLE - Aspects {dataShape:ServiceDefinition}
        Throws:
        java.lang.Exception - If an error occurs
      • GetServiceDefinition

        @ThingworxExtensionApiMethod(since={6,6})
        public InfoTable GetServiceDefinition​(java.lang.String name)
                                       throws java.lang.Exception
        Service Category:
        Metadata
        Service Description:
        Get a service definition for this thing.
        Parameters:
        name - Name - STRING
        Returns:
        result Service definition - INFOTABLE - Aspects {dataShape:ServiceDefinition}
        Throws:
        java.lang.Exception - If an error occurs
      • GetMetadata

        @ThingworxExtensionApiMethod(since={6,6})
        public InfoTable GetMetadata()
                              throws java.lang.Exception
        Service Category:
        Metadata
        Service Description:
        Get the metadata in InfoTable format.
        Returns:
        result metadata - INFOTABLE
        Throws:
        java.lang.Exception - If an error occurs
      • GetMetadataAsJSON

        @ThingworxExtensionApiMethod(since={6,6})
        public org.json.JSONObject GetMetadataAsJSON()
                                              throws java.lang.Exception
        Service Category:
        Metadata
        Service Description:
        Get the metadata in JSON format.
        Returns:
        result metadata - JSON
        Throws:
        java.lang.Exception - If an error occurs
      • GetMetadataWithPermissionsAsJSON

        @ThingworxExtensionApiMethod(since={6,6})
        public org.json.JSONObject GetMetadataWithPermissionsAsJSON()
                                                             throws java.lang.Exception
        Service Category:
        Metadata
        Service Description:
        Get the metadata in JSON format.
        Returns:
        result metadata - JSON
        Throws:
        java.lang.Exception - If an error occurs
      • GetInstanceMetadataAsJSON

        @ThingworxExtensionApiMethod(since={6,6})
        public org.json.JSONObject GetInstanceMetadataAsJSON()
                                                      throws java.lang.Exception
        Service Category:
        Metadata
        Service Description:
        Get the instance metadata in JSON format.
        Returns:
        result Instance metadata - JSON
        Throws:
        java.lang.Exception - If an error occurs
      • GetInstanceMetadataWithPermissionsAsJSON

        @ThingworxExtensionApiMethod(since={6,6})
        public org.json.JSONObject GetInstanceMetadataWithPermissionsAsJSON()
                                                                     throws java.lang.Exception
        Service Category:
        Metadata
        Service Description:
        Get the instance metadata in JSON format.
        Returns:
        result Instance metadata - JSON
        Throws:
        java.lang.Exception - If an error occurs
      • GetIncomingDependencies

        @ThingworxExtensionApiMethod(since={6,6})
        public InfoTable GetIncomingDependencies​(java.lang.Double maxItems)
                                          throws java.lang.Exception
        Service Category:
        Dependencies
        Service Description:
        Get the incoming dependencies.
        Parameters:
        maxItems - Maximum number of items to return - NUMBER
        Returns:
        result Related entities - INFOTABLE - Aspects {dataShape:EntityDescriptor}
        Throws:
        java.lang.Exception - If an error occurs
      • GetOutgoingDependencies

        @ThingworxExtensionApiMethod(since={6,6})
        public InfoTable GetOutgoingDependencies​(java.lang.Double maxItems)
                                          throws java.lang.Exception
        Service Category:
        Dependencies
        Service Description:
        Get the outgoing dependencies.
        Parameters:
        maxItems - Maximum number of items to return - NUMBER
        Returns:
        result Related entities - INFOTABLE - Aspects {dataShape:EntityDescriptor}
        Throws:
        java.lang.Exception - If an error occurs
      • GetIncomingDependenciesAsNetwork

        @ThingworxExtensionApiMethod(since={6,6})
        public InfoTable GetIncomingDependenciesAsNetwork​(java.lang.Double maxItems,
                                                          java.lang.Double maxDepth)
                                                   throws java.lang.Exception
        Service Category:
        Dependencies
        Service Description:
        Get the incoming dependencies as a network.
        Parameters:
        maxItems - Maximum number of items to return - NUMBER
        maxDepth - Maximum depth to traverse - NUMBER
        Returns:
        result Related entities - INFOTABLE - Aspects {dataShape:EntityNetwork}
        Throws:
        java.lang.Exception - If an error occurs
      • GetOutgoingDependenciesAsNetwork

        @ThingworxExtensionApiMethod(since={6,6})
        public InfoTable GetOutgoingDependenciesAsNetwork​(java.lang.Double maxItems,
                                                          java.lang.Double maxDepth)
                                                   throws java.lang.Exception
        Service Category:
        Dependencies
        Service Description:
        Get the outgoing dependencies as a network.
        Parameters:
        maxItems - Maximum number of items to return - NUMBER
        maxDepth - Maximum depth to traverse - NUMBER
        Returns:
        result Related entities - INFOTABLE - Aspects {dataShape:EntityNetwork}
        Throws:
        java.lang.Exception - If an error occurs
      • HasIncomingDependencies

        @ThingworxExtensionApiMethod(since={6,6})
        public java.lang.Boolean HasIncomingDependencies()
                                                  throws java.lang.Exception
        Service Category:
        Dependencies
        Service Description:
        Has incoming dependencies.
        Returns:
        result Has dependencies - BOOLEAN
        Throws:
        java.lang.Exception - If an error occurs
      • HasOutgoingDependencies

        @ThingworxExtensionApiMethod(since={6,6})
        public java.lang.Boolean HasOutgoingDependencies()
                                                  throws java.lang.Exception
        Service Category:
        Dependencies
        Service Description:
        Has outgoing dependencies.
        Returns:
        result Has dependencies - BOOLEAN
        Throws:
        java.lang.Exception - If an error occurs
      • GetPermissionsForCurrentUser

        @ThingworxExtensionApiMethod(since={6,6})
        public InfoTable GetPermissionsForCurrentUser​(java.lang.String permissionName,
                                                      java.lang.String name)
                                               throws java.lang.Exception
        Service Category:
        Permissions
        Service Description:
        Get current user permissions.
        Parameters:
        permissionName - Permission name - STRING
        name - Target name (or wildcard) - STRING
        Returns:
        result Permissions - INFOTABLE - Aspects {dataShape:UserPermissions}
        Throws:
        java.lang.Exception - If an error occurs
      • GetPermissionsForUser

        @ThingworxExtensionApiMethod(since={6,6})
        public InfoTable GetPermissionsForUser​(java.lang.String user,
                                               java.lang.String permissionName,
                                               java.lang.String name)
                                        throws java.lang.Exception
        Service Category:
        Permissions
        Service Description:
        Get user permissions.
        Parameters:
        user - User name - STRING
        permissionName - Permission name - STRING
        name - Target name (or wildcard) - STRING
        Returns:
        result Permissions - INFOTABLE - Aspects {dataShape:UserPermissions}
        Throws:
        java.lang.Exception - If an error occurs
      • GetPermissionsForGroup

        @ThingworxExtensionApiMethod(since={6,6})
        public InfoTable GetPermissionsForGroup​(java.lang.String group,
                                                java.lang.String permissionName,
                                                java.lang.String name)
                                         throws java.lang.Exception
        Service Category:
        Permissions
        Service Description:
        Get group permissions.
        Parameters:
        group - Group name - STRING
        permissionName - Permission name - STRING
        name - Target name (or wildcard) - STRING
        Returns:
        result Permissions - INFOTABLE - Aspects {dataShape:UserPermissions}
        Throws:
        java.lang.Exception - If an error occurs
      • dispose

        @ThingworxExtensionApiMethod(since={6,6})
        public void dispose()
                     throws java.lang.Exception


        Removes any remaining references of this entity and disposes any resources that were not cleaned up earlier in the lifecycle. This method is only invoked when the entity is in the process of deletion.

        Throws:
        java.lang.Exception - If an error occurs
      • toJSON

        @Deprecated
        @ThingworxExtensionApiMethod(since={6,6},
                                     deprecatedSince={8,4})
        public org.json.JSONObject toJSON()
                                   throws java.lang.Exception
        Deprecated.
        no replacement


        Returns the state of the entity as JSONObject.
        Returns:
        the entity as JSONObject
        Throws:
        java.lang.Exception - when an error occurs during the construction/population of the JSONObject
      • toJSONDefinition

        @Deprecated
        @ThingworxExtensionApiMethod(since={6,6},
                                     deprecatedSince={8,4})
        public org.json.JSONObject toJSONDefinition()
                                             throws java.lang.Exception
        Deprecated.
        no replacement


        Returns the definition state of the entity as JSONObject.
        Returns:
        the entity as JSONObject
        Throws:
        java.lang.Exception - when an error occurs during the construction/population of the JSONObject
      • SetProjectName

        @ThingworxExtensionApiMethod(since={6,6})
        public void SetProjectName​(java.lang.String projectName)
                            throws java.lang.Exception
        Service Category:
        Projects
        Service Description:
        Set the project name of this entity.


        Sets the name of the project for this entity to be associated with and updates entity's project dependencies by scanning entity's external dependencies. The name of project must be a valid, existing Project. If a projectName is supplied that is not valid, an Exception will be thrown.
        Parameters:
        projectName - - The name of the project to associate this entity to.
        Throws:
        java.lang.Exception - - If the specified Project does not exist or you do not have permissions to view it or if there is a problem updating the database.
      • UpdateProjectDependencies

        @ThingworxExtensionApiMethod(since={9,1})
        public void UpdateProjectDependencies()
                                       throws java.lang.Exception
        Service Category:
        Projects
        Service Description:
        Updates Project's 'dependends-on Projects' by scanning current entity's external dependencies.


        Updates entity's project dependencies by scanning entity's external dependencies
        Throws:
        java.lang.Exception
      • GetProjectName

        @ThingworxExtensionApiMethod(since={6,6})
        public java.lang.String GetProjectName()
                                        throws java.lang.Exception
        Service Category:
        Projects
        Service Description:
        Get the project name of this entity.
        Returns:
        result The project name of this entity - STRING
        Throws:
        java.lang.Exception - If an error occurs