Class RootEntity

All Implemented Interfaces:
IConfigurableObject, INotScriptFriendly, ISupportsDeprecation, IDiffableObject, IAvatar, IEntityLifeCycleEvent, ITaggableObject, IDependencyScannableObject, IEntityDefinition, IPersistableObject<String>, IDesignTimeSecurable, IDesignTimeSecurableEntity, IRunTimeSecurable, IRunTimeSecurableEntity, ISecurable, IVisibilitySecurable, IVisibilitySecurableEntity, IAspectContainer, INamedObject, Serializable
Direct Known Subclasses:
ServiceProviderEntity, Thing

The base class for all persistable entities in Thingworx.

The RootEntity class defines the minimum amount of functionality required for all entities that are available in the Thingworx platform, as well as providing the necessary methods to handle the entity lifecycle. All entities in Thingworx must extend this class or one of its subclasses.

All entities have the following lifecycle, at a minimum (subclasses may introduce new events):

Inactive ? Preinitializing ? Validating ? Initializing ? Cleaning Up ? Disposing

These lifecycle events have the following methods:

 
State Method Description
Preinitialize preInitializeEntity() Occurs only during the import process.
Validate validateConfiguration(ImportedEntityCollection) Occurs only during the entity import process. Validates all requirements of the entity.
Initialize initializeEntity(ContextType) Initializes the entity. Should be used to initialize the state of the entity based on the patch operation.
Cleanup cleanupEntity(ContextType) Deactivates the entity. Should be used to clean up any managed or long-lived artifacts.
Dispose dispose() Removes any remaining references to this entity.

RootEntity is not thread-safe nor is it designed to be mutated by multiple threads simultaneously.

