Design Your Data Model Guide Part 2
Step 4: Data Sources – Component Breakout
Component Breakout
![IoTProductMgmt_0-1659123761194.png IoTProductMgmt_0-1659123761194.png](https://community.ptc.com/t5/image/serverpage/image-id/61230i12CB5FE5597BDA13/image-size/large?v=v2&px=999)
Once you have a full list of Things in your system (as well as requirements for each user), the next step is to identify the information needed from each Thing (based on the user's requirements).
This involves evaluating the available data and functionality for each Thing. You then align the data and functionality with the user's requirements to determine exactly what you need, while eliminating that which you do not. This is important, as there can be cost and security benefits to only collecting data you need, and leaving what you don't.
NOTE: Remember from the Data Model Introduction that a Thing's Components include Properties, Services, Events, and Subscriptions.
Factory Example
Using the Smart Factory example, let’s go through the different Things and break down each Thing's components that are needed for each of our users.
Conveyor Belts
The conveyor belt is simple in operation but could potentially have a lot of available data.
- Maintenance Engineer - needs to know granular data for the belt and if it has any alerts
- emergency shutdown (service)
- machine state (on/off) (property)
- serial number (property)
- last maintenance date (property)
- next scheduled maintenance date(property)
- power consumption (property)
- belt speed (property)
- belt motor temp (property)
- belt motor rpm (property)
- error notification (event)
- auto-generated maintenance requests (subscription)
- Operator - needs to know if the belt is working as intended
- belt speed (property)
- alert status (event)
- Production Manager - wants access to the data the Operator can see but otherwise has no new requirements
Robotic Arm
The robotic arm has 3 axes of rotation as well as a clamp hand.
- Maintenance Engineer - needs to know granular data for the arm and if it has any alerts
- time since last pickup (property): how long it has been since the last part was picked up by this hand?
- product count (property): how many products the hand has completed
- emergency shutdown (service)
- machine state (on/off) (property)
- serial number (property)
- last maintenance date (property)
- next scheduled maintenance date (property)
- power consumption (property)
- arm rotation axis 1 (property)
- arm rotation axis 2 (property)
- arm rotation axis 3 (property)
- clamp pressure (property)
- clamp status (open/closed) (property)
- error notification (event) 15.auto-generated maintenance requests (subscription)
- Operator - needs to know if the robotic arm is working as intended
- clamp status (open/closed) (property)
- error notification (event)
- product count (property): How many products has the hand completed?
- Production Manager - wants access to the data the Operator can see but otherwise has no new requirements
Pneumatic Gate
The pneumatic gate has two states, open and closed.
- Maintenance Engineer - needs to know granular data for the gate and if it has any alerts
- emergency shutdown (service)
- machine state (on/off) (property)
- serial number (property)
- last maintenance date (property)
- next scheduled maintenance date (property)
- power consumption (property)
- gate status (open/closed) (property)
- error notification (event)
- auto-generated maintenance requests (subscription)
- Operator - needs to know if the pneumatic gate is working as intended.
- gate status (open/closed) (property)
- error notification (event)
- The Production Manager wants access to the data the Operator can see but otherwise has no new requirements
Quality Control Camera
The QC camera uses visual checks to make sure a product has been constructed properly.
- Maintenance Engineer - needs to know granular data for the camera and if it has any alerts
- machine state (property): on/off
- serial number (property)
- last maintenance date (property)
- next scheduled maintenance date (property)
- power consumption (property)
- current product quality reading (property)
- images being read (property)
- settings for production quality assessment (property)
- error notification (event)
- auto-generated maintenance requests (subscription)
- product count (property): how many products the camera has seen
- Operator - needs to keep track of the quality check results and if there are any problems with the camera setup
- settings for production quality assessment (property)
- error notification (event)
- bad quality flag (event)
- product count (property): how many products the camera has seen
- Production Manager - wants access to the data the Operator can see but otherwise has no new requirements
Maintenance Request System Connector
Determining the data needed from the Maintenance Request System is more complex than from the physical components, as it will be much more actively used by all of our users.
It is important to note that the required functionality already exists in our system as is, but it needs bridges created to connect it to a centralized system.
- Maintenance Engineer - needs to receive and update maintenance requests
- maintenance engineer credentials (property): authentication with the maintenance system
- endpoint configuration for connecting to the system (property)
- get unfiltered list of maintenance requests (service)
- update description of maintenance request (service)
- close maintenance request (service)
- Operator - needs to create and track maintenance requests
- operator credentials (property): authentication with the maintenance system
- endpoint configuration for connecting to the system (property)
- create maintenance request (service)
- get filtered list of maintenance requests for this operator (service)
- Production Manager - needs to monitor the entire system - both the creation and tracking of maintenance requests; needs to prioritize maintenance requests to keep operations flowing smoothly
- production manager credentials (property): authentication with the maintenance system
- endpoint configuration for connecting to the system (property)
- create maintenance request (service)
- get unfiltered list of maintenance requests (service)
- update priority of maintenance request (service)
Production Order System Connector
Working with the Production Order System is also more complex than the physical components of the lines, as it will be more actively used by two of the three users.
It is important to note that the required functionality already exists in our existing production order system as is, but it needs bridges created to connect to a centralized system.
- Maintenance Engineer - will not need to know anything about production orders, as it is outside the scope of their job needs
- Operator - needs to know which production orders have been set up for the line, and needs to mark orders as started or completed
- operator credentials (property): authentication with the production order system
- endpoint configuration for connecting to the system (property)
- mark themselves as working a specific production line (service)
- get a list of filtered production orders for their line (service)
- update production orders as started/completed (service)
- Production Manager - needs to view the status of all production orders and who is working on which line
- production manager credentials (property): authentication with the production order system
- endpoint configuration for connecting to the system (property)
- get a list of production lines with who is working them (service)
- get the list of production orders with filtering options (service)
- create new production orders (service)
- update existing production orders for quantity, and priority (service)
- assign a production order to a production line (service)
- delete production orders (service)
Step 5: Data Sources – Thing-Component Matrix
![IoTProductMgmt_1-1659123761197.png IoTProductMgmt_1-1659123761197.png](https://community.ptc.com/t5/image/serverpage/image-id/61229iE205FCA0769471E1/image-size/large?v=v2&px=999)
Now that you have identified the Components necessary to build your solution (as well as the Things involved in enabling said Components), you are almost ready to create your Data Model design.
Before moving onto the design, however, it is very helpful to get a good picture of how these Components interact with different parts of your solution. To do that, we recommend using a Thing-Component Matrix. A Thing-Component Matrix is a grid in which you will list Things in rows and Components in columns. This allows you to identify where there are overlaps between Components. From there, you can break those Components down into reusable Groups.
Really, all you're doing in this step is taking the list of individual Things and their corresponding Components and organizing them. Instead of thinking of each item's individually-required functionality, you are now thinking of how those Components might interact and/or be reused across multiple Things.
Sample Thing-Component Matrix
As a generic example, look at the chart presented here.
![IoTProductMgmt_2-1659123761198.png IoTProductMgmt_2-1659123761198.png](https://community.ptc.com/t5/image/serverpage/image-id/61231i32E27288F3948CC9/image-size/large?v=v2&px=999)
You have a series of Things down the rows, while there are a series of Components (i.e. Properties, Services, Events, and Subscriptions) in the columns. This allows you to logically visually identify how some of those Components are common across multiple Things (which is very important in determining our recommendations for when to use Thing Templates vs. Thing Shapes vs. directly-instantiated Things). If we were to apply this idea to our Smart Factory example, we would create two sections of our Thing-Component Matrix, i.e. the Overlapping versus Unique Components.
NOTE: It is not necessary to divide your Thing Component Matrix between Overlapping vs Unique if you don't wish to do so. It is done here largely for the sake of readability.
Overlapping Matrix
This matrix represents all the overlapping Components that are shared by multiple types of Things in our system:
![IoTProductMgmt_3-1659123761200.png IoTProductMgmt_3-1659123761200.png](https://community.ptc.com/t5/image/serverpage/image-id/61232iD3B1B2427086745C/image-size/large?v=v2&px=999)
Unique Matrix
This matrix represents the Components unique to each type of Thing:
![IoTProductMgmt_4-1659123761203.png IoTProductMgmt_4-1659123761203.png](https://community.ptc.com/t5/image/serverpage/image-id/61233i67ACDB0BD11E83DA/image-size/large?v=v2&px=999)
Step 6: Model Breakdown
![IoTProductMgmt_5-1659123761203.png IoTProductMgmt_5-1659123761203.png](https://community.ptc.com/t5/image/serverpage/image-id/61234i70075B1F430110C6/image-size/large?v=v2&px=999)
Breaking down your use case into a Data Model is the most important part of the design process for ThingWorx. It creates the basis for which every other aspect of your solution is overlaid. To do it effectively, we will use a multi-step approach. This will allow us to identify parts we can group and separate, leading to a more modular design.
Entity Relationship Diagram
To standardize the represention of Data Models, it is important to have a unified view of what a representation might look like. For this example, we have developed an Entity Relationship Diagram schematic used for Data Model representation. We will use this representation to examine how to build a Data Model.
![IoTProductMgmt_6-1659123761205.png IoTProductMgmt_6-1659123761205.png](https://community.ptc.com/t5/image/serverpage/image-id/61235i9FDC092C80A6BDC8/image-size/large?v=v2&px=999)
Breakdown Process
ThingWorx recommends following an orderly system when building the specifics of your Data Model. You've examined your users and their needs. You've determined the real-world objects and systems you want to model. You've broken down those real-world items by their Component functionality. Now, you will follow these steps to build a specific Data Model for your application.
Step | Description |
1 | Prioritize the Groups of Components from your Thing-Component Matrix by each Group's Component quantity. |
2 | Create a base Thing Template for the largest group. |
3 | Iterate over each Group deciding which entity type to create. |
4 | Validate the design through instantiation. |
In the next several pages, we'll examine each of these steps in-depth.
Click here to view Part 3 of this guide.