cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - If community subscription notifications are filling up your inbox you can set up a daily digest and get all your notifications in a single email. X

Deploy an Application

100% helpful (1/1)

 

 

Guide Concept

 

This project will introduce how to get your application ready for usage by actual users or ready to collect data.

 

Following the steps in this guide, you will be ready to present your finished application to users so they can benefit from its functionality. Deploying your application provides the ability for users to access it from anywhere, anytime and enables your edge devices to communicate with your application 24/7.

 

We will teach you how to deploy your ThingWorx IoT application to be ready for whatever experience you've molded it to be.

 

 

You'll learn how to

 

  • Create login screens, users and user groups
  • Define security permissions
  • Deploy application
  • Identify and troubleshoot issues

 

NOTE: This guide's content aligns with ThingWorx 9.3. The estimated time to complete this guide is 30 minutes

 

 

Step 1: Completed Example

 

Download the CompletedApplication.xml attached to this guide.  Within the downloaded file, you will find Entities referenced in this lesson, including a finished application that will be used for the deployment exercise. Import and utilize this file to see a finished example and return to it as a reference if you become stuck during this guide and need some extra help or clarification.

 

Keep in mind, this download uses the exact names for entities used in this tutorial. If you would like to import this example and also create entities on your own, change the names of the entities you create.

 

 

 

Step 2: Define Organization

 

In order to control access to your application, you first need to create an Organization. Think of the organization entity as your company or department. Once you define the organization, you will create Users and User Groups.

 

Organizations are hierarchical structures that allow you to assign visibility to entities in the ThingWorx Model. You can add users and group to each level within this structure.

 

Organizational Structure

 

This is the organization defined within the sample application download for this guide.

 Entity Name                Entity Type      Description
ConstructorsOrganizationHigh level of an organization.
UpperManagementUser GroupExecutives in the organization.
HRUser GroupHR department in the organization.
ManagementUser GroupFirst and second tier management in the company.
LaborersUser GroupSkilled trade workers in the organization.
ConstructorsGroupUser GroupSecurity group for all employees in the company.
j.generalUserHR Department Employee
a.jonesUserSkilled Laborer
j.lewisUserManager
i.jordenUserCEO
default_userUserUser used in trial version for all company roles.

 

  

Create Organization

 

Follow the steps below to create an Organization and make it login ready. Once your Organization is saved, you are provided with a login screen. Customize the login page to your liking with the General Information tab of the Organization after creating it.

 

  1. In the ThingWorx Composer, click the + New at the top of the screen.
     

     

    select_new.png

  2. Select Organization in the dropdown.
     

     

    create_new_organization.png

  3. Name your Organization Constructors.
  4. Set the Project field (ie, PTCDefaultProject) and click Save
     

     

    create_organization.png

  5. Click Edit and select the Organization tab to see the hierarchy.
  6. With the top organization selected, in the Members search bar, search for the user you have created yourself and add them. Keep track of the user you added, they will be needed to log into the application later in this guide.     
     

     

    update_organization.png

 

View Organization

 

From the Home page of Composer, filter for and select the Constructors Organization. The General Information tab shows the configurations for the login screen and resetting passwords. For more information on password resets, see the Password Reset Help Page.

  • The Login Image is where you would put your logo or an image you would want users to see when they are logging into your application.
  • The Home Mashup is the page you would like users to go to after they have passed the login prompt.
  • The Login Style and Login Button Style are Style Definition properties.

    NOTE: If you keep these fields blank, the default configurations will be applied. You can create your own Style Definitions by following steps in our Styles and States Guide.

 

Create Organizational Units

 

Let's create the structors for our Organization. With the Constructors Organization open, follow the directions below:

 

  1. Click the green + button under the structure you would like to expand.
  2. Name your Organization unit UpperManagement
  3. In the Members search bar, search for the user or user group you created and add it.
     

     

    add_organization.png

  4. Click Save.

Repeat the steps to create the full hierarchy of the organization and its members.

 

 

Setup Entity Visibility

 

Visibility is a simple form of access control. If an entity is visible to members of an organizational unit, then its members have access to the entity.

 

  1. Select the Permissions tab of any Thing you created in Composer.
     

     

    perm_visible.png

  2. Filter and select Constructors in the Search Organizations field.
  3. Click Save.
     

    set_visible.png

 

 

 