See Also:
  • Field Details

  • Constructor Details

    • RootEntity

      public RootEntity()
  • Method Details

    • ListDeprecatedUsage

      @ThingworxExtensionApiMethod(since={9,5}) public InfoTable ListDeprecatedUsage() throws Exception
      Service Category:
      Aspects
      Service Description:
      Service returns the deprecated references of entity and characteristic, which is used by current entity.
      Returns:
      result Deprecated Usage for the entity - INFOTABLE - Aspects {dataShape:DeprecatedUsage}
      Throws:
      Exception - If an error occurs
    • getDesignTimePermissions

      @ThingworxExtensionApiMethod(since={6,6}) public DesignTimePermissionCollection getDesignTimePermissions()
      Specified by:
      getDesignTimePermissions in interface IDesignTimeSecurable
    • setDesignTimePermissions

      @ThingworxExtensionApiMethod(since={6,6}) public void setDesignTimePermissions(DesignTimePermissionCollection value)
      Specified by:
      setDesignTimePermissions in interface IDesignTimeSecurable
    • getVisibilityPermissions

      @ThingworxExtensionApiMethod(since={6,6}) public VisibilityPermissionCollection getVisibilityPermissions()
      Specified by:
      getVisibilityPermissions in interface IVisibilitySecurable
    • setVisibilityPermissions

      @ThingworxExtensionApiMethod(since={6,6}) public void setVisibilityPermissions(VisibilityPermissionCollection value)
      Specified by:
      setVisibilityPermissions in interface IVisibilitySecurable
    • getRunTimePermissions

      @ThingworxExtensionApiMethod(since={6,6}) public RunTimePermissionCollection getRunTimePermissions()
      Specified by:
      getRunTimePermissions in interface IRunTimeSecurable
    • setRunTimePermissions

      @ThingworxExtensionApiMethod(since={6,6}) public void setRunTimePermissions(RunTimePermissionCollection value)
      Specified by:
      setRunTimePermissions in interface IRunTimeSecurable
    • GetOwner

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

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

      @ThingworxExtensionApiMethod(since={6,6}) public void AddRunTimePermission(String type, String resource, String principal, String principalType, Boolean allow) throws 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:
      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(String type, String resource, String principal, String principalType) throws 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:
      Exception - If an error occurs
    • addRunTimePermission

      @ThingworxExtensionApiMethod(since={6,6}) public void addRunTimePermission(PermissionTypes permissionType, String resourceName, Permission permission) throws Exception
      Specified by:
      addRunTimePermission in interface IRunTimeSecurable
      Throws:
      Exception - If an error occurs
    • deleteRunTimePermission

      @ThingworxExtensionApiMethod(since={6,6}) public void deleteRunTimePermission(PermissionTypes permissionType, String resourceName, Permission permission) throws Exception
      Specified by:
      deleteRunTimePermission in interface IRunTimeSecurable
      Throws:
      Exception - If an error occurs
    • GetRunTimePermissionsAsJSON

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

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

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

      @ThingworxExtensionApiMethod(since={6,6}) public void AddDesignTimePermission(String type, String principal, String principalType, Boolean allow) throws 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:
      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(String type, String principal, String principalType) throws 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:
      Exception - If an error occurs
    • GetDesignTimePermissionsAsJSON

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

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

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

      @ThingworxExtensionApiMethod(since={6,6}) public void AddVisibilityPermission(String principal, String principalType) throws 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:
      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(String principal, String principalType) throws 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:
      Exception - If an error occurs
    • GetVisibilityPermissionsAsJSON

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

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

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

      @ThingworxExtensionApiMethod(since={6,6}) public Boolean CheckPermission(String type, String name) throws 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:
      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 Boolean CheckPermissionForUser(String user, String type, String name) throws 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:
      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 Boolean CheckPermissionForGroup(String group, String type, String name) throws 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:
      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 Boolean CheckDesignTimePermission(String type) throws 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:
      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 Boolean CheckDesignTimePermissionForUser(String user, String type) throws 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:
      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 Boolean CheckDesignTimePermissionForGroup(String group, String type) throws 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:
      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.

    • isVisible

      @ThingworxExtensionApiMethod(since={6,6}) public boolean isVisible()
    • isVisible

      @ThingworxExtensionApiMethod(since={6,6}) public boolean isVisible(SecurityContext securityContext)
    • validateConfiguration

      @ThingworxExtensionApiMethod(since={6,6}) public void validateConfiguration(ImportedEntityCollection importedEntityCollections) throws 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:
      Exception - if the entity is invalid
    • getEntityTypeAsString

      @ThingworxExtensionApiMethod(since={6,6}) public String getEntityTypeAsString()
    • getEntityType



      Returns the type of this entity.

      Returns:
      the entity type
    • setLastModifiedDate

      @ThingworxExtensionApiMethod(since={6,6}) public void setLastModifiedDate(org.joda.time.DateTime value)
    • 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
    • isEditable

      @ThingworxExtensionApiMethod(since={6,6}) public boolean isEditable()
    • isSystemObject

      @ThingworxExtensionApiMethod(since={6,6}) public boolean isSystemObject()
    • isEditableSystemObject

      @ThingworxExtensionApiMethod(since={6,6}) public boolean isEditableSystemObject()
    • isEditableExtensionObject

      @ThingworxExtensionApiMethod(since={6,6}) public boolean isEditableExtensionObject()
    • isThemeObject

      @ThingworxExtensionApiMethod(since={6,6}) public boolean isThemeObject()
    • isExtensionObject

      @ThingworxExtensionApiMethod(since={6,6}) public boolean isExtensionObject()
    • setExtensionObject

      @ThingworxExtensionApiMethod(since={6,6}) public void setExtensionObject(boolean value)
    • getAspects



      Returns:
      The entity aspect collection.
    • preInitializeEntity

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


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

      @ThingworxExtensionApiMethod(since={9,0}, canOverride=true) public void initializeEntity(ContextType contextType) throws 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:
      Exception - if an error occurs during the initialization process
    • cleanupEntity

      @ThingworxExtensionApiMethod(since={9,0}, canOverride=true) public void cleanupEntity(ContextType contextType) throws 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:
      Exception - if an error occurs during the cleanup process
    • addDesignTimePermission

      @ThingworxExtensionApiMethod(since={6,6}) public void addDesignTimePermission(PermissionTypes permissionType, Permission permission) throws Exception
      Specified by:
      addDesignTimePermission in interface IDesignTimeSecurable
      Throws:
      Exception - If an error occurs
    • deleteDesignTimePermission

      @ThingworxExtensionApiMethod(since={6,6}) public void deleteDesignTimePermission(PermissionTypes permissionType, Permission permission) throws Exception
      Specified by:
      deleteDesignTimePermission in interface IDesignTimeSecurable
      Throws:
      Exception - If an error occurs
    • persistRunTimePermissions

      @ThingworxExtensionApiMethod(since={6,6}) public void persistRunTimePermissions() throws Exception
      Specified by:
      persistRunTimePermissions in interface IRunTimeSecurable
      Throws:
      Exception - If an error occurs
    • persistDesignTimePermissions

      @ThingworxExtensionApiMethod(since={6,6}) public void persistDesignTimePermissions() throws Exception
      Specified by:
      persistDesignTimePermissions in interface IDesignTimeSecurable
      Throws:
      Exception - If an error occurs
    • persistVisibilityPermissions

      @ThingworxExtensionApiMethod(since={6,6}) public void persistVisibilityPermissions() throws Exception
      Specified by:
      persistVisibilityPermissions in interface IVisibilitySecurable
      Throws:
      Exception - If an error occurs
    • addVisibilityPermission

      @ThingworxExtensionApiMethod(since={6,6}) public void addVisibilityPermission(PermissionTypes permissionType, Permission permission) throws Exception
      Specified by:
      addVisibilityPermission in interface IVisibilitySecurable
      Throws:
      Exception - If an error occurs
    • deleteVisibilityPermission

      @ThingworxExtensionApiMethod(since={6,6}) public void deleteVisibilityPermission(PermissionTypes permissionType, Permission permission) throws Exception
      Specified by:
      deleteVisibilityPermission in interface IVisibilitySecurable
      Throws:
      Exception - If an error occurs
    • GetConfigurationChangeHistory

      @ThingworxExtensionApiMethod(since={6,6}) public InfoTable GetConfigurationChangeHistory() throws Exception
      Service Category:
      Editing
      Service Description:
      Get the configuration change history.
      Returns:
      result Configuration changes - INFOTABLE - Aspects {dataShape:ConfigurationChange}
      Throws:
      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.

    • isOwner

      @ThingworxExtensionApiMethod(since={6,6}) public boolean isOwner(EntityReference principal)
      Specified by:
      isOwner in interface ISecurable
    • setOwner

      @ThingworxExtensionApiMethod(since={6,6}) public void setOwner(EntityReference principal)
    • getOwner

      Specified by:
      getOwner in interface ISecurable
    • getTags

      Specified by:
      getTags in interface ITaggableObject
    • getDocumentationContent

      @ThingworxExtensionApiMethod(since={6,6}) public String getDocumentationContent()
    • setDocumentationContent

      @ThingworxExtensionApiMethod(since={6,6}) public void setDocumentationContent(String value)
    • GetSummaryInformation

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

      @ThingworxExtensionApiMethod(since={6,6}) public 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(String description) throws Exception
      Service Category:
      Metadata
      Service Description:
      Overwrite/set the description for an entity.
      Parameters:
      description - Description for an entity - STRING
      Throws:
      Exception - If an error occurs
    • GetTags

      Service Category:
      Metadata
      Service Description:
      Get the tags for an entity.
      Returns:
      tags tags - TAGS - Aspects {tagType:ModelTags}
    • SetTags

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

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

      @ThingworxExtensionApiMethod(since={6,6}) public void AddTags(TagCollection tags) throws Exception
      Service Category:
      Metadata
      Service Description:
      Append additional tags to an entity.
      Parameters:
      tags - Tags for an entity - TAGS
      Throws:
      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 Exception
      Service Category:
      Metadata
      Service Description:
      Remove tags from an entity.
      Parameters:
      tags - Tags to remove from the entity - TAGS
      Throws:
      Exception - If an error occurs
    • GetHomeMashup

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

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

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

      @ThingworxExtensionApiMethod(since={6,6}) public 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 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:
      Exception - If an error occurs
    • getAvatarContent

      @ThingworxExtensionApiMethod(since={6,6}) public byte[] getAvatarContent() throws Exception
      Specified by:
      getAvatarContent in interface IAvatar
      Throws:
      Exception - If an error occurs
    • getConfigurationTable

      @ThingworxExtensionApiMethod(since={6,6}) public ConfigurationTable getConfigurationTable(String table) throws Exception
      Throws:
      Exception - If an error occurs
    • getConfigurationSetting

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

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

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

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

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

      @ThingworxExtensionApiMethod(since={8,3}, deprecatedSince={9,4}) @Deprecated public void AddConfigurationTableDefinition(String name, String description, String category, Integer ordinal, Boolean isHidden, Boolean isMultiRow, String dataShapeName) throws Exception
      Deprecated.
      Throws:
      Exception - If an error occurs
    • AddConfigurationTableDefinition

      @ThingworxExtensionApiMethod(since={9,4}) public void AddConfigurationTableDefinition(String name, String description, String category, Integer ordinal, Boolean isHidden, Boolean isMultiRow, String dataShapeName, org.json.JSONObject accessModifier) throws 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
      accessModifier - AccessModifier for configuration table - JSON
      Throws:
      Exception - If an error occurs
    • GetConfigurationTableDefinition

      @ThingworxExtensionApiMethod(since={8,3}) public InfoTable GetConfigurationTableDefinition(String tableName) throws 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:
      Exception - If an error occurs
    • GetConfigurationTables

      @ThingworxExtensionApiMethod(since={6,6}) public InfoTable GetConfigurationTables() throws Exception
      Service Category:
      Configuration
      Service Description:
      Get a list of configuration tables.
      Returns:
      result Configuration Tables - INFOTABLE - Aspects {dataShape:EntityList}
      Throws:
      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(String tableName) throws 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:
      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(String tableName, String key) throws 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:
      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 Boolean IsMultiRowTable(String tableName) throws 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:
      Exception - If an error occurs
    • SetConfigurationTable

      @ThingworxExtensionApiMethod(since={6,6}) public void SetConfigurationTable(String tableName, InfoTable configurationTable, Boolean persistent) throws 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:
      Exception - If an error occurs
    • SetMultiRowConfigurationTable

      @ThingworxExtensionApiMethod(since={6,6}) public void SetMultiRowConfigurationTable(String tableName, InfoTable configurationTable, Boolean persistent) throws 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:
      Exception - If an error occurs
    • SetConfigurationTableRows

      @ThingworxExtensionApiMethod(since={6,6}) public void SetConfigurationTableRows(String tableName, InfoTable values, Boolean persistent) throws 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:
      Exception - If an error occurs
    • DeleteConfigurationTable

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

      @Deprecated @ThingworxExtensionApiMethod(since={6,6}, deprecatedSince={9,6}) public void DeleteConfigurationTableRows(String tableName, InfoTable values, Boolean persistent) throws Exception
      Deprecated.
      Throws:
      Exception - If an error occurs
    • DeleteConfigurationTableRows

      @ThingworxExtensionApiMethod(since={9,6}) public void DeleteConfigurationTableRows(String tableName, InfoTable values, Boolean persistent, Boolean removeAllMatchingRows) throws 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
      removeAllMatchingRows - It will remove all matching rows if value is true - BOOLEAN
      Throws:
      Exception - If an error occurs
    • DeleteAllConfigurationTableRows

      @ThingworxExtensionApiMethod(since={6,6}) public void DeleteAllConfigurationTableRows(String tableName, Boolean persistent) throws 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:
      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 Exception
      Service Category:
      Configuration
      Service Description:
      Save any changes to configuration tables.
      Throws:
      Exception - If an error occurs
    • GetPropertyDefinitions

      @ThingworxExtensionApiMethod(since={6,6}) public InfoTable GetPropertyDefinitions(String category, String type, String dataShape) throws 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:
      Exception - If an error occurs
    • GetPropertyDefinition

      @ThingworxExtensionApiMethod(since={6,6}) public InfoTable GetPropertyDefinition(String name) throws 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:
      Exception - If an error occurs
    • GetEventDefinitions

      @ThingworxExtensionApiMethod(since={6,6}) public InfoTable GetEventDefinitions(String category, String dataShape) throws 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:
      Exception - If an error occurs
    • GetEventDefinition

      @ThingworxExtensionApiMethod(since={6,6}) public InfoTable GetEventDefinition(String name) throws 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:
      Exception - If an error occurs
    • GetServiceDefinitions

      @ThingworxExtensionApiMethod(since={6,6}) public InfoTable GetServiceDefinitions(String category, String type, String dataShape) throws 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:
      Exception - If an error occurs
    • GetServiceDefinition

      @ThingworxExtensionApiMethod(since={6,6}) public InfoTable GetServiceDefinition(String name) throws 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:
      Exception - If an error occurs
    • GetMetadata

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

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

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

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

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

      @ThingworxExtensionApiMethod(since={6,6}) public InfoTable GetIncomingDependencies(Double maxItems) throws 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:
      Exception - If an error occurs
    • GetOutgoingDependencies

      @ThingworxExtensionApiMethod(since={6,6}) public InfoTable GetOutgoingDependencies(Double maxItems) throws 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:
      Exception - If an error occurs
    • GetIncomingDependenciesAsNetwork

      @ThingworxExtensionApiMethod(since={6,6}) public InfoTable GetIncomingDependenciesAsNetwork(Double maxItems, Double maxDepth) throws 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:
      Exception - If an error occurs
    • GetOutgoingDependenciesAsNetwork

      @ThingworxExtensionApiMethod(since={6,6}) public InfoTable GetOutgoingDependenciesAsNetwork(Double maxItems, Double maxDepth) throws 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:
      Exception - If an error occurs
    • HasIncomingDependencies

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

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

      @ThingworxExtensionApiMethod(since={6,6}) public InfoTable GetPermissionsForCurrentUser(String permissionName, String name) throws 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:
      Exception - If an error occurs
    • GetPermissionsForUser

      @ThingworxExtensionApiMethod(since={6,6}) public InfoTable GetPermissionsForUser(String user, String permissionName, String name) throws 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:
      Exception - If an error occurs
    • GetPermissionsForGroup

      @ThingworxExtensionApiMethod(since={6,6}) public InfoTable GetPermissionsForGroup(String group, String permissionName, String name) throws 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:
      Exception - If an error occurs
    • dispose

      @ThingworxExtensionApiMethod(since={6,6}) public void dispose() throws 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:
      Exception - If an error occurs
    • toJSON

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


      Returns the state of the entity as JSONObject.
      Returns:
      the entity as JSONObject
      Throws:
      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 Exception
      Deprecated.
      no replacement


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

      @ThingworxExtensionApiMethod(since={6,6}) public void SetProjectName(String projectName) throws 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 project name is supplied that is not valid, an Exception will be thrown. For an editable extension entity a valid project can be the one that exists in same extension or any non extension project type entity that exists on platform. The only restriction(Invalid) project is the project belonging to different extension and projects that don't exist on platform.
      Parameters:
      projectName - - The name of the project to associate this entity to.
      Throws:
      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 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:
      Exception
    • GetProjectName

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