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

Community Tip - When posting, your subject should be specific and summarize your question. Here are some additional tips on asking a great question. X

Data Model Implementation Guide Part 2

No ratings

Data Model Implementation Guide Part 2

 

Step 4: SystemConnector Thing Template

 

After grouping our second set of common functionality and information, we came up with the list below for the second Thing Template to create, SystemConnector with 3 Properties. The breakdown for the SystemConnector Thing Template is as follows:

IoTProductMgmt_0-1659126751158.png

 

Follow the below instruction to create this Entity and get the implementation phase of your development cycle going.

 

System Connector Properties

 

Let's jump right in.

  1. In the ThingWorx Composer, click the + New at the top of the screen.
      Step 4 System Connector Properties Step 1.png

2. Select Thing Template in the dropdown.

Step 4 System Connector Properties Step 2.png

3. In the name field, enter SystemConnector and select a Project (ie, PTCDefaultProject).

4. For the Base Thing Template field, select GenericThing.

5. Click Save.

Step 4 System Connector Properties Step 5.png

6. Switch to the Properties and Alerts tab.

7. Click the plus button to add a new Property.

 

The Properties for the SystemConnector Thing Template are as follows:

Name

Base Type

Aspects

Data Change Type

EndPointConfig

String

Persistent and Logged

VALUE

OperatorCredentials

PASSWORD

Persistent

VALUE

ProdManagerCredentials

PASSWORD

Persistent

VALUE

Follow the next steps for all the Properties shown in our template property table.

  1. Click Add.
  2. Enter the name of the property (ie, EndPointConfig).
  3. Select the Base Type of the proprty from the dropdown.
  4. Check the checkboxes for the property Aspects.
  5. Select the Data Change Type from the dropdown.
    Step 4 Table Step 5.png

     

  6. Click Done when finished creating the property.

Your Properties should match the below configurations.

      Step 4 Last Image.png

 

 

Step 5: HazardousAsset Thing Template

 

 

After another round of prioritizing and grouping common functionality and information, we came up with the third Thing Template to create, HazardousAsset. It is a child of the LineAsset Thing Template with one added Service. The breakdown for the HazardousAsset Thing Template is as follows:

IoTProductMgmt_6-1659126751173.png

 

Hazardous Asset Service

 

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

Step 5 Step 1.png

2. Select Thing Template in the dropdown.

Step 5 Step 2.png

3. For the Base Thing Template field, select LineAsset and select a Project (PTCDefaultProject).

4. In the name field, enter HazardousAsset.

Step 5 Step 4.png

5.  Click Save then edit to store all changes now.

6.  Switch to the Services tab.

7.  Click Add.

8.  Enter EmergencyShutdown as the name of the service.

Step 5 Step 8.png

9. Switch to the Me/Entities tab.

10. Expand Properties.

11. Click the arrow next to the State property.

12. Modify the generated code to match the following:

 

 

 

me.State = "Danger!! Emergency Shutdown";

 

 

 

Your first Service is complete!

13. Click Done.

14. Click Save to save your changes.

Your Service should match the below configurations.

IoTProductMgmt_11-1659126751196.png

 

 

Step 6: InventoryManager Thing Shape

 

This time around, we will create our first ThingShape, InventoryManager with 1 Property. The breakdown for the InventoryManager Thing Shape is as follows:

IoTProductMgmt_12-1659126751196.png

 

Follow the below instruction to create this Entity and get the implementation phase of your development cycle going.

System Connector Properties

The properties for the InventoryManager Thing Shape are as follows:

Name

Base Type

Aspects

Data Change Type

ProductCount

INTEGER Min Value:0

Persistent and Logged

ALWAYS

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

    Step 6 System Connector Properties Step 1.png

  2. Select Thing Shape in the dropdown.

    Step 6 System Connector Properties Step 2.png

  3. In the name field, enter InventoryManager and select a Project (ie, PTCDefaultProject).

      4. Click Save then Edit to store all changes now.IoTProductMgmt_15-1659126751204.png

 

      5. Switch to the Properties tab. 

      6. Click Add.

      7. Enter ProductCount as the name of the property.

      8. Select the Base Type of the proprty from the dropdown (ie, INTEGER).

      9. Check the checkboxes for the property Aspects.

     10. Select the Data Change Type from the dropdown.

     Step 6 System Connector Properties Step 10.png
     11. Click Done when finished creating the property.

Your Properties should match the below configurations.

IoTProductMgmt_17-1659126751210.png

 

Add Thing Shape to Template

 

We can see that there is some overlap in the components of our HazardousAsset and LineAsset ThingTemplates. In particular, both want information about the product count. Because HazardousAsset inherits from LineAsset, would only need to change LineAsset. Follow the steps below to perform this change:

  1. Open the LineAsset Thing Template.
  2. In the Implemented Shapes field, enter and select InventoryManager.
  3. Save changes.

     Step 6 Last Image.png

 

Click here to view Part 3 of this guide. 

 

Version history
Last update:
‎Aug 09, 2022 03:30 PM
Updated by:
Contributors