Step 3: Security and Permissions

 

By Default, new Users have no permission configurations. Permissions can be defined for any Entity created on the ThingWorx platform. All Entities have permission control for both design time and run time.

 

Design time is the period in which changes can be made to the Entity in Composer. Run time is the period in which the application is running and calls are made.

 

Permissions should be set for each and every Entity within the application in order to keep it secure and maintain access to services.

 

  1. Select the Permissions tab of any Thing you created in Composer (ie, ConstructorsBlog).

    perm_visible.png

     

  2. Select the Design Time or Run Time tab.

    permissions.png

     

  3. After selecting one, filter and select a User or UserGroup to set their permissions.
  4. Set the Allow, Deny or Inheritence markers to set permissions respectively.

    set_permissions.png

     

The Inherit category allows a user to inherit permissions from the user group it belongs to.

 

 

 

Step 4: Deploy Application

 

ThingWorx Composer is set up to allow deployment in very simple steps. An application can run locally on a computer or remotely on a server as long as an Apache Tomcat server is installed on the same machine. Simply copy the URL that is generated when you click View Mashup within Composer. That is the URL to share with users so they can access your application.

 
general_dash.png

 

If you plan to use a Login Screen, use the View Mashup URL generated from the Login Mashup you create. To view the login page of your application, type the following URL: [server]/Thingworx/FormLogin/ (ie, localhost/Thingworx/FormLogin/Constructors).

 

The login page for the sample application can be found at: [server]/Thingworx/FormLogin/Constructors.

 
login_screen.png

 

To log in using this screen, type in the username and password of a user that is in the organization.

 

To use one of the example Users, set their password in the Composer and test it within the login prompt. Based on the permissions you set, users will have a different view of the application when they log in.

 

executive_dash.png

 

hr_dash.png

 

 

Step 5: Logging and Troubleshooting

 

There are two mechanisms that enable you a view into your application and what is happening behind-the-scenes, through the ThingWorx Composer Monitoring and the ThingWorx filesystem.

 

ThingWorx Composer Monitoring

 

ThingWorx provides pages to see all logs and communications between your ThingWorx instance, your applications, and edge devices using the Monitoring drop-down in the top navigation toolbar of your Composer. To see this page click Monitoring on the left menu, then select the option you would like to see.

 
select_monitoring.png

 

 Resource                  Usage
Application LogThis page will show you the log for your application and information on the processing running.
Communication LogThis page is used to show communication between your ThingWorx instance and outside sources.
Configuration LogThis page provides information into what is happening behind the scenes for your ThingWorx Composer and how it has been configured.
Security LogThis page highlights any information around access to the application, composer, or any security updates
Script LogLogging information you have set for scripts running in your ThingWorx instance.
Error LogDetails for errors within your ThingWorx instance.
Remote ThingsThis page provides the list of Entities that are able to connect to edge devices, connected to your application, and even Entities that are currently disconnected.

 

ThingWorx File System

 

Log files for ThingWorx and your application can be found in the [Root]\ThingworxStorage\logs directory. The ROOT DIRECTORY is the folder in which ThingWorx has been running (ie, C:\ThingworxStorage\logs for Windows or /ThingworxStorage/logs for Mac or Linux).

 

Each log file corresponds to some of the content you can see in the Monitoring dropdown in the ThingWorx Composer.

 

 

 

Step 6: Next Steps

 

Congratulations you have completed the Deploy an Application How-To, and learned how to:

 

  • Create login screens, users and user groups
  • Define security permissions
  • Deploy application
  • Identify and troubleshoot issues

 

The next guide in the Customize UI and Display Options to Deploy Applications learning path is How to Display Data in Charts

 

Additional Resources

 

We recommend the following resources to continue your learning experience:

 

 Capability    Guide
BuildImplement Services, Events, and Subscriptions
SecureConfigure Permissions

 

 

If you have questions, issues, or need additional information, refer to:

 

 Resource       Link
CommunityDeveloper Community Forum
SupportHelp Center

 

Version history
Last update:
‎Nov 29, 2022 02:37 PM
Updated by:
Attachments
Contributors