Managing Contexts
A context is a grouping of Assets (or equipment types that derive from Assets) in an equipment structure. ThingWorx Apps provides the ability to implement multiple contexts, each with its own equipment structure. Each context can have its own set of equipment relationships and permissions. Certain areas in ThingWorx Apps are context aware, meaning that only equipment in the currently selected context displays: Asset Advisor, Production KPIs, Alert Monitoring, and the Equipment tab in Configuration and Setup. The equipment that is created and configured from the Equipment tab, as well as its equipment structure, is managed by context.
In ThingWorx Apps, users with permissions on a context can access that context, while users with permissions on multiple contexts can switch between contexts. Within a context, users can access the equipment for which they have appropriate permissions. For more information, see Managing Permissions for Contexts and Equipment.
Contexts are defined within ThingWorx Composer, on the EquipmentContextSettings configuration table of the launch point configuration Thing (PTC.Factory.C_LaunchPointConfigurationThing_[ReleaseVersion]). By default, this table includes the default context (DefaultContext) provided with ThingWorx Apps. In the ThingWorx Apps user interface, the default context name is displayed as Factory View.
EquipmentContextSettings configuration table on the launch point configuration Thing.
* 
Only Assets, or equipment types that derive from Assets, can be included in more than one context. All other equipment types can belong only to a single context. For more information, see Defining Equipment Types.
The following information is defined for each context on the EquipmentContextSettings configuration table:
ContextName—(Required) The name for the context. Must be unique within the EquipmentContextSettings configuration table. If no value is specified for the LocalizationToken property, then this value displays for the context in ThingWorx Apps.
Network—(Required) The name of the network entity used for this context. Must be unique within the EquipmentContextSettings configuration table. The equipment and equipment structure created for the context reside in the network. Once a context has been populated, if the network associated with the context is changed to another network, the equipment residing in the original network is no longer available in ThingWorx Apps. If the new network contains any existing equipment or equipment structure that does not conform to the equipment relationships defined in the EquipmentRelationshipSettings for the context, then context-aware areas of ThingWorx Apps do not behave as expected. The network must exist before the context can be created.
Description—An optional description for the context. The description displays in the Select Context window in the ThingWorx Apps user interface.
LocalizationToken—The localization token that is displayed as the name for this context in ThingWorx Apps. If no LocalizationToken is specified, the ContextName value displays as the context name instead. By default, the localization token defined for the default context is PTC.SCA.SCO.Context.DefaultContextName, which displays as Factory View in the ThingWorx Apps user interface. For more information, see Localization Tables in the ThingWorx Help Center.
EquipmentRelationshipSettings—(Required) The equipment relationship definition data table defining the valid relationships for this context. Each context can use a different equipment relationship definition data table, or multiple contexts can use the same equipment relationship definition data table. By default, the equipment relationship definition data table for the default context is PTC.SCA.SCO.DefaultEquipmentRelationshipDefinition. If the EquipmentRelationshipSettings value for the context is changed, and any existing equipment or equipment structure no longer conforms to the valid relationships for the context, then context-aware areas of ThingWorx Apps do not behave as expected.
Enabled—When this checkbox is selected (the default), the context is available within ThingWorx Apps. If this checkbox is cleared, the context is disabled, and does not appear in the context-aware areas of ThingWorx Apps.
Was this helpful